Delete the "Add to Cart" button on all Virtuemart types, except in product files

I created my own plugin. I want the customer to only be able to "add to cart" using these created fields, only in the productdetails view. Until then, no add button to the cart should be displayed. I also achieved this using javascript through the system plugin, although I am looking for a better solution, like removing it using some functions, such as: plgVmOnDisplayProductFEVM3 or something else. Since another object may have a different class for "addtocart-bar"

I would also like to know if there is anything that we can only remove "quantity-box" and "quantity control" from "addtocart-bar"

+4
source share
1 answer

I can replace the virtuemart 'add to cart' button. I can achieve this with Studio42 in the virtuemart forum, a discussion of this url .

The following code, only with php, will work:

//this will remove 'addtocart' button, but show 'choose a variant', 
// and also show quantity selector
$product->orderable = false;

//this along with above line of code will totally replace it 
//with your own button
$product->addToCartButton = '<div>my own button</div>';
+4
source

Source: https://habr.com/ru/post/1661213/


All Articles