News:

Looking for documentation? Take a look on our wiki

Main Menu

How to change Choose a variant link

Started by Thanasis, January 04, 2016, 15:43:21 PM

Previous topic - Next topic

Thanasis

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.

jenkinhill

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?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Thanasis

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?

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation