Possible to hide item from catalogue without disabling item?

Discussion in 'Troubleshooting' started by crystalmedia, Oct 25, 2017.

  1. crystalmedia

    crystalmedia Member

    Joined:
    Oct 15, 2013
    Messages:
    39
    I have an item I wish to be accessible by a form and url, but I do not want it listed on my catalogue page. This item is for specific email leads only.

    Any of you smart people out there that may know of any tweaks or mods I can do to accomplish this for my site?

    Thanks!
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,679
    Hello,

    Do you mean shopping cart catalog?

    You can include to this catalog only subset of your products from some product category.
    Use options 'Category' in shopping cart configuration:
    aMember CP -> Shopping Cart
    cart-category.png

    New categories you can add at
    aMember CP -> Products -> Manage Products -> Edit Categories
    product-cat.png

    Then you can use bulk action to assign desired products to category:
    product-cat-assign.png
  3. crystalmedia

    crystalmedia Member

    Joined:
    Oct 15, 2013
    Messages:
    39
    Yes from shopping cart catalog.

    I will give your suggestion a try.

    Thank you Caesar
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,679
    There is another approach but it require small code customization.
    You can add the following code in site.php
    http://www.amember.com/docs/Site.php_file

    PHP:
    Am_Di::getInstance()->productTable->customFields()->add(new Am_CustomFieldCheckbox('cart_exclude''Exclude from Shopping Cart'));

    Am_Di::getInstance()->hook->add('cartGetProductsQuery', function(Am_Event $e) {
         
    /* @var $q Am_Query */
        
    $q $e->getQuery();
        
    $q->leftJoin('?_data''d'"d.`table` = 'product' AND d.`key` = 'cart_exclude' AND d.`id` = p.product_id");
        
    $q->addWhere('d.`value` IS NULL OR d.`value`<>1');
    });
    and then you will have new option in product settings - 'Exclude from Shopping Cart'
  5. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    24
    Just to add, we use the first version all the time - works really well... simply set the cart 'root' to be a specific category, and add any child categories you need under that so you've got your content organised as you want... then add a product and put it in a totally different category that is not listed under the shopping cart 'root'.

    I like the look of the site.php edit, too... I'll give that a try :)

Share This Page