VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: YourUnityStore on September 27, 2019, 17:02:52 PM

Title: How to show sold items, disabling add to cart & using 'notify me' as plain text
Post by: YourUnityStore on September 27, 2019, 17:02:52 PM
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!
Title: Re: How to show sold items, disabling add to cart & using 'notify me' as plain text
Post by: GJC Web Design on September 27, 2019, 18:06:29 PM
your over ride should be in

templates\YOUR_TEMPLATE\html\com_virtuemart\sublayouts\addtocartbar.php
Title: Re: How to show sold items, disabling add to cart & using 'notify me' as plain text
Post by: YourUnityStore on September 29, 2019, 17:00:20 PM
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!
Title: Re: How to show sold items, disabling add to cart & using 'notify me' as plain text
Post by: YourUnityStore on September 29, 2019, 17:04:06 PM
You can see this in action here: https://yourunitystore.org/sold-items.html
Title: Re: How to show sold items, disabling add to cart & using 'notify me' as plain text
Post by: pinochico on October 16, 2019, 07:57:38 AM
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