Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Posts
    10
    Plugin Contributions
    0

    Default show sidebox only on products with attributes

    Hi people,
    I have created a sidebox that filters attributes. When buying make-up, the client can indicate her base color-type, and only colors within that type are shown. See this example at coloursofcreation.nl.

    My problem: I want to show the sidebox only when a product with attributes is displayed. Can a sidebox know which product is being shown? So far, I have been able to hide the sidebox based on product category, but I really want to go to the product-with-attributes level.

    thanks,
    Rombout

  2. #2
    Join Date
    Sep 2006
    Posts
    18
    Plugin Contributions
    0

    Default Re: show sidebox only on products with attributes

    I think what you can do is to create an If statement to check whether or not there are attributes exist in certain products. You could show your sidebox only when if ($pr_attr->fields['total'] > 0). Just use "if ($pr_attr->fields['total'] > 0)" statement to wrap around the sidebox that you want to have the effect.

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: show sidebox only on products with attributes

    That's a pretty snappy filter there ...

    You might consider make it a contribution ... if you were so inclined, as it would help others with similar needs ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    May 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: show sidebox only on products with attributes

    @rapid: thanks for the advice. I had seen that variable being created in attributes.php, but somehow I cannot manage to make it (or a corresponding flag) global. In my sidebox-wrapper this variable is out of scope... Maybe attributes.php is called after the sideboxes?

    @Ajeh: thank you for the kind encouragement. I'll give it some attention, but it needs some serious generalisation for that. Do you plan to change the database w.r.t. attributes? So far, I did not dare touch the database for this sidebox.

  5. #5
    Join Date
    Sep 2006
    Posts
    18
    Plugin Contributions
    0

    Default Re: show sidebox only on products with attributes

    Since you already create your filter based on category, you can simply add a little bit more to filter base on the specific product by calling $_GET['products_id'] to find out which product is currently shown.

 

 

Similar Threads

  1. Sold Out Notification only appears for products with Attributes
    By Youngblood in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 25 Jun 2013, 06:17 PM
  2. Show 'Add to cart box' for products with optional attributes
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 26 Feb 2010, 10:52 AM
  3. Can I show certain products in USD only? and others in CAD only? etc?
    By Dan's Dive in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 10 Nov 2009, 02:55 PM
  4. Show "All Products" (Sidebox) Link on Category/Product Pages ONLY?
    By msmith29063 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Nov 2008, 04:46 AM
  5. Record Companies Sidebox - How to show with Only Available Items?
    By jenngpicz in forum Basic Configuration
    Replies: 0
    Last Post: 26 Jan 2008, 03:43 AM

Posting Permissions

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