Results 1 to 10 of 10

Thread: Isotope - Featured Item

  1. #1
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Isotope - Featured Item

    Hi,

    I'm gonna be creating a site which part of it will use Isotope. I'd like to have 1 featured item on the front page say in the right column, possibly a random item from the shop.
    How can I go about setting this up? I've currently got the demo store installed and see a featured lister in the module section but this doesn't seem to have options that I'd like.

    I'm thinking I would setup a featured category and include products in here that I wish to display.
    Looking at the featured lister from the demo store, I'm a little confused as to how is selects a category in the category scope section. I was expecting to click current category only and then be presented with the option of choosing a category to display products from...?

    Has anyone done a featured item before who could help?

    Thanks

    James

  2. #2
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Isotope - Featured Item

    Hey James...

    In the demo store the featured listing module is designed to only display products from a single category, and since categories are really just pages if you assign a product to the "featured" category/page, then you just need to drop the lister on that page and it will only display those products, as opposed to all products or all subcategory products as well.

    OR you can build a custom module to do a little bit more, like the randomization, display only recent products, etc. Just create another version of the lister but add in what you want. I did one that does something similar to that with this here:

    http://www.isotopeecommerce.com/tl_f...edproducts.zip

    All I really did here was add in an extra checkbox attribute that would label the product as "featured" and I could use that to then do custom randomized listings of featured products within categories.

    I had thought about adding in the same capabilities that Catalog uses in its listing module where developers can add in custom SQL conditions and ORDER BY, but I also like having individual modules for each need that we can simply grab off the shelf and drop in for clients less inclined to know what they are doing from that perspective.

    This should get you started in the right direction to do what you need, though...

  3. #3
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Isotope - Featured Item

    Hey,

    Thanks so much for that. I'll take a look at the files and see if I understand it ok. Haven't built a custom module before but hopefully I can make a start and do what I need it to do.

    Cheers

  4. #4
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Isotope - Featured Item

    Hi,

    I tried the new lister but I got an error about an unknown column 'featured_product' in the database.
    The sql file in the config folder doesn't have this to setup.
    Can you give me an updated sql file or tell me which table to setup a new column in please and settings for the column.

    Thank you again for you help with this.

    James

  5. #5
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Isotope - Featured Item

    Hi James-

    Sorry, should have been more specific:

    1. Go to Store Config > Attributes and create a new checkbox attribute with a field name of "featured_item". This will create the column in tl_iso_products.

    2. Add the attribute to the Store Config > Product Types where you want it to be used.

    I suppose I could have included the column in the module config > database.sql file but you would still need to do step #2 to make it available in your product editing palettes...

    Let me know if this helps or if you need more specific info...

    Blair

  6. #6
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Isotope - Featured Item

    Hey

    Thanks for the extra info.
    I've tried to set it up but for some reason I'm not getting a checkbox in the product menu.
    I double checked everything but couldn't see where I'd gone wrong. I'm thinking I might reinstall the demo site from scratch again and try it.

    [attachment=0:10l8qbel]feature.jpg[/attachment:10l8qbel]

  7. #7
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Isotope - Featured Item

    I think you found a bug in the tl_iso_attributes DCA... The checkbox is not rendering a option list when setting it up in the Attributes config.

    In isotope >dca > tl_iso_attributes.php try changing line 138 to:


    Code:
    		'checkbox'					=> '{attribute_legend},name,field_name,type,legend,description;{options_legend},option_list,{use_mode_legend},is_customer_defined;{validation_legend},is_required;{search_filters_legend},is_filterable,is_order_by_enabled',
    I think that should let you set up options for "1" for the value and "Featured Product" as the label. Try that and in the meantime I will get that added back into the DCA palette in the next maintenance release.

  8. #8
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Isotope - Featured Item

    Hey,

    Thanks for your help. I've got it working now - I was thrown a little as you said to create an attribute called featured_item but after it failed I knew you meant featured_product. (Just something to watch for anyone else reading this post)

    I'll get to work on trying to randomise the selected product now.

    James

  9. #9
    User
    Join Date
    04-27-10.
    Posts
    134

    Default Re: Isotope - Featured Item

    Maybe not the best way but I changed the sql statement to give me a random product.

    From this on line 137
    Code:
    $objProductIds = $this->Database->prepare("SELECT DISTINCT p.* FROM tl_iso_product_categories c, tl_iso_products p WHERE p.id=c.pid AND featured_product=1 AND published='1'" . ($this->strFilterSQL ? " AND (" . $this->strFilterSQL . ")" : "") . " AND c.page_id IN (" . implode(',', $this->arrCategories) . ")" . ($this->strSearchSQL ? " AND (" . $this->strSearchSQL . ")" : "") . ($this->strOrderBySQL ? " ORDER BY " . $this->strOrderBySQL : ""));
    ...to this
    Code:
    $objProductIds = $this->Database->prepare("SELECT DISTINCT p.* FROM tl_iso_product_categories c, tl_iso_products p WHERE p.id=c.pid AND featured_product='1' AND published='1' ORDER BY RAND()");
    It appears to be working ok, didn't think I needed all the other bits of the statement as I'm not filtering or ordering being 1 product.

  10. #10
    User
    Join Date
    12-09-09.
    Location
    Russia, Moscow
    Posts
    48

    Default Re: Isotope - Featured Item

    Quote Originally Posted by vinchenzison
    Maybe not the best way but I changed the sql statement to give me a random product
    The more appropriate solution would changing settings in dca/tl_module.php at line 359 we will add 'RAND'
    Code:
    'options'	=> array('DESC','ASC','RAND'),
    then we must hack ModuleIsotopeProductList.php, add next lines before $objProductIds = $this->Database->prepare
    Code:
    if($this->iso_listingSortDirection == 'RAND')	
                {
                 $sortingBy = 'RAND()';  
                }   
                else
                {
                 $sortingBy = $this->strOrderBySQL;               
                }
    than change $this->strOrderBySQL to $sortingBy in $objProductIds
    Code:
    $objProductIds = $this->Database->prepare("SELECT DISTINCT p.* FROM tl_iso_product_categories c, tl_iso_products p WHERE p.id=c.pid AND published='1'" . ($this->strFilterSQL ? " AND (" . $this->strFilterSQL . ")" : "") . " AND c.page_id IN (" . implode(',', $this->arrCategories) . ")" . ($this->strSearchSQL ? " AND (" . $this->strSearchSQL . ")" : "") . ($sortingBy ? " ORDER BY " . $sortingBy : ""));
    that's all, module complitely works with randome order

    P.S. This hack need testing

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •