Forums / Basic Configuration / show sidebox only on products with attributes

show sidebox only on products with attributes

Locked

Views: 1,631

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
15 Oct 2006, 9:04 AM
#1
rombout avatar

rombout

New Zenner

Join Date:
May 2006
Posts:
9
Plugin Contributions:
0

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

15 Oct 2006, 9:33 AM
#2
rapid564 avatar

rapid564

New Zenner

Join Date:
Sep 2006
Posts:
16
Plugin Contributions:
0

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.

15 Oct 2006, 3:51 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: show sidebox only on products with attributes

That's a pretty snappy filter there ... :smile:

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!

16 Oct 2006, 5:47 PM
#4
rombout avatar

rombout

New Zenner

Join Date:
May 2006
Posts:
9
Plugin Contributions:
0

Re: show sidebox only on products with attributes

@rapid: thanks for the advice. :smile: 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. :cool: 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.

16 Oct 2006, 7:15 PM
#5
rapid564 avatar

rapid564

New Zenner

Join Date:
Sep 2006
Posts:
16
Plugin Contributions:
0

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.