Forums / General Questions / How can I check Product Type Logic?

How can I check Product Type Logic?

Locked

Views: 1,856

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
8 Sep 2006, 3:52 PM
#1
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

How can I check Product Type Logic?

I just need a simple logic check to what the current page's product type is.

e.g.

If (product_type == 2) {
echo "Product Type = Product - Music";
}

What is the variable or constant for product types?

8 Sep 2006, 4:20 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How can I check Product Type Logic?

in the products table, there is a field products_type, which is a numeric ID you can use to lookup the product-type name in the product_types table

or ... more easily ... zen_get_info_page($product_id) will tell you the page-handler name for the product's type, ie: product_info, product_music_info, etc

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Sep 2006, 4:40 PM
#3
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: How can I check Product Type Logic?

Hmm..

$x = (zen_get_info_page(GET_$product_id));
echo $x;

Always shows product_info .. even when im on a product_info_music page and a product_info_freeshipping page

I'm calling this from the product info page itself.

8 Sep 2006, 4:47 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How can I check Product Type Logic?

Try this:

$x = (zen_get_info_page((int)$_GET['products_id']));

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Sep 2006, 5:33 PM
#5
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: How can I check Product Type Logic?

DrByte:

Try this:

$x = (zen_get_info_page((int)$_GET['products_id']));

ah.. i was close.. i was trying

$duh = $_GET[$product_id];
$x = (zen_get_info_page($duh));
echo $product_id;
echo $x;

Thank you kind sir ! :)