Hi,
please is there a way to disable addtocart button for selected availability? I have an eshop where stocks do not apply for all products, so using general config for 0 stock is not a solution. But there is an image availability vyprodano.jpg (sold out) for which I would need to disable add to cart and replace it by notify button.
vyprodano.jpg ? applied as a custom field?
If so .. detect if the field is present.. if so hide/replace the add to cart
Hi,
It's possible to write a little plugin to use a custom field to disable add to cart button(or other feature)
Not sure, but I think you need only to enable one option. Ah yes "Stockhandling on product level ", it is directly above the radio list of the options "Action when a Product is Out of Stock"
Hi,
not as custom field, but as availability field - image.
People must be able to order other products with 0 stock that have different availability images (one week etc.) but this one availability means sold out - for lets say couple months, so he does not want to unpublish the product yet. But we want to allow them to fill in the Notify me form for this product.
then this is the way
QuoteIf so .. detect if the field is present.. if so hide/replace the add to cart
check for the image name - probably do it in templates\xxxxxx\html\com_virtuemart\sublayouts\addtocartbar.php
Quote from: Milbo on December 29, 2017, 11:56:51 AM
Not sure, but I think you need only to enable one option. Ah yes "Stockhandling on product level ", it is directly above the radio list of the options "Action when a Product is Out of Stock"
Ehrm?
I just assign a different product details page on which the AddToCart button is disabled to those products and add a 'sold out' text into the availability text field.
For this I've created a different sublayout which is a copy of 'addtocart.php' with the addtocart button disabled and named it 'noaddtocart.php'.
Then created a copy of ...\components\com_virtuemart\views\productdetails\tmpl\default.php and replaced
Quoteecho shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));
with
Quoteecho shopFunctionsF::renderVmSubLayout('noaddtocart',array('product'=>$this->product));
and stored that as 'not-available.php', which I can select as the Product Details Page.
JJK, this solution does not work on category view or modules .
Quote from: Studio 42 on January 02, 2018, 23:27:16 PM
JJK, this solution does not work on category view or modules .
True, but I don't have that problem, because I disabled the addtocart button in those (in order to force my customers to look at the full description before adding a product into the cart)