Zen Cart Logo
Forums / General Questions / Adding description to shopping cart contents list

Adding description to shopping cart contents list

Locked

Views: 3,477

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
20 Apr 2007, 6:19 PM
#1
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Adding description to shopping cart contents list

Hi,

Does anyone happen to know if it is possible to add the product description to the shopping cart content list, so that similar products can be easily identified without having to return to the product list to check if the correct item has been purchased?

Thanks if anyone has any advice to offer.

20 Apr 2007, 6:37 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Adding description to shopping cart contents list

You could use the handy dandy function zen_products_lookup ...

This can call any field from either the products or products_description tables by passing it the products_id and field you want ...

Syntax:
zen_products_lookup($product_id, $what_field = 'products_name', $language = '')

<?php echo zen_products_lookup($something, 'products_description); ?>

where $something is whatever is the products_id at the time that you need it ...

20 Apr 2007, 6:42 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Adding description to shopping cart contents list

NOTE: products_description is also available using another function zen_get_products_description($product_id, $language = '')

The language is optional as it will use the session language if not defined ...

Also, you might want to clean this up like the listings do:

<?php echo zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))); ?>

That will strip out the html etc. and give you 150 by default ...
Syntax: zen_trunc_string($str = "", $len = 150, $more = 'true')

26 Apr 2007, 4:31 AM
#4
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi Linda,

Thank you very much for taking the time to reply. Could I be bold and ask for a bit of further assistance?

I need to keep the html in the string, so I am not looking for the stripped option.

But, where do I add this line of code exactly to add the full description to my shopping cart displays?

zen_products_lookup($product_id, $what_field = 'products_name', $language = '')

I have searched through the files and cannot work out where it has to go...

Thanks again for your help :)

28 Apr 2007, 3:02 PM
#5
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Ok, so I am almost down to my last handful of hair to pull out.

Zencart is an excellent product and certainly when it is free, who has a right to complain in any form, but there have been moments when I must admit, I am at my wits end with using it.

I simply do not know enough about the code to work this out. All I want to do is show the full product description in the shopping cart areas in just the same way as it is shown in the product info.

Thanks for giving me some hope that it is actually possible Ajeh, but can anyone now assist me in working out how to actually implement this?

Any help is always much appreciated....

28 Apr 2007, 3:12 PM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Be patience when Ajeh is replying back to you.
She is one of the princesses Zen-cart.
She is making you think for a while to figure out your delima.

28 Apr 2007, 11:32 PM
#7
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi Haredo,

Don't worry. I can certainly see that Ajeh is a god-send to this forum. 100 replies is good, 1000 replies is awesome, 34 000+ is almost incomprehensible.

And, I certainly value Ajeh's help and I have tried to work this out. I am just not getting anywhere. Every time I try, I end up breaking something else.

I am also contemplating buying the book, not necessarily to find the answer to this particular problem, but if I owned the book, would I be able to answer this kind of question on my own?

I am feeling very frustrated at myself with my lack of knowledge of Zencart.

30 Apr 2007, 2:05 AM
#8
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

FreshP:

Does anyone happen to know if it is possible to add the product description to the shopping cart content list, so that similar products can be easily identified without having to return to the product list to check if the correct item has been purchased?

Ok, did some home work for you tonight!
includes/templates/template_default/templates/tpl_shopping_cart_default.php
Line 85, I am using 1.3.7 zen-cart

<a href="<?php echo $product['linkProductsName']; ?>"><div id="cartImage" class="back"><?php echo $product['productsImage']; ?></div><div id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></div></a>

Replace with this!

<a href="<?php echo $product['linkProductsName']; ?>"><div id="cartImage" class="back"><?php echo $product['productsImage']; ?></div><div id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?><?php echo zen_products_lookup($product['id'], 'products_description'); ?></div></a>

insert into your override directory of course.....
includes/templates/your template/template/tpl_shopping_cart_default.php

Enjoy,

30 Apr 2007, 4:30 AM
#9
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi Haredo,

Thank you very much! :)

That seems to have done the trick, however, I need to do this in several places, such as the checkout and also in account history.

Using your method above, I thought this would be a simple matter of finding the correct files again and implementing the same code.

Wrong assumption on my part.

Thanks for your help though. You are a bright star in a dark place!

30 Apr 2007, 5:06 AM
#10
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

[QUOTE=FreshP;366708]That seems to have done the trick, however, I need to do this in several places, such as the checkout and also in account history./QUOTE]

have you figured out your delima for checkout & account history or do you need help??

1 May 2007, 4:11 AM
#11
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi Haredo,

I still have not been able to work it out.

I thought it would be in tpl_account_history_info_default.php or maybe even tpl_account_history_default.php but if it is, it is eluding me.

The same with the checkout: tpl_checkout_confirmation_default.php but evidently I am looking in the wrong places?

So, yes I am still very much stuck and would sell my soul for some help:)

1 May 2007, 4:19 AM
#12
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

If you have time I will look at the problem tomorrow.
Sorry it is bed time

1 May 2007, 4:31 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Adding description to shopping cart contents list

Fields are not always immediately available as they are not part of the select statement ...

There are numerous functions for finding information about a product based on the existing products_id ...

The trick is to identify the products_id to use the function ...

Example: on the tpl_account_history_info_default.php the products_id within the loop is:
$order->products[$i]['id']

14 Dec 2007, 7:35 PM
#14
dforce avatar

dforce

New Zenner

Join Date:
Dec 2007
Posts:
11
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi All

sorry to jump in but was curious

FreshP

did you ever find the solution to add those in the other sections of your cart

I too would like to add those to my cart cause I have a product with same image but different prices and different sizes and it doesnt show up on confirmation or my order emails

I did do the changes on Herado's reply and work fine thanks Herado

if you did find an answer can you post it here

your post was very helpful to me and Im sure others will be looking for the same info

thanks

15 Dec 2007, 6:39 AM
#15
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Adding description to shopping cart contents list

Hi DForce,

No, I never managed to get this issue resolved, and when [ http://www.zen-cart.com/forum/showthread.php?t=71765 ] more pressing problems took over and I also could not get these sorted out, I lost a client.

It just left me feeling very frustrated with Zen Cart [and myself for not knowing enough about it].

To this day, the problem has not been resolved, the clients have placed an apology on the site for things not working, and I carry my head in shame for not being able to help them further.

I tried all kinds of things to get paid help too but no one was interested. I have not used Zen Cart ever since.