Forums / Templates, Stylesheets, Page Layout / Add description to shopping cart

Add description to shopping cart

Locked

Views: 1,380

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
27 Jul 2007, 3:51 PM
#1
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Add description to shopping cart

My store uses short descriptions and I'd like to include them in the shopping cart. I added this:

<?php echo zen_products_lookup($product, 'products_description'); ?>
```to tpl_shopping_cart_default.php but it's pulling up the description for the first product in the database for ALL products.

What am I missing?
27 Jul 2007, 3:53 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Add description to shopping cart

is $product actually the products_id? Or is it using something else?

Do you really want products_description or do you have another field where the short product description is stored?

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!

27 Jul 2007, 5:03 PM
#3
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Re: Add description to shopping cart

I have to admit I'm clueless here. :huh: I'm not sure what to use - I've tried $product and **$product['id'] **with same results each time.

I do want to pull products_description because all the descriptions are very short anyway -- there's no need to create a special field for short descriptions.

It is pulling the right description -- but for the wrong product. It displays the description from the first product in the database for each product in the shopping cart.

27 Jul 2007, 5:36 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Add description to shopping cart

If I add this around line 86 under the clear both ...

<br class="clearBoth" />
<?php echo zen_products_lookup($product['id'], 'products_description'); ?>

I get the description displayed ...

You will need to tidy this up some ...

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!

27 Jul 2007, 5:56 PM
#5
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Re: Add description to shopping cart

Thanks, I tried that and it's still returning the same description for everything in the shopping cart. For some reason it's stuck on product_id 1 and returns that description for everything.

27 Jul 2007, 6:06 PM
#6
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Re: Add description to shopping cart

I tried changing from products_description to other fields, like products_price, and so far every field works correctly except products_description. I know descriptions are stored in a separate table. Could that be the problem?

27 Jul 2007, 6:12 PM
#7
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Re: Add description to shopping cart

Apparently I didn't search well enough before posting this! You answered the same question a few months ago (http://www.zen-cart.com/forum/showthread.php?t=63857) and while the zen_products_lookup isn't working, another function you mentioned - zen_get_products_description - works just fine! So THANK YOU for your help -- both now and in the original post! :clap:

27 Jul 2007, 6:21 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Add description to shopping cart

Use this instead ...

<?php echo zen_get_products_description($product['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!

27 Jul 2007, 6:22 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Add description to shopping cart

yes that is the one ... :cool:

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!