VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Thanasis on January 04, 2016, 15:43:21 PM

Title: How to change Choose a variant link
Post by: Thanasis on January 04, 2016, 15:43:21 PM
Hi all, i want to know how to change the "Choose a variant" link. I want to have the same link with image to go to details page.
Thanks.
Title: Re: How to change Choose a variant link
Post by: jenkinhill on January 04, 2016, 18:48:03 PM
Start here:  http://forum.virtuemart.net/index.php?topic=79799.0

Your question is not clear. Exactly what do you want to change the Coose variant link to? Are you saying you want to replace it with an image?
Title: Re: How to change Choose a variant link
Post by: Thanasis on January 04, 2016, 21:24:35 PM
Thanks you for your replay, i have VM 3.0.10 and i use the plugin "stockablecustomfields". When i press the "Choose a variant link" without to choose variants i want to open the product in details page.
The image of the product have the link, if i click to the image it opens the details page of the product. Is there a solution to change this link to have the same as the image?
Title: Re: How to change Choose a variant link
Post by: jenkinhill on January 04, 2016, 22:53:46 PM
You should not be using VM3.0.10 now.  http://virtuemart.net/news/latest-news/473-security-release-virtuemart-3-0-12

To change the button action, assuming you use the default VM templates,  you can edit and create an override for components/com_virtuemart/sublayouts/addtocartbtn.php    http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Title: Re: How to change Choose a variant link
Post by: GJC Web Design on January 04, 2016, 23:03:42 PM
standard template?  assume from the category page?

the choose variant button is rendered in


components\com_virtuemart\sublayouts\addtocartbtn.php

prob over ride the

echo '<span name="addtocart" class="addtocart-button-disabled" title="'.vmText::_( 'COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT' ).'" >'.vmText::_( 'COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT' ).'</span>';

with something like

echo '<a title="<?php echo $product->product_name ?>" href="<?php echo $product->link.$ItemidStr?>"><span name="addtocartxx" class="addtocart-button-disabled" title="'.vmText::_( 'COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT' ).'" >'.vmText::_( 'COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT' ).'</span></a>';

but only for cat page..  use a different over ride for details

or just delete it and keep the details button