$cartProduct['PRODUCT_NAME']

  • Posts: 256
  • Thank you received: 2
5 years 8 months ago #295540

Hello I am trying to add a link to the email notification Product Name so it can link directly to the listed product on the website.

I know I need to alter this

$cartProduct['PRODUCT_NAME']
in the preload.php file. But what do I need to add to also call in the URL of the product from the website. I have tried a few variations but without success.

Thanks

Last edit: 5 years 8 months ago by dancingkazzaf.

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
5 years 8 months ago #295542

Hi,

By default you have that:

$cartProduct['PRODUCT_NAME'] = $t;
So you can try to change it to:
$productClass->addAlias($product);
$link = hikashop_contentLink('product&task=show&cid=' . (int)$product->product_id . '&name=' . $product->alias, $product, false, false, false, true);
$cartProduct['PRODUCT_NAME'] = '<a href="'.$link.'">'.$t. '</a>';
Note that you're not in the same context than when HikaShop generates the link on the listing.
First, the URL needs to be absolute in an email while it needs to be relative on a listing.
Also, you don't have the itemid available here while it is available on the listings.
So I don't guarantee you'll have the exact same link.

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

  • Posts: 256
  • Thank you received: 2
5 years 8 months ago #295564

Hello thats great. The URL itself wasn't to important, all I wanted it to do is link to the product page which is does.

Thanks alot!

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

Time to create page: 0.057 seconds
Powered by Kunena Forum