Skip to main content

$cartProduct['PRODUCT_NAME']

More
8 years 2 months ago - 8 years 2 months ago #295540 by dancingkazzaf
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
Code:
$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: 8 years 2 months ago by dancingkazzaf.

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

More
8 years 2 months ago #295542 by nicolas
Hi,

By default you have that:
Code:
$cartProduct['PRODUCT_NAME'] = $t;
So you can try to change it to:
Code:
$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.

More
8 years 2 months ago #295564 by dancingkazzaf
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.165 seconds
Powered by Kunena Forum