Add to cart button input tag is selected from its class instead of its id

Started by razor7, May 17, 2012, 18:48:15 PM

Previous topic - Next topic

razor7

Hi, I had a terrible bad time on styling my "add to cart" button, because i wanted to look different on categories and product details.

The code of the standard add to cart button is this:
<input type="submit" name="addtocart" class="addtocart-button" value="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" title="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" />

If you change the "class" attribute, lets say you want a different class to control styling it brokes javascript addtocart popup. In my case, I wanted this to work
<input type="submit" name="addtocart" class="addtocart-button-cat" value="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" title="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" />

I think that the javascript that handles addtocart popup functionality, must select the add to cart tag by some ID instead its class value.
<input type="submit" name="addtocart" id="addtocart-button" class="addtocart-button" value="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" title="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'?>" />

Thanks for adding this in future releases.

Best regards!

MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

razor7

MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store