I have created a custom plugin. I want a buyer should only be able to 'add to cart' using these created fields, only on productdetails view. Until then, no add to cart button should be displayed. I also achieved this using javascript via a system plugin, though I am looking for a more better solution, as removing it via some function like - plgVmOnDisplayProductFEVM3 or something else. As a different templace could have different class for 'addtocart-bar'
I would also like to know is there anyhow we can remove 'quantity-box' and 'quantity-control' only, from 'addtocart-bar'
just clone the sublayout and do the change
then call this in the category views
Check the jinput "view" value and set $product->orderable to false when this is not "productdetails"
Thanks @studio42, that is what I was looking for. I didn't though it would be that simple. Though there is one more thing, I hope you can suggest something better for it. Whenever $product->orderable is set to false then a new button takes its position for that product, and that is 'choose a variant'. I even didn't need that, on debugging more into $product, I didn't found any parameter that can remove this button too.
You can overide addtocart button if you prefere using in the same loop
$product->addToCartButton = 'my new button';
if you use $product->addToCartButton = '';
it not work, for empty button use $product->addToCartButton = '<span></span>';
Another solution is to modify the sublayouts/addtocartbtn.php but this is then for all the shop including non orderable in productdetails view..
@Studio42 ok, this worked well. Thanks for all your responses. I wanted to create my own button and I am able to do it now.
Thanks again!
Quote from: Studio 42 on November 21, 2016, 18:33:40 PM
Another solution is to modify the sublayouts/addtocartbtn.php but this is then for all the shop including non orderable in productdetails view..
Hi guys... if I wanted to achieve the above (have a new button for each product on category page that simply links to product page), which specific strings should I be looking at changing? I could probably work it out after a bit of messing about, but any advice that will save me on added stress would be much appreciated.
Many thanks!!!
@driver_wedge : if you need ofr the whole shop, then remove addtocart render in the sublayout products.
Thanks S42. Basically, I want to get rid of 'choose a variant' from the products that have variants, and therefore not orderable....therefore, I think the simplest option is to remove the add to cart button althogher across the site and replace it with a new button which displays 'view product', or something similar. I would prefer customers to visit the product page anyway, rather than add to cart from the category page.
I realise that I can probably get this done by someone more knowledgeable than me for a small fee, but I'd like to have a look and understand how the relevant php code renders in the front end.
Does that make sense?
Thanks again...
maybe my mini (mini) doc on how i did this for me may help a bit too...: http://forum.virtuemart.net/index.php?topic=136472.msg477005#msg477005