Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Feb 2009
    Posts
    7
    Plugin Contributions
    0

    Default Show Product ID#

    How to show Product ID# in Product Description?

    I tried to change the tpl_product_info_display.php but it didn't seems to work

    Thx

    Shu

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

    Default Re: Show Product ID#

    On the Product _info page the current products_id can be obtain with:
    $_GET['products_id']

    be aware that with attributes, if you need just the products_id you will want to use:
    (int)$_GET['products_id']
    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!

  3. #3
    Join Date
    Feb 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Show Product ID#

    Thx you Ajeh!!! You rocks All your replys are very helpfull ^^

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

    Default Re: Show Product ID#

    You are most welcome and thanks for posting the update that this worked for you ...
    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!

  5. #5
    Join Date
    May 2009
    Posts
    28
    Plugin Contributions
    0

    Default Re: Show Product ID#

    Hi there, I'm sorry that I'm not following this - what I want is the product ID number listed with the product - and products sorted by the ID as well. I did read another post - that one was to set sort order in the back end - so what exactly do I do? (step by step) if possible? thank you!

  6. #6
    Join Date
    Mar 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Show Product ID#

    Quote Originally Posted by Ajeh View Post
    On the Product _info page the current products_id can be obtain with:
    $_GET['products_id']

    be aware that with attributes, if you need just the products_id you will want to use:
    (int)$_GET['products_id']
    Can you write an example? That'd be awesome.

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

    Default Re: Show Product ID#

    You need to be more specific what you are wanting to do ...

    Just to show it on the products _info page you can use:

    Code:
    echo 'The Products ID# is: ' . (int)$_GET['products_id'];
    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!

  8. #8
    Join Date
    Aug 2008
    Posts
    138
    Plugin Contributions
    0

    Default Re: Show Product ID#

    Hi Ajeh!

    This post is almost what I'm looking for:

    I want to check if the product I'm viewing, is in the shoppingcart as well, and if so: Display message.

    Like this:
    Code:
    <?php if ($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) {
    		include("file.php");
    		print "<br />";
    		}
    ?>
    This works just great with products without attributes. As soon as my product has attributes, this will never be true:
    Code:
    $_SESSION['cart']->in_cart($_GET['products_id'])
    because the product in my cart has products_id of something like:
    Code:
    &products_id=557:8d5339e254cc2ffea8edb82e810f522f
    Do you have any clue what to right in my if/else statement to check if the current product WITH attributes is in the cart?

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

    Default Re: Show Product ID#

    This will never be true for Attributes as you are using:
    Code:
    $_SESSION['cart']->in_cart($_GET['products_id'])
    1 $_GET['products_id'] is only valid on pages where $_GET['products_id'] exists

    2 Products in the cart with attributes need the whole products_id:attributes but this only would exist in the $_GET['products_id'] if you come from the link in the shopping_cart

    To know how many of a Product is in the shopping_cart regardless of the Attributes, you could use:
    Code:
    $_SESSION['cart']->in_cart_check('products_id', (int)$_GET['products_id'])
    Now it does not matter how you get to the Product _info page and can still determine how many of a Product, regardless of attributes, are in the cart ...

    If you are not on the Product _info page, then you need to just substitute the correct products_id variable to be checked for the:
    (int)$_GET['products_id']
    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!

  10. #10
    Join Date
    Aug 2008
    Posts
    138
    Plugin Contributions
    0

    Default Re: Show Product ID#

    Ajeh!
    You are the woman!

    Thank you - very helpful! It worked very nicely :)

    FYI, I'm using it to include a file that shows my customers an addon-product, if the current product is in the cart.

    I'm not sending the customer to the cart directly, I'm refreshing the product_info_display instead.

    This way, my little "Cross-sale" module pops up at the top of the page as soon as the product they're viewing is in the cart.

    Works pretty good.., and now it works better. Thank you again


    EDIT: Hmm... for my use, the
    if ($flag_show_product_info_in_cart_qty == 1
    isn't really necessary is it?
    Last edited by Gomlers; 11 Oct 2010 at 04:37 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 is this easy? [1 product to show on regular product listing]
    By StoreOwner in forum General Questions
    Replies: 1
    Last Post: 5 Jan 2015, 02:25 AM
  2. Show (small) product images to the left of product descriptions on Category pages
    By karine in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 May 2012, 03:39 AM
  3. Categories don't show on admin, product don't show on site
    By bigjoed in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 24 Jul 2008, 08:30 PM
  4. show custom product fields on new and all product pages
    By crl in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 1 Oct 2007, 05:04 AM
  5. One of product types not show up on the New product listing
    By BouldTerier in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Feb 2007, 02:11 PM

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