Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default 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?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.

  3. #3
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default 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.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.

  5. #5
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default Re: How can I check Product Type Logic?

    Quote Originally Posted by 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 ! :)

 

 

Similar Threads

  1. v151 How can I make my group discount logic work with guest accounts?
    By Dave224 in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 26 Mar 2014, 03:59 AM
  2. How can I add Bilingual additional Product-Type fields for our books?
    By kamy in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 1 May 2010, 03:26 PM
  3. Auction Product Type: Can't add a product of the type.
    By sw0rdz in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 5 Sep 2009, 02:11 AM
  4. How can you tell what Product Type?
    By hardboiled in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 21 Jul 2008, 05:12 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR