VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: restodo on November 26, 2016, 14:45:41 PM

Title: Manage discontinued products
Post by: restodo on November 26, 2016, 14:45:41 PM
Hi,

I want to know If you are planning to add something to manage discontinued products.
It's an important function because good practices for search engines are not delete discontinued products.

I've solved temporaly this problem modifying product template but I think it'll be good to have OOB.


Regards!
Title: Re: Manage discontinued products
Post by: AH on November 26, 2016, 16:09:15 PM
Create your own re-directs for products that you remove from the inventory

Title: Re: Manage discontinued products
Post by: restodo on November 26, 2016, 16:20:46 PM
Thanks for your reply but I don't want to remove from the inventory.

It's important to have discontinued products to be compared with new ones.
Title: Re: Manage discontinued products
Post by: GJC Web Design on November 26, 2016, 17:10:58 PM
But u don't state what u want to do with them....

why not set the stock to 0 and remove the notify button?
Title: Re: Manage discontinued products
Post by: restodo on November 26, 2016, 17:25:26 PM
Quote from: GJC Web Design on November 26, 2016, 17:10:58 PM
But u don't state what u want to do with them....

why not set the stock to 0 and remove the notify button?

I think discontinued products should be shown last in listing without price and have a marker to notify plugins, for example Customfilters Pro, and then the plugin doesn't take into account in price filter.

Setting stock to 0 and removing Notify button I think it's not solve the problem.

Thanks anyway.
Title: Re: Manage discontinued products
Post by: Studio 42 on November 27, 2016, 00:10:04 AM
For product prices, Set a end period, so price should not be valid and add to cart is disabled too.
If Customfilters Pro check for price period, this sould solve it at same time.
Title: Re: Manage discontinued products
Post by: K&K media production on November 27, 2016, 12:07:14 PM
try vm 3.0.18.5
http://dev.virtuemart.net/projects/virtuemart/files

there is a checkbox "discontinued" next to "featured" -> you can use this to display a badge in your template or display it on product modul or inside the category section

on product status tab you can use a stockhandle action on product level if its is enabled in main config stockhandle (there is a checkbox to enable the stockhandle on product level)
Title: Re: Manage discontinued products
Post by: restodo on November 27, 2016, 15:47:41 PM
Quote from: K&K media production on November 27, 2016, 12:07:14 PM
try vm 3.0.18.5
http://dev.virtuemart.net/projects/virtuemart/files

there is a checkbox "discontinued" next to "featured" -> you can use this to display a badge in your template or display it on product modul or inside the category section

on product status tab you can use a stockhandle action on product level if its is enabled in main config stockhandle (there is a checkbox to enable the stockhandle on product level)

Thanks for the tip! I'll try.

I understand that VM 3.0.18.5 is still beta, do you know when are you planning to release a stable version?

Title: Re: Manage discontinued products
Post by: K&K media production on November 28, 2016, 13:00:18 PM
I use it on a live site and would say this version is more stable than 3.0.18.

Try it on a test site and if you have no other issues, you should use it on your live site.
Title: Re: Manage discontinued products
Post by: Studio 42 on November 28, 2016, 14:31:02 PM
3.0.18.5 fix most stable release bugs from 3.0.18, but this are not tested.
In most case, you have more luck that your problem is solved in 3.0.18.5, but this can add other bugs too.
Title: Re: Manage discontinued products
Post by: franzpeter on November 28, 2016, 15:20:10 PM
I would recommend to be a little bit more careful by saying people should install VM 3.0.18.5 for live pages. It is a developer version and it may not work with all existing templates!!!
Title: Re: Manage discontinued products
Post by: K&K media production on November 28, 2016, 15:54:35 PM
QuoteTry it on a test site and if you have no other issues, you should use it on your live site.
Title: Re: Manage discontinued products
Post by: restodo on November 28, 2016, 17:26:20 PM
Quote from: K&K media production on November 28, 2016, 15:54:35 PM
QuoteTry it on a test site and if you have no other issues, you should use it on your live site.

Thanks for all your answers.
Of course I'll try on test site, I have test, pre and live.

Regards!!
Title: Re: Manage discontinued products
Post by: Marttyn on March 23, 2017, 19:57:34 PM
What is supposed to do?
I checked some products as discontinued, but they still show as normal. And can still be ordered.
Is something that the template should manage?
I mean, a template override should check if product is discontinued and disable price, add to cart, and show a badge?
Or its something tha VM manage directly?
Regards!
Title: Re: Manage discontinued products
Post by: jenkinhill on March 24, 2017, 00:06:43 AM
See http://virtuemart.net/news/latest-news/479-virtuemart-3-2-cached-and-optimized

Changelist - backend:
" - added discontinued products "
Title: Re: Manage discontinued products
Post by: Marttyn on March 24, 2017, 17:29:26 PM
Thanks jenkinhill for your reply, although its not very useful  ::)
Im aware that the discontinued product feature was added... my question was about how to use it, as its not showing any difference when products are marked as discontinued.
Maybe the template should check if the product is discontinued and change the output (dont show price, remove add to cart button, etc)? Or its virtuemart the one that should change the output, show a badge, or something else?
Regards
Title: Re: Manage discontinued products
Post by: aftertaf on March 24, 2017, 18:29:21 PM
i was wondering also what the intention and front-end/back-end functionality was on this feature. It could potentially be very useful
Title: Re: Manage discontinued products
Post by: lindapowers on March 24, 2017, 19:04:08 PM
I have been testing it and the only thing I noticed is that marking a product as discontinued can be shown in the top parent category view or the category itself just as "featured products" but in a different level.

I share the same doubts as you and I wonder what is the difference between a product out of stock with no category assigned and a discontinued product.

Logic tells me an out of stock could be something temporal and dicontinued won't be active never again.

I will think of discontinued products taking Amazon as an example when they mark a product as "Not available".
In VM to achieve this you can simply set a product out of stock and not assing any category to it.
The product will still remain there for browsers but customers won't see it.


Now... marking it as "discontinued" could be shown in the tab "discountinued" but what is the benefit of it or the difference between the "out of stock" & "remove category" method.

Maybe the term is something we don't understand either cause why can I set a product as "discontinued" while having stock and being able to buy it. Maybe it means that it won't be build more??

We probably don't understand the logic behind it cause discontinued as I see it now is not needed since VM can achieve the same effect with the method described but please enlighten us on the use of it.

Anyway interesting doubts that we have too.


Regards
Title: Re: Manage discontinued products
Post by: Marttyn on March 24, 2017, 19:33:59 PM
For me discontinued products is very useful. Your method is not valid for me, as i dont keep stock, so giving 0 stock is not enough, clients could order it anyway. Also i would like to be visible in the same category.
Discontinued product is also a way of showing that the product is not available anymore, and in my case, a new version will be available in replacement. But clients can see both.

I think its "easy" to implement in the template. Just check if product is discontinued, and in this case change the output accordingly.
Just a confirmation would be fine, and i would do the changes myself to my template. But i dont want to do the work in the wrong way, because maybe this feature is implemented differently, or automaticaly handled by VM. Just need to know.
Title: Re: Manage discontinued products
Post by: K&K media production on March 24, 2017, 23:14:17 PM
QuoteI think its "easy" to implement in the template. Just check if product is discontinued, and in this case change the output accordingly.
Just a confirmation would be fine, and i would do the changes myself to my template.

Yes you can do this. It is the same workflow like "featured". You can give them a badge in your template or show a extra section.

Furthermore you can activate "Stockhandle on product level". In this case you have a stockhandle option for each product inside the status tab. So you can deactivate the add to cart button for your discontinued products if they are out of stock.
Title: Re: Manage discontinued products
Post by: restodo on July 18, 2017, 03:32:31 AM
It's almost 8 month since my first post and at the moment Virtuemart didn't implemented in a correct way the discontinued products.
It's an advanced to hace a check box in product administration but with only implementation like Feature page or Last products it isn't enough.

In my case I modify several files of my template (layout files) to implement discontinued in category, product details, feature, last products, and every place a discontinued product could be seen so the product hide buy button.

The only problem I've found is when I tried to implement discontinued in category to hide discontinued products from listings, for example 12 products per page, the discontinued product was hidden but an empty space left. The files I modified was products.php and products_horizon.php in sublayouts directory of my com_virtuemart of my template.
Title: Re: Manage discontinued products
Post by: K&K media production on July 18, 2017, 13:03:07 PM
What you want must be done with stock....disable products with stock lower 1.
Title: Re: Manage discontinued products
Post by: Studio 42 on July 18, 2017, 15:44:15 PM
Quote from: K&K media production on July 18, 2017, 13:03:07 PM
What you want must be done with stock....disable products with stock lower 1.
Stock have nothing todo with discontinued products.
I have some shops that need that product with 0 stock are displayed and discontinued too.
In some case :
>discontinued = no cart
>not in stock = Longer delivery time
But you can have other cases.
I have see in other shops to stay in the google search results, they add discontinued in the end of the list.
So you should have the option to hide it, remove the "add to cart",  add it at end of list in the category or add a badge ....
Title: Re: Manage discontinued products
Post by: restodo on July 18, 2017, 16:45:55 PM
Quote from: Studio 42 on July 18, 2017, 15:44:15 PM
Quote from: K&K media production on July 18, 2017, 13:03:07 PM
What you want must be done with stock....disable products with stock lower 1.
Stock have nothing todo with discontinued products.
I have some shops that need that product with 0 stock are displayed and discontinued too.
In some case :
>discontinued = no cart
>not in stock = Longer delivery time
But you can have other cases.
I have see in other shops to stay in the google search results, they add discontinued in the end of the list.
So you should have the option to hide it, remove the "add to cart",  add it at end of list in the category or add a badge ....

Exactly!

Nobody in the Virtuemart developer team knows about SEO?
It's very important to keep discontinued products (It doesn't mean products out of stock, It means products out of production o replaced by a new model) to keep the position in search engines.
Title: Re: Manage discontinued products
Post by: restodo on July 18, 2017, 16:47:25 PM
Quote from: K&K media production on July 18, 2017, 13:03:07 PM
What you want must be done with stock....disable products with stock lower 1.

And I think if I use "disable products with stock lower than 1" still be listed in category
Title: Re: Manage discontinued products
Post by: K&K media production on July 18, 2017, 21:12:20 PM
no
Title: Re: Manage discontinued products
Post by: restodo on July 18, 2017, 23:17:47 PM
Quote from: K&K media production on July 18, 2017, 21:12:20 PM
no

Thanks for your answer. I tested Do not Display Product when is products are out of stock and you're right, category product listing only shows products with stock.

I think I can use a similar function to do the same with new discontinued option.

Do you know what are the files involved in Do not Display Product when is products are out of stock?


Regards!
Title: Re: Manage discontinued products
Post by: K&K media production on July 18, 2017, 23:39:38 PM
administrator/components/com_virtuemart/models/product.php

but I don't understnd it ... why do you want the discontinued product checkbox to hide the product? ... you can simple disable/unpublish the product
Title: Re: Manage discontinued products
Post by: restodo on July 19, 2017, 00:07:39 AM
Quote from: K&K media production on July 18, 2017, 23:39:38 PM
administrator/components/com_virtuemart/models/product.php

but I don't understnd it ... why do you want the discontinued product checkbox to hide the product? ... you can simple disable/unpublish the product

If you want to keep a good position in search engines you can't disable or unpublished a product because doing that, the URL will disappear and when someone search on internet will return an error.
The correct way to manage a store is to mark as discontinued the products that are not produced anymore by its brands.

Are you sure that in administrator/components/com_virtuemart/models/product.php I will find the code used when Do not Display Product is checked?
I though it was in components/com_virtuemart/sublayouts/customfield.php

Title: Re: Manage discontinued products
Post by: K&K media production on July 19, 2017, 00:54:34 AM
You wrote that you want to hide the products, not I.

I've added the discontinued products function to the core to mark the products as discontinued.

Yes I'm sure, I wrote the last core changes for discontinued products and stockhandle on product level.
Title: Re: Manage discontinued products
Post by: restodo on July 19, 2017, 03:26:09 AM
Quote from: K&K media production on July 19, 2017, 00:54:34 AM
You wrote that you want to hide the products, not I.

I've added the discontinued products function to the core to mark the products as discontinued.

Yes I'm sure, I wrote the last core changes for discontinued products and stockhandle on product level.

Thanks for the information, I was able to figure out how to do not show discontinued products from listings adding some code in product.php

This is an example of one modification:
      //stock controls
      if(!VmConfig::get('use_as_catalog',0) || $in_stock) {
         if (VmConfig::get('stockhandle','none')=='disableit_children') {
            $where[] = '(p.`product_in_stock` - p.`product_ordered` >0 OR children.`product_in_stock` - children.`product_ordered` >0)';
            $joinChildren = true;
         } else if (VmConfig::get('stockhandle','none')=='disableit') {
            $where[] = 'p.`product_in_stock` - p.`product_ordered` >0';
         } else { // Added //
            // RS - No lista los productos discontinuados //
            $where[] = 'p.`product_discontinued` IS NULL';  // Added //
         }
      }
Title: Re: Manage discontinued products
Post by: Marttyn on July 19, 2017, 10:01:26 AM
In my website i choose not to handle stock. So dont matter if i set stock to 0, a discontinued product can still be added to cart, but this is not desirable.
I think the add to cart button should be disabled for discontinued products, and also hide them from listings. Users who purchased that product, when they go to their invoices, when they click on a discontinued product, they will still see the product page, and that is not possible if we unpublish it.
Also for example, in my blog i have links to some of my products. And if at some point i want to stop selling the product, then if i unpublish or delete this product, then all the links in my blog would be broken. This already happened to me, and i have to modify blog post to solve this.
Title: Re: Manage discontinued products
Post by: K&K media production on July 19, 2017, 11:41:01 AM
A product can be also discontinued if stock is not 0. You can disable the add-to-cart button with some custom code as template override.
Title: Re: Manage discontinued products
Post by: aftertaf on July 23, 2017, 14:14:54 PM
Hi,
for me it all depends on what you want to use it for, and what type of business/products you are using your online shop for.

In my case, discontinued on top of published/unpublished can be useful to show that the product is still for sale, but once the stock is down to zero there wont be any more available in the future.

adjective
adjective: discontinued
(of a product) no longer available or produced.
"discontinued fabrics"

discontinue
verb
past tense: discontinued; past participle: discontinued
cease from doing or providing (something), especially something that has been provided on a regular basis.
"the ferry service was discontinued by the proprietors"
stop making (a particular product).
"their current top-of-the-range running shoe is being discontinued"
synonyms:   stop, end, terminate, bring to an end, put an end to, put a stop to, wind up, finish, bring to a halt, call a halt to, cancel, drop, dispense with, do away with, get rid of, abolish; More
antonyms:   continue, new
cease taking (a newspaper or periodical) or paying (a subscription).

The 'unique' nature of each webshop & products sold means that this can be used/interpreted in many ways.

I guess my questions on this subject are "What did the VM team intend when they introduced this feature? What functionality does this feature make available to those using Virtuemart ?"
But like a lot of features in 'generic' tools like this, it can be used or exploited in different ways, depending on your needs, your shop type, your ability to override, etc...

my 0.02€.
:)
Title: Re: Manage discontinued products
Post by: Milbo on July 25, 2017, 08:25:49 AM
Quote from: Marttyn on July 19, 2017, 10:01:26 AM
In my website i choose not to handle stock. So dont matter if i set stock to 0, a discontinued product can still be added to cart, but this is not desirable.
I think the add to cart button should be disabled for discontinued products, and also hide them from listings. Users who purchased that product, when they go to their invoices, when they click on a discontinued product, they will still see the product page, and that is not possible if we unpublish it.
I agree that discontinued products should follow the normal inventory behaviour
Title: Re: Manage discontinued products
Post by: Studio 42 on July 25, 2017, 12:38:21 PM
This is the way discontinued should work for one of my case.
discontinued and stock < Low Stock :  display "Last remaining".
discontinued and stock = 0 : display "Discontinued" + cart disabled.
Of course, if you know a little VM code and PHP, you can add this as overide but this not prevent direct link to add to cart. So it should be prevented in the cart helper, if discontinued and stock = 0 and
config have disable add to cart for discontinued products.
In some case for not discontinued product, the cart should not be disabled, but change the shipment duration(i don't have the case)
Title: Re: Manage discontinued products
Post by: Marttyn on July 25, 2017, 12:45:32 PM
Quote
discontinued and stock > 0 : display "Discontinued, Last remaining".
discontinued and stock <= 0 : display "Discontinued" + cart disabled.
But this not prevent direct link to add to cart. So it should be prevented in the cart helper, if discontinued and stock = 0

AGREE  :)
Title: Re: Manage discontinued products
Post by: sgrunch on September 30, 2017, 17:39:02 PM
Quote from: restodo on July 19, 2017, 03:26:09 AM
Quote from: K&K media production on July 19, 2017, 00:54:34 AM
You wrote that you want to hide the products, not I.

I've added the discontinued products function to the core to mark the products as discontinued.

Yes I'm sure, I wrote the last core changes for discontinued products and stockhandle on product level.

Thanks for the information, I was able to figure out how to do not show discontinued products from listings adding some code in product.php

This is an example of one modification:
      //stock controls
      if(!VmConfig::get('use_as_catalog',0) || $in_stock) {
         if (VmConfig::get('stockhandle','none')=='disableit_children') {
            $where[] = '(p.`product_in_stock` - p.`product_ordered` >0 OR children.`product_in_stock` - children.`product_ordered` >0)';
            $joinChildren = true;
         } else if (VmConfig::get('stockhandle','none')=='disableit') {
            $where[] = 'p.`product_in_stock` - p.`product_ordered` >0';
         } else { // Added //
            // RS - No lista los productos discontinuados //
            $where[] = 'p.`product_discontinued` IS NULL';  // Added //
         }
      }

I don't want show the dicontinued products in categories view but only if link (call)  the url (google and ecc.) I can try with $where[] = 'p.`product_discontinued` IS NULL'; but the result is not correct.

VM 3.2.4
Title: Re: Manage discontinued products
Post by: julash on October 10, 2017, 16:26:53 PM
Quote from: Milbo on July 25, 2017, 08:25:49 AM
Quote from: Marttyn on July 19, 2017, 10:01:26 AM
In my website i choose not to handle stock. So dont matter if i set stock to 0, a discontinued product can still be added to cart, but this is not desirable.
I think the add to cart button should be disabled for discontinued products, and also hide them from listings. Users who purchased that product, when they go to their invoices, when they click on a discontinued product, they will still see the product page, and that is not possible if we unpublish it.
I agree that discontinued products should follow the normal inventory behaviour

Hi, so if I understand correctly discontinued product with 0 stock will not show in category listing, but link will still work.

But it seem not working for me. I tried with virtuemart sample website. In vm config discontinued product is set to omit from listing, but not working. Our products has only 1 stock, so after sold out product need to hide from category listing. So discontinued feature seem really good option for us.

Is this a bug?

Thanks
Julash
Title: Re: Manage discontinued products
Post by: julash on October 10, 2017, 19:41:56 PM
Quote from: restodo on July 19, 2017, 03:26:09 AM
Quote from: K&K media production on July 19, 2017, 00:54:34 AM
You wrote that you want to hide the products, not I.

I've added the discontinued products function to the core to mark the products as discontinued.

Yes I'm sure, I wrote the last core changes for discontinued products and stockhandle on product level.

Thanks for the information, I was able to figure out how to do not show discontinued products from listings adding some code in product.php

This is an example of one modification:
      //stock controls
      if(!VmConfig::get('use_as_catalog',0) || $in_stock) {
         if (VmConfig::get('stockhandle','none')=='disableit_children') {
            $where[] = '(p.`product_in_stock` - p.`product_ordered` >0 OR children.`product_in_stock` - children.`product_ordered` >0)';
            $joinChildren = true;
         } else if (VmConfig::get('stockhandle','none')=='disableit') {
            $where[] = 'p.`product_in_stock` - p.`product_ordered` >0';
         } else { // Added //
            // RS - No lista los productos discontinuados //
            $where[] = 'p.`product_discontinued` IS NULL';  // Added //
         }
      }

I was wrong. Discontinued checked don't hide products. Then why is this added, just for a product tag  :o

Above code worked for me. But its don't work 100%. When a product discontinued checked and later again discontinued unchecked, that product still don't show in category listing. Its because now 'product_discontinued' value is 0, not NULL.

I tried this $where[] = 'p.`product_discontinued` = 0' or 'p.`product_discontinued` IS NULL' ; and it works on my local server fine but not in live site  :-\
Title: Re: Manage discontinued products
Post by: Studio 42 on October 11, 2017, 01:27:27 AM
do not use
$where[] = 'p.`product_discontinued` IS NULL';  // Added //
Use
$where[] = 'p.`product_discontinued` <> 1';
Or perhaps
$where[] = 'p.`product_discontinued` < 1';
Note : i have not tested but should be ok
Title: Re: Manage discontinued products
Post by: julash on October 11, 2017, 11:41:57 AM
Quote from: Studio 42 on October 11, 2017, 01:27:27 AM
do not use
$where[] = 'p.`product_discontinued` IS NULL';  // Added //
Use
$where[] = 'p.`product_discontinued` <> 1';
Or perhaps
$where[] = 'p.`product_discontinued` < 1';
Note : i have not tested but should be ok

Thanks for your reply, but not working. Both line only show products that has 'product_discontinued' value as 0. Products that has NULL 'product_discontinued' value don't show. I was hoping to show all NULL and 0 value products.
Title: Re: Manage discontinued products
Post by: julash on October 12, 2017, 10:27:05 AM
It seem when a product modified its 'product_discontinued' value changed to 0 even when discontinued was not touched. So that mean only "p.`product_discontinued` IS NULL" won't work because product that has 0 value because of product modification will get hide too.

Here is the solution:
       else { //  Dont show discontinued products
            $where[] = 'p.`product_discontinued` != 1 OR p.`product_discontinued` IS NULL';
          }
Title: Re: Manage discontinued products
Post by: Studio 42 on October 12, 2017, 10:45:35 AM
Check in the form if product_discontinued field have the value "1" or not when checked
Title: Re: Manage discontinued products
Post by: julash on October 22, 2017, 16:23:21 PM
Hi, sorry for bothering again on this thread. But thought it will be a good idea to share it in case anyone need it and for documentation purpose.

My previous attempt from restodo's solution was causing a problem. For out of stock product we use "Displays 'Notify Me' instead of 'Add To Cart' button", so from restodo's idea I was using 'p.`product_discontinued` != 1 OR p.`product_discontinued` IS NULL' in line 416 of product.php. Where it was checking if product is discontinued during product stock handling. Because of that any product that has 0 as 'product_discontinued' value (because of rediting product) was showing in all kind of category page. I was not aware of it for several days.

I was almost giving it up. Anyway, found a solution (really hoping FINALLY ::) ). I added this code in line 437 of product.php in else statement.

if ($virtuemart_category_id > 0) {
$joinCategory = TRUE;
if(VmConfig::get('show_subcat_products',false)){
/*GJC add subcat products*/
$catmodel = VmModel::getModel ('category');
$childcats = $catmodel->getChildCategoryList(1, $virtuemart_category_id,null, null, true);
$cats = $virtuemart_category_id;
foreach($childcats as $childcat){
$cats .= ','.$childcat->virtuemart_category_id;
}
$joinCategory = TRUE;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
} else {
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id . ' AND (p.`product_discontinued` != 1 OR p.`product_discontinued` IS NULL) ';
}
}


Instead of checking if product is discontinued during stock handling, it will not check if product is discontinued during category check. So far its working fine. Hope there no more surprise for discontinued products  :-\
Title: Re: Manage discontinued products
Post by: Studio 42 on October 23, 2017, 14:28:22 PM
@julash
This solution is not right, eg. when you display in a module
Title: Re: Manage discontinued products
Post by: sgrunch on December 15, 2017, 11:18:30 AM
I have add this code in product.php row 462 for not show the discontinued products

if ($isSite){

            $where[] = 'p.`product_discontinued` != 1';
        }
Title: Re: Manage discontinued products
Post by: 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
Title: Re: Manage discontinued products
Post by: vasite on December 18, 2017, 13:35:36 PM
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?
Title: Re: Manage discontinued products
Post by: Studio 42 on December 18, 2017, 14:03:17 PM
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.
Title: Re: Manage discontinued products
Post by: sgrunch on December 18, 2017, 15:51:43 PM
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.
Title: Re: Manage discontinued products
Post by: EIF on November 13, 2018, 21:03:38 PM
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?
Title: Re: Manage discontinued products
Post by: GJC Web Design on November 13, 2018, 22:56:15 PM
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?
Title: Re: Manage discontinued products
Post by: EIF on November 14, 2018, 08:27:08 AM
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.
Title: Re: Manage discontinued products
Post by: jenkinhill on November 14, 2018, 12:04:51 PM
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!
Title: Re: Manage discontinued products
Post by: 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.
Title: Re: Manage discontinued products
Post by: Marttyn on November 15, 2018, 10:28:49 AM
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...
Title: Re: Manage discontinued products
Post by: GJC Web Design on November 15, 2018, 11:22:29 AM
If u use Jooglies free VM admin template it is already done

https://www.jooglies.com/en/virtuemart-templates/vm-admin-template

Title: Re: Manage discontinued products
Post by: Marttyn on November 15, 2018, 12:51:19 PM
Thanks! But I dont see the discontinued option in your Jooglies snapshot.
This template only affects VM? Or is also Joomla template?
Title: Re: Manage discontinued products
Post by: jenkinhill on November 15, 2018, 13:01:18 PM
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
Title: Re: Manage discontinued products
Post by: GJC Web Design on November 15, 2018, 19:14:09 PM
QuoteThanks! But I dont see the discontinued option in your Jooglies snapshot.
This template only affects VM? Or is also Joomla template?

come on -- 95% of the work is obviously done already for you - add what u want to it - -- and what would it cost you to install and try?
Title: Re: Manage discontinued products
Post by: marvays on July 16, 2021, 07:52:01 AM
Quote from: julash on December 15, 2017, 18:37:55 PM
Please add "discontinuedPrdsBrowseable=0" in virtuemart.cfg. Then resave virtuemart configuration from admin. This will hide discontinued products.
Hello. We have the year 2021. I need to hide sold out products in the list of categories. I put the entry in virtuemart.cfg but I still see the products in the listing. Has anything changed that doesn't work?
VirtueMart 3.8.9 10473
Title: Re: Manage discontinued products
Post by: marvays on July 16, 2021, 08:42:49 AM
Can anyone write a plugin that does that when I save a product as discontinued, hide it in the category listing, set the inventory to 0, and set the template product detail from default.php to mytempalte.php?

I am willing to contribute to the development of this extension.
Title: Re: Manage discontinued products
Post by: Darko F. on April 27, 2023, 17:16:01 PM
My solution to this was :

I set in hidden config there I enable settings so you cannot browse discontinued product, or search for them, keep in mind that product are still there if you go directly on link so they keep SEO rankings.  I append also badge to discontinued product, big picture.jpg so this is perfect solution for me.

But be aware with this settings you cannot browse for discontinued also in administrator on product section, unless you choose in admin a filter button with name - discontinued -.

Hope this help someone.
Title: Re: Manage discontinued products
Post by: pinochico on April 30, 2023, 23:14:38 PM
This is not the right solution.

The right solution is:
- leave discontinued products with a valid URL, for the sake of indexing and not generating 404s
- modify the override of the product detail and add information via the product photo
- edit the product detail override, exclude the Add to Cart section and inform the customer that this product is no longer available
- add a module with replacement products to the product detail (best suited to VM Product Extended, which works with discontinued products in the settings)
- edit category model and override category view and exclude discontinued products
- edit the search and override model of the VM Search module and exclude discontinued products
- edit the customfield model and override the Customfield4All components and exclude discontinued products

The result is a solution using the largest eshop in the Czech Republic - www.alza.cz, which can be seen on VirtueMart eshop for example here:

https://kolopark.easy.minion.cz/obchod/zvonek-velobel-mini-zluty-detail


Extension supporting working with discontinued products:
- Labels for VirtueMart
. VM Product Extended with Slideshow