News:

Looking for documentation? Take a look on our wiki

Main Menu

How to get product link by id,sku or etc ?

Started by XFaktor, July 03, 2012, 11:20:53 AM

Previous topic - Next topic

XFaktor

How to get product link by id,sku or etc ?

For example i am in one product detail page (product1), i have others product id as variable (product2), and i need to have a link to product2 in product1 page :)

p.s. Damn this forum is slowest i have ever seen :)

Thanks.

XFaktor

Anyone ? how to get product link (url) by any one parameter of it (id,sku,name) ?

srajca

#2
try something like this
<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id), $product->product_name, array('title' => $product->product_name)); ?>
and try changing this (.$product->virtuemart_product_id.) with your product id (shown in vm config).

ALSO

Quote from: XFaktor on July 03, 2012, 11:20:53 AM
p.s. Damn this forum is slowest i have ever seen :)
Thanks.

THIS is NOT by any means going to help you get answers or solutions to your problems.