Leave Product Price But diable add to cart for an out of stock items

Started by hotrod, May 07, 2020, 12:28:59 PM

Previous topic - Next topic

hotrod

  We do not track stock,  when I have a part that is Out Of Stock,  I remove the price.. and use an Out Of stock image for availability....  is there a way to leave the price in the field so it shows but not let the shopper add to cart?
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

pinochico

if you remove price, the rich snippets with price is existing still?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Jörgen

Turn on stock handling and set stock to ZERO.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

hotrod

If I turn on stock handling..  that would be a nightmare.. we have 5,000 parts..  and most are showing a negative.. I would have to edit every part to like 100..  should have done that years ago..
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

pinochico

In DB I will finish in 5 minutes for every products -> set negative stock to zero, what is the problem?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Jörgen

As pinochico sais, make adjustments in database for your stock. Quickly done and then make a strategy. Either handle stock or set stock to 100 000 pcs and then set to ZERO for those you do not want to add to cart.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

Yes if you remove price the product can look very odd and snippets has no price.

Turning stock handling on is an issue as you have no stock registered - so all items would be immediately pulled from sale -  so you need to update stock levels to a large values before turning this switch on!

One way of achieving this is to turn on stock handling and do not let ordering happen if 0 stock

Bearing in mind that you may have items already out of stock - you need to list these, as you will manually have to adjust at some point - I guess at the moment they have 0 price so should be easy when you set the price back to also handle the stock values!

You need to set your (non tracked) stock levels high to prevent accidental removal of items from sale

Do a simple SQL query via phpmyadmin and an SQL query on the VirtueMart  "products" table that sets items to a huge stock value in 2 seconds:


UPDATE YOURPREFIX_virtuemart_products AS p SET p.product_in_stock = 999999999;
UPDATE YOURPREFIX_virtuemart_products AS p SET p.product_ordered = 0;



To stop items being available to add to cart - manually set the stock to 0  and ordered to 0
When you do this the item will be out of stock and cannot be added to cart but the sales price will still be displayed along with a message regarding stock (this can be adjusted using a language override)

To bring items back for sale just set the stock to 999999999


Regards
A

Joomla 4.4.5
php 8.1

hotrod

This is a simple Data base task?   I get scared going in there.. : )
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

jenkinhill

Just remember to back up (dump) the database using phpMyAdmin before running the SQL.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Jörgen

Then i have something to help you. Regular labs has a dbreplacer that does this kind of things with a nice Interface. You can watch your replacements in real time before you decide to go through with them. I use the pro version because it has less limitations.
https://www.regularlabs.com/extensions
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

Or use phpmyadmin and my code with the table prefix adjusted :-)

YOURPREFIX

becomes the actual prefix for your tables :-)
Regards
A

Joomla 4.4.5
php 8.1