Author Topic: How to change Choose a variant link  (Read 1157 times)

Thanasis

  • Beginner
  • *
  • Posts: 22
  • netadmin.gr
How to change Choose a variant link
« 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.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27387
  • Always on vacation
    • Jenkin Hill Internet
Re: How to change Choose a variant link
« Reply #1 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?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.3.10057 on Joomla 3.9.6 PHP 7.0.33
Testing VM 3.4.5.10059 on Joomla 3.9.6

Thanasis

  • Beginner
  • *
  • Posts: 22
  • netadmin.gr
Re: How to change Choose a variant link
« Reply #2 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?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27387
  • Always on vacation
    • Jenkin Hill Internet
Re: How to change Choose a variant link
« Reply #3 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
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.3.10057 on Joomla 3.9.6 PHP 7.0.33
Testing VM 3.4.5.10059 on Joomla 3.9.6

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8872
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to change Choose a variant link
« Reply #4 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

Code: [Select]
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

Code: [Select]
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation