News:

Looking for documentation? Take a look on our wiki

Main Menu

Manage discontinued products

Started by restodo, November 26, 2016, 14:45:41 PM

Previous topic - Next topic

Studio 42

@julash
This solution is not right, eg. when you display in a module

sgrunch

I have add this code in product.php row 462 for not show the discontinued products

if ($isSite){

            $where[] = 'p.`product_discontinued` != 1';
        }

julash

Hi, latest virtuemart has a hidden config to hide discontinued products.

Please add "discontinuedPrdsBrowseable=0" in virtuemart.cfg. Then resave virtuemart configuration from admin. This will hide discontinued products.

I did not check this with with vm module. But this code below from administrator/components/com_virtuemart/models/product.php, helped me hide discontinued products from result page and module of 'custom filters' extension.

if($group!='discontinued' and !VmConfig::get('discontinuedPrdsBrowseable',1)){
$where[] = ' p.`product_discontinued` = "0" ';
}



Thanks
Julash

vasite

Even if I check discontinued, nothing changes in frontend. I mean no notice "discontinued" or a special class on the product view.
In fact, I would like to show special css badge if product marked as discontinued. To do this, I should have a special class eg "discont". Is this possible?

Studio 42

Hi, adding badge have nothing to do with discontinued, but of course you can check any values and add badge. Eg. creation date, price, featured ... and add CSS depending this.
For a customer, i added different class by discount percent eg., all this need to be done in your template files and not in Virtuemart itself.

sgrunch

Quote from: julash on December 15, 2017, 18:37:55 PM
Hi, latest virtuemart has a hidden config to hide discontinued products.

Please add "discontinuedPrdsBrowseable=0" in virtuemart.cfg. Then resave virtuemart configuration from admin. This will hide discontinued products.

I did not check this with with vm module. But this code below from administrator/components/com_virtuemart/models/product.php, helped me hide discontinued products from result page and module of 'custom filters' extension.

if($group!='discontinued' and !VmConfig::get('discontinuedPrdsBrowseable',1)){
$where[] = ' p.`product_discontinued` = "0" ';
}



Thanks
Julash

I can try it. But the where condition is not correct because product_discontinued can egual null or 0. The correct is not 1.

I want see the detail prdduct page - I have created a specific information when the product is discontinued.

EIF

#51
How can I hide a discontinued product in a category view listing?
I want to keep the product detail page url for the search engines. Some products that are discontinued are in multiple categories. I want those products to be disappear there, but keep the detail pagina.
So the product is still active, but discontinued.

I have tried Jukash option: "Please add "discontinuedPrdsBrowseable=0" in virtuemart.cfg. Then resave virtuemart configuration from admin. This will hide discontinued products.".
This works(!), but is this also a setting in the backend somewhere?

GJC Web Design

QuoteThis works(!), but is this also a setting in the backend somewhere?

the VM admin are just a way to write to virtuemart.cfg - why is manually writing a problem?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

It is not really a problem, but I like to have everything managed in the backend. So I was looking for an option to write it automatically to the cfg file, like the other settings.

jenkinhill

Config options which are considered to be rarely if ever used are hidden settings in the .cfg file. Too many available options in the backend will confuse many users and probably lead to support issues!
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

Studio 42

Jenkill. I think that all this BETA/rarely used/ not many tested ... setiins, should be all groupped in the same TAB with a Warning.

Marttyn

Quote from: Studio 42 on November 14, 2018, 22:20:39 PM
Jenkill. I think that all this BETA/rarely used/ not many tested ... setiins, should be all groupped in the same TAB with a Warning.

That is a very good idea!

Otherwise having the "discontinued" checkbox on the product backend is not very useful... or show both, or hide both...

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Marttyn

Thanks! But I dont see the discontinued option in your Jooglies snapshot.
This template only affects VM? Or is also Joomla template?

jenkinhill

No that option is not there. Only the following:
Quality of resized JPGs    
reuseorders    
full_catname_tree    
Name of invoice in shop language    
Mail debug
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