Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

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

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

    Default 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 Code:
    <?php echo zen_products_lookup($something'products_description); ?>
    where $something is whatever is the products_id at the time that you need it ...
    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: v1.5.5]
    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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 Code:
    <?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')
    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: v1.5.5]
    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!

  4. #4
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

    Default 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 :)

  5. #5
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

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

  6. #6
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default 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.
    Mark
    Hare Do

  7. #7
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

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

  8. #8
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: Adding description to shopping cart contents list

    Quote Originally Posted by FreshP View Post
    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,
    Mark
    Hare Do

  9. #9
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

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

  10. #10
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default 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??
    Mark
    Hare Do

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Adding VAT in shopping basket/ cart contents page
    By Peace74 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 11 May 2012, 10:56 AM
  2. How to Return to Multiple Product List After Adding to Shopping Cart
    By maineiac13 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Sep 2008, 01:58 PM
  3. Adding the Shopping Cart Contents Directly On The Product Listing Page
    By watzursn in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 12 Sep 2008, 12:18 AM
  4. Shopping Cart Contents
    By metalarea in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Sep 2007, 09:53 PM
  5. Adding Description to Cart Contents Pages
    By Arnold in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Dec 2006, 06:39 PM

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