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:
    69
    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:
    2,295
    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:
    69
    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:
    2,295
    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'
    everbatim likes this.
  5. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    50
    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 :)
  6. crystalmedia

    crystalmedia Member

    Joined:
    Oct 15, 2013
    Messages:
    69
    @caesar
    I tried your customization code above. When I use lookup from main page to search for a user, I now get an error
    "Serialization of 'Closure' is not allowed"

    If I switch back to original site.php, the error goes away.
  7. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    @crystalmedia it seems you have old version of aMember.
    Do you mind to upgrade to latest version (5.4.1)?

    It should fix this issue.

    Best Regards.
  8. dvorah

    dvorah aMember Pro Customer

    Joined:
    Dec 28, 2012
    Messages:
    16
    Hi Caeser, I'm also trying to do this but do not see the Shopping Cart tab listed on the aMember
    Control Panel. Where do we find it now?

    Thanks,
    D

  9. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    @dvorah You can find menu item "Shopping cart" in left admin menu.

    Best Regards.

Share This Page