Results 1 to 10 of 10
  1. #1
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Adding additional information to cart/order/packing slip

    Hi

    I posted this already but I think in the wrong part of the forum, so I am reposting it here:

    Been reading through this forum and can't find any help. I have the situation where two different products can have the same name, yet are in different categories.

    Now my dillema is that on the shopping cart and order and packing slip only the name appears and not the category which it came from (or at least the product id). So far it looks like I need to edit templates. I think I found the files I am suppose to edit:

    admin/invoice.php
    admin/packingslip.php
    includes/templates/MYTEMPLATE/templates/tpl_shopping_cart_default.php (using override)

    I tried this in invoice.php:

    <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . $order->products[$i]['id'];

    yet to no avail, then I tried this:

    <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . $order->products[$i]['name'];

    which resulted in the name being printed twice at the right place, so I am on the right track. Why is 'id' not working?

    PS Changing the cart is not critical, however, the invoice and packing slip is. There is no need to display the model on the packing slip or invoice so that can be replaced with category (I am using model for other details and thus can't use it to display the category it is in)
    Last edited by Talib; 9 Jun 2006 at 08:43 AM.

  2. #2
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding additional information to cart/order/packing slip

    Please, anybody have any suggestions? I need this for my shop to wok correctly.

  3. #3
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Re: Adding additional information to cart/order/packing slip

    OK, tried a bit on my own again. I found this post http://www.zen-cart.com/forum/showth...ct+category%22 with the same problem as me. However, I need my modifications in the packing slip/invoice/cart. I've tried replacing:

    $order->products[$i]['model']

    with the following:

    zen_get_categories_name_from_product($order->products[$i]['products_id'])
    zen_get_categories_name_from_product($order->products[$i]['id'])
    zen_get_categories_name_from_product($order->products[$i]->fields['products_id'])
    zen_get_categories_name_from_product($order->products[$i]->fields['id'])

    yet to no avail.

    I am really desperate for a solution.

    Thanks

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

    Default Re: Adding additional information to cart/order/packing slip

    In the orders class ... you will note that the array contains the following:
    PHP Code:
            $this->products[$index] = array('qty' => $new_qty,
                                            
    'name' => $orders_products->fields['products_name'],
                                            
    'model' => $orders_products->fields['products_model'],
                                            
    'tax' => $orders_products->fields['products_tax'],
                                            
    'price' => $orders_products->fields['products_price'],
                                            
    'onetime_charges' => $orders_products->fields['onetime_charges'],
                                            
    'final_price' => $orders_products->fields['final_price'],
                                            
    'product_is_free' => $orders_products->fields['product_is_free']); 
    There is no products_id stored ...

    You would need to alter the orders class to include the products_id in the array in order to use this to display the categories name ...
    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!

  5. #5
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding additional information to cart/order/packing slip

    Thank you very much for the help. However, I still seem to be doing something wrong. I changed (in admin/includes/classes/order.php):

    'model' => $orders_products->fields['products_model'],

    to:

    'model' => $orders_products->fields['products_id'],

    As it seemed the quickest way to test it and would mean no changes in packing slip or invoice. But still nothing

    then I did this:

    'id' => $orders_products->fields['products_model'], (in admin/includes/classes/order.php)

    and also this (in admin/packingslip.php):

    $order->products[$i]['model'] to $order->products[$i]['id']

    I am not an expert in PHP and am very sorry if I seem stupid, but hey at least I am trying.
    Last edited by Talib; 14 Jun 2006 at 09:10 AM.

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

    Default Re: Adding additional information to cart/order/packing slip

    I beleive the actual products_id field name in the orders_products table is:

    orders_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: 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!

  7. #7
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding additional information to cart/order/packing slip

    Still no go, orders_products_id seems to give me the id the product has in the orders table, I need the ID of the product in the catalog.

    Thanks for the help so far. I am learning a lot from this. Very keen to start learning PHP, although that has to wait for a while.

    PS Is there any file I need to include in invoice.php or packingslip.php for zen_get_categories_name_from_product()?

  8. #8
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding additional information to cart/order/packing slip

    Well, I seem to get the idea that the invoice and packing slip part does not seem to have the product id in it's tables.

    And it seems it would be a major coding expedition to modify it, thus I have decided to use the model part of the product to display my category. Although not ideal.

    This may be a feature that the Zen ppl might want to add later ...

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

    Default Re: Adding additional information to cart/order/packing slip

    Blond moment ...

    Add products_id to:
    PHP Code:
          $orders_products $db->Execute("select orders_products_id, products_name,                    products_model,
                                                  products_price, products_tax, products_quantity,
                                                  final_price, onetime_charges,
                                                  product_is_free,
                                                  products_id
                                           from " 
    TABLE_ORDERS_PRODUCTS "
                                           where orders_id = '" 
    . (int)$order_id "'"); 
    And add products_id to:
    PHP Code:
            $this->products[$index] = array('qty' => $new_qty,
                                            
    'id' => $orders_products->fields['products_id']
                                            
    'name' => $orders_products->fields['products_name'],
                                            
    'model' => $orders_products->fields['products_model'],
                                            
    'tax' => $orders_products->fields['products_tax'],
                                            
    'price' => $orders_products->fields['products_price'],
                                            
    'onetime_charges' => $orders_products->fields['onetime_charges'],
                                            
    'final_price' => $orders_products->fields['final_price'],
                                            
    'product_is_free' => $orders_products->fields['product_is_free']); 
    Then call it in the invoice.php with: $order->products[$i]['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: 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!

  10. #10
    Join Date
    May 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding additional information to cart/order/packing slip

    Thanks. I'll try it out as soon as I get time.

 

 

Similar Threads

  1. v139h Adding Manufacturers_id to Invoice/packing Slip
    By NickyCarroll in forum Customization from the Admin
    Replies: 3
    Last Post: 25 Apr 2012, 10:44 PM
  2. Adding a line of text to packing slip
    By Big_Woody in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 31 Oct 2007, 10:16 PM
  3. Adding my comments to a packing slip?
    By HandcraftedUK in forum Managing Customers and Orders
    Replies: 4
    Last Post: 2 May 2007, 09:30 AM
  4. Adding additoinal information to cart/order/packing slip
    By Talib in forum Managing Customers and Orders
    Replies: 11
    Last Post: 12 Feb 2007, 09:09 PM
  5. Packing Slip - Adding Manufacturer
    By Pip in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Dec 2006, 03:37 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