Joomla version: Joomla! 3.9.11 Stable
Virtuemart version: 3.6.0
See reply #8 by snowgoose on May 3rd 2019 located at:
http://forum.virtuemart.net/index.php?topic=142498.0
I was able to follow snowgoose's work-around for being able to display products that have been sold by creating a 'Sold' category in VM and moving products that have been sold into it.
Using the 'Notify me' link to confirm 'Sorry, this item is out of stock' works well although I can't remove the link, despite replacing the PHP code:
<a href="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $product->virtuemart_product_id); ?>" class="notify"><?php echo vmText::_ ('COM_VIRTUEMART_CART_NOTIFY') ?></a>
WITH:
<?php echo vmText::_'COM_VIRTUEMART_CART_NOTIFY') ?>
I was having great difficulty in setting up an override, so as a test I made the change in the original addtocartbar.php file. Despite this, I still can't get it to render as plain text.
You can view the generated page here:
https://yourunitystore.org/sold-items.html
Where have I gone wrong ~ can anyone offer me any tips? Is the sub layout category the right location to do this?
I've used overrides in Joomla with great success (until now), so I must be having a crazy moment with this one. lol
Anyhow, any and all help will be greatly appreciated!
your over ride should be in
templates\YOUR_TEMPLATE\html\com_virtuemart\sublayouts\addtocartbar.php
Thank you very much for steering me in the right direction, GJC. This solution has enabled me to display 'Sorry, this item has been sold." as plain text on the page.
However, the image remains clickable and when taken to its own page, the following is displayed (please see attachment).
What would be the best approach to stopping sold item images from being clickable in these circumstances?
Thank you for your continued help!
You can see this in action here: https://yourunitystore.org/sold-items.html
Hi,
We use override in the template with the condition to checkbox discontinued on the product detail in the administration.
We do not use a special category for sold out products.
Discontinued products
- not in the category listing
- not in search results
- not in filtering results (if using customfilters for)
- indexed URL still exists (does not generate 404)
- the product cannot be ordered, alternative products are displayed in the module
- the product can be inquired by email
The result is here:
https://kolopark.easy.minion.cz/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=17473&virtuemart_category_id=747&Itemid=596
For me is the better solution.
Best Regards
Rudolf