Customize email "order shipped"

  • Posts: 113
  • Thank you received: 2
7 years 6 months ago #254247

Ok, no problem.

Screen 1: email preview (see the link above the arrow). Link correct in image and product code



Screen 2: email code in System > email


Screen 3: email code in google chrome page analysis


Thank You!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 6 months ago #254251

Hi,

It might be that gmail doesn't link for the p tag around the product name to be inside the a tag as it's not valid HTML.
Try instead to change the line:
$t = '<p>' . $item->order_product_name;
to:
$t = '<p><a href=" mywebsite.com/ ' .$product->product_canonical.'">' . $item->order_product_name.'</a>';
in the preload section of the email.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254398

hello Nicolas,
I do not think that the problem depends on gmail, because the product name is not linked even in the preview sending the mail backend. I attach screenshots.
So it will be a code problem.



But there is another problem! The product is properly linked if not features. If there is a product that has the characteristics then the canonical url does not work. It does not appear the canonical url, but is only the link to the home page! It is not strange?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #254430

Hi,

Regardless the reason, the fact is that having a a tag around p tags is not correct, be it for gmail, or your browser.
Please try the modification I proposed in my previous message. It should help.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254451

HI Nicolas,

Perfect. This solves one problem. Now the name of the product is properly linked. :)
However, it remains the other problem: if a product has the characteristics (variants), the canonical url does not work, the link leads to the home page. How can solve this problem?
Thank You!

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #254453

Hi,

For variants, you'll have to do instead:

if($product->product_parent_id){
$productClass = hikashop_get('class.product');
$main = $productClass->get($product->product_parent_id);
$product->product_canonical = $main->product_canonical;
}
$t = '<p><a href=" mywebsite.com/ ' .$product->product_canonical.'">' . $item->order_product_name.'</a>';

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254493

hello Nicolas,
good as always! It seems that now everything works! :)

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254661

hello Nicolas,

I noticed that with the code that you suggested I enter, the problem is solved, but only for one product. In case of multiple orders just a product has the correct link, others not, link only to the home page. is a code problem?

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #254691

Hi,

I'm sorry but I don't understand what you mean. Could you provide an example with some screenshots of the problem ?

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254746

Hi Nicolas,

if an order comes with 2 or more products, only the first product has the correct link, the other not. Attach screenshots.
Correct link, product 1:


Wrong link, product 2:

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4540
  • Thank you received: 612
  • MODERATOR
7 years 5 months ago #254815

Hello,

And does other products have cannonical url set in their back end configuration ?



Awaiting news from you.

Regards

Attachments:
Last edit: 7 years 5 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254843

Of course, all products have set the canonical url.

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #254848

Hi,

On your screenshots, you're looking at the link of the image, not the link of the product name.
And the code I gave you was for the link of the product name.
So I don't see how these could be related.
There should be no link on the product image unless you added some other custom code I don't know about.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #254950

Hello Nicolas,
here's a screenshot of the code in System> Email


The link does not change if placed in the name or the image of the product. The problem is another. Some products are linked properly, some not! And all the products have the canonical URL correctly filled. Because some products are linked, and others have the link to the home page? that's what I do not understand!

Attachments:
Last edit: 7 years 5 months ago by gioxd.

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #254985

Hi,

You need to have the canonical URL filled for all the products in your backend interface. If the canonical URL is not missing, then the URL will be empty and it will use instead the homepage URL of your website.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 5 months ago #255011

Hi Nicolas,

I thought I have already said, all the products have the canonical URL. All.
So if all the products have the canonical URL, the problem has to be another.

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 5 months ago #255222

Hi,

I've done the test myself on my end with similar links and product tags in the orders notification emails and I got the links as I expected. Each product had his canonical URL as a link on its image. And for the name it required the modification in the preload, as I already explained, and that worked too.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 3 months ago #260404

I contact you after so long because only now I found that the system does not work. Many customers have complained that when they click the link, you will see an error page. Here it is: www.laputea.com/it/?option=com_content&view=article&id=3
In desperation I removed the custom code in system> email, because it is better not to insert any links rather than a corrupt link!
I do not understand because first the system worked only for a few links, and now it does not work. There is a way to invite the customer to click on the product link and comment on it bought? I do not ask much, just a basic service!

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
7 years 3 months ago #260461

Hi,

The solution I gave is the correct one. As I said, I tested it myself on my end.
You say that you don't ask much, just basic service, but that's already custom development. Please remember that the support we provide is user support not developer support. So we're supposed to help you in using HikaShop, not in customizing it.
I feel we already went way above what we're supposed to by providing hints, code mofications and even tested the change on our end but you just expect us to do your work for you.
If you need a developer to do that for you, then please hire one to do it. I hope you can see the situation from our point of view.

I also don't see the link between what you're trying to do and the link you give in your last message. That link is a link to a joomla article which doesn't exists anymore. It has nothing to do with a HikaShop product page canonical URL.
If the URL you get on the image in the email is this one, it means that you used that URL in the canonical URL of the product. The problem thus is not with the code modification but with what you added in the canonical URL field of the product.

Please Log in or Create an account to join the conversation.

  • Posts: 113
  • Thank you received: 2
7 years 3 months ago #260476

Hello Nicolas,
I did not want to offend, I wondered just because the link to the product are correctly generated in the mail administrator and are not generated in the mail to the customer's order confirmation. I thought it was a simple and basic function of an e-commerce.
Anyway I did more tests. Why when I click on the product name link exits the error page of joomla is because the link is incorrect.
It states that the canonical url of the products is made like this (example):
www.laputea.com/it/negozio/prodotti-per-...bottiglia-olio-fiore
All products have a canonical url.
In email> I have this html code:


In email> preload version I have this code:

Now, I do not know why, but the generated link is this:
www.laputea.com/www.laputea.com/it/negoz...bottiglia-olio-fiore
The mistake lies in the fact that the code generates a www.laputea.com/ that has nothing to do!
I think the error is in preload version.
In sef url options have these settings:

So I wonder what generates a url right and because in some linked products in the mail is not generated the canonical url?

Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.143 seconds
Powered by Kunena Forum