This is working well, but how do we hide it if there is zero inventory. Basically I want to replace "Add to Cart" with "Product Unavailable" when product is out of stock. Right now, it displays no matter what, and user can still add it to cart even if there is zero inventory. (On catalog and details pages)
Thanks in advance
communion,
This setting is available in Configuration. >>shopfront>>set >>display "notify Me">.select image just below>>as you like.
Versions : 2.0.9 Plus - should use 2.0.10.
FYI, the image only applies to the field below that "Products Out of Stock are orderable, and the field 'Availability' below is displayed" FYI.
I ended up hacking the AddToCart_default as such:
1. Create a new CSS class for the replacement image in your template
2. Comment out this line as so:
<!--<a href="<?php //echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id='.$this->product->virtuemart_product_id); ?>" class="notify"><?php // echo JText::_('COM_VIRTUEMART_CART_NOTIFY') ?></a>-->
3. Replace with an empty div with your class, like:<div class="not-available"></div>
This will replace "Notify Me" Link with an image that you specify in your template CSS. It will automatically swap the "Add to Cart" button with your new image on items that have zero inventory.
This is extremely useful if you want a mixture of items that are for sale with items that are not. In my project case, it is a gallery that only has certain prints available.
Hope this steers someone in the right direction. It would be good functionality to offer an image (without notify.html link) in place of Add To Cart button in a future relase.
Cheers
Just for interest could you show me an image of what you changed. I'm sure I misunderstood.
To change any text - in VM2 you simply use the joomla Language manager - no hacking - just a replace text option.
[attachment cleanup by admin]
In my case I'm showing the Add to Cart btn on Categories and Product details. I needed to replace the quantity and button with a custom image if the item was out of stock. Right now, the only option that worked well for me was to choose "Notify Me" option in the backend. So what I essentially did was enable that option, then in my template, I commented out the lines that generate the "Notify Me" link and replaced with an empty div with a custom class with assigned image in my CSS. This replaced "Notify Me" link with my custom image "Not Available".
Does that make sense?