Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Front end CheckBox sorting

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1861 Views
  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Front end CheckBox sorting Link to this post

    To interact with the session you'll want to make use of the Session class:
    http://api.silverstripe.org/2.4/sapphire/control/Session.html

    Here is some more of the example fleshed out.

    function savefilter($data,$form){
    Session::set("productfilter",$data);
    Director::redirectBack();
    return;
    }

    function FilteredProducts(){
    $data = Session:get('productfilter');
    $savedfilter = "\"ParentID\" IN (".implode(",",$data["Categories"]).")"; //where $data["Categories"] is an array

    return $this->ProductsShowable($savedfilter);

    }

    The limiting is done by passing the savedfilter to ProductsShowable, which makes sure the products it retrieves only belong to the given categories (Product Groups).

    This is far from complete, and you'd need to somehow get the ids of subcategories if you wanted to include products from those.

    I will be devoting some time to improving the ability to browse / search products in the future sometime.
    Here's a ticket I made: https://github.com/burnbright/silverstripe-shop/issues/36

  • ambient
    Avatar
    Community Member
    123 Posts

    Re: Front end CheckBox sorting Link to this post

    Hey Jeremy,

    Sorry I've been awol these last few weeks.

    I appreciate your help and hopefully the ecommerce module will get the upgrade sooner rather than later.

    The project I'm working on has unfortunately been shelved.

    Thanks again

    1861 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.