Author Topic: How to show sold items, disabling add to cart & using 'notify me' as plain text  (Read 500 times)

YourUnityStore

  • Beginner
  • *
  • Posts: 7
    • Your Unity Store
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!

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9139
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
your over ride should be in

templates\YOUR_TEMPLATE\html\com_virtuemart\sublayouts\addtocartbar.php
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

YourUnityStore

  • Beginner
  • *
  • Posts: 7
    • Your Unity Store
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!

YourUnityStore

  • Beginner
  • *
  • Posts: 7
    • Your Unity Store
You can see this in action here: https://yourunitystore.org/sold-items.html

pinochico

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 36
    • MiniJoomla
  • VirtueMart Version: 3
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
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates