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
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
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!
Thx you Ajeh!!! You rocksAll your replys are very helpfull ^^
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!
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!
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!
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:
This works just great with products without attributes. As soon as my product has attributes, this will never be true:Code:<?php if ($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) { include("file.php"); print "<br />"; } ?>because the product in my cart has products_id of something like:Code:$_SESSION['cart']->in_cart($_GET['products_id'])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?Code:&products_id=557:8d5339e254cc2ffea8edb82e810f522f
This will never be true for Attributes as you are using:
1 $_GET['products_id'] is only valid on pages where $_GET['products_id'] existsCode:$_SESSION['cart']->in_cart($_GET['products_id'])
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:
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 ...Code:$_SESSION['cart']->in_cart_check('products_id', (int)$_GET['products_id'])
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!
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, theisn't really necessary is it?if ($flag_show_product_info_in_cart_qty == 1
Last edited by Gomlers; 11 Oct 2010 at 04:37 PM.