Skip to Content
author's profile photo Former Member
Former Member

How to remove a product from the portal e.g., electronics/powertools site without the product being actually deleted from the Database

Hi Friends,

My requirement is, I want to simply remove a product from the portal that is running, for example, electronics/powertools product so that it would not show up in the portal anymore when a user browse it. The reason could be unavailability or discontinuation of the product. At the same time, it's an imperative requirement that the product should not been deleted from the database even after I remove it from the portal.

Please suggest whether there any way to achieve this.

Thanks, Soukhin

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2016 at 09:51 AM

    You are best to use a status attribute on the product which you can incorporate into the flexible search query of a restriction (e.g. show me products that have a new 'visible' attribute on product set to 'no').

    Remember to also include this in the Solr indexing queries so that these products don't come back in search results.

    Rather than introducing a new attribute, you could also use the 'Approval' flag which is used to show whether something is synchronized, but then... how do you get that status into the 'online' catalog from the 'staged' catalog? You'd have to set it directly in the 'online' catalog.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Simon, I had tested by changing the approval status to 'unapproved' in the online catalog from the hMC, but it did not worked out. The product is visible in the site. Please suggest if I'm missing something.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2016 at 11:47 AM

    Hi Soukhin,

    If you change the approval status of the product to unapproved will not be longer available. Hybris manage unapproved status like a logical deletion from the db but still on the db.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2016 at 08:42 AM

    When product get deleted, 'approved' status of the product changes to 'unapproved' and it will no longer be available in the 'online' catalog and also at the same time, in the portal. I'll have to write a logic simply when it takes the input from the front end, the status changes and is persisted in the DB, but the status should change only for the deleted product, not for all the products.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2016 at 08:46 AM

    Juan and Simon, I have concluded this from your suggestions, am I right in this? But the question is, should there be any logic written to get that input? I mean the system should be informed that a deletion is done and by virtue of that, it would change the status flag?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2016 at 10:58 AM

    You have to write a custom logic .Mostly in a RemoveInterceptor on deletion and do the required changes ,in this case change the product approval status to Unapproved.

    Add a comment
    10|10000 characters needed characters exceeded