ecommerce more info button on product list
Permalink
Hi
I'm wanting to add a More Info button on the product list items that will link to the product page.
I have added
<div class="moreinfo"><a href="">More Info</a></div> to the plain template which adds it OK but i'm not sure what php coded i need to add to the <a href=""> to make ut link to the relevant product detail page. Obviously if you click on the image or title it takes you to the page but can't seem to find the code that generates that link.
Thanks in advance.
I'm wanting to add a More Info button on the product list items that will link to the product page.
I have added
<div class="moreinfo"><a href="">More Info</a></div> to the plain template which adds it OK but i'm not sure what php coded i need to add to the <a href=""> to make ut link to the relevant product detail page. Obviously if you click on the image or title it takes you to the page but can't seem to find the code that generates that link.
Thanks in advance.
Thanks for that, I have actually got it working using the plain template by just adding
<div class="moreinfo"><?php echo $link_before.Details.$link_after?></div> can only use a single word for the button text though as the space between two words causes errors!!!
<div class="moreinfo"><?php echo $link_before.Details.$link_after?></div> can only use a single word for the button text though as the space between two words causes errors!!!
Try
$link_before.'More Details'.$link_after
$link_before.'More Details'.$link_after
Brilliant it worked, Thanks.
The two elements that are relevant are:
/packages/core_commerce/elements/product/display.php
/packages/core_commerce/elements/product/display/properties.php
It may depend on where you are adding your link to which one you need to override, but perhaps look at properties.php first. You would copy them to:
/elements/product/display.php and
/elements/product/display/properties.php respectively.
At the top of both of these, you'll see some code that generates the link that goes around the product image, $link_before and $link_after. Simply use those to create your link in the appropriate place within the element file.