Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 41
  1. #21
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    I know its my string - I see how order.php is called from the before mentioned pages - I will keep trying how the string should call the products weight. Answering my own question. The string is not the same as in orders history. Will let you know if I make this work. Thx.

  2. #22
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    So far working nicely: check out confirmation + email + order history all good BUT

    In Admin: Orders + Invoice + Packing slip weights NOT showing up?

    if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
    for ($j = 0; $j < $k; $j++) {
    echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])) . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['weights']));

    I am not sure if its this string above is the problem and repeats itself on all three or order.php mods

    Any ideas? I am just about really almost there - my scripting is ok as you can tell -

    the admin part is important we will be printing out the packing slip and will need the weights there really -

    Thx Thx Thx

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

    Default Re: How can I show the attribute weight for each item in cart?

    Just curious ...

    Each Product shows the total weight of the Product Weight plus the Attribute(s) Weight ... why do you need it broken out?
    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. #24
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    Well as its an delivery service based on weights of produce into a box...I need to show the weights on the invoices, packing slip and order pages in admin. as we will print out the slips, take them to the warehouse and split orders based on the weight options. There are 5 box sizes and each one has a different weight etc. I suppose we could print out emails as it shows there now. However it will be helpful to include options with weights.

    As below in the invoice, orders and packing slip the order shows like this:

    1 x Small Produce Box
    - Baby Carrots:
    - Bananas:
    - Cali Pink Grapefruit:
    - Cantaloupe:

    This is the email and order confirmation and history views with the new mod:

    1 x Small Produce Box = $39.00
    Baby Carrots 1 lbs.
    Bananas 2 lbs.
    Cali Pink Grapefruit 1 lbs.
    Cantaloupe 2 lbs.

    I scripted the string as above for the pages - its probably my order.php - tried a few ways to handle it - even changed the array to weights instead of weight as I though it would interfere with the existing weight array -still no go.
    Last edited by Fay808; 4 Sep 2007 at 05:18 AM.

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

    Default Re: How can I show the attribute weight for each item in cart?

    In the
    /admin/includes/classes/order.php

    add it to the select then the build:
    PHP Code:
            $attributes $db->Execute("select products_options, products_options_values, options_values_price,
                                               price_prefix, products_attributes_weight,
                                               product_attribute_is_free
                                        from " 
    TABLE_ORDERS_PRODUCTS_ATTRIBUTES "
                                        where orders_id = '" 
    . (int)$order_id "'
                                        and orders_products_id = '" 
    . (int)$orders_products->fields['orders_products_id'] . "'");
            if (
    $attributes->RecordCount()>0) {
              while (!
    $attributes->EOF) {
                
    $this->products[$index]['attributes'][$subindex] = array('option' => $attributes->fields['products_options'],
                                                                         
    'value' => $attributes->fields['products_options_values'],
                                                                         
    'prefix' => $attributes->fields['price_prefix'],
                                                                         
    'price' => $attributes->fields['options_values_price'],
                                                                         
    'weight' => $attributes->fields['products_attributes_weight'],
                                                                         
    'product_attribute_is_free' =>$attributes->fields['product_attribute_is_free']);

                
    $subindex++;
                
    $attributes->MoveNext();
              }
            } 
    /admin/orders.php

    reference it as:
    PHP Code:
    $order->products[$i]['attributes'][$j]['weight'
    NOTE: you can add prefix too if you like in there ...
    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!

  6. #26
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    Thats pretty much what I did - still no go.

    Is it odd that the tpl picks it up but not admin?

    I called the array weights - email confirmation picks as the string below works, I know it doesn't need the special chars either really - copy and pasted

    like this - i did not add the weight prefix - it will always be lbs so I inserted here:

    $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']). ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['weights']). ' ' . lbs . '. ';
    Last edited by Fay808; 4 Sep 2007 at 05:47 AM.

  7. #27
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    This is what the ref on my page looks like - there are 2 references for the subindex - I coded both

    $subindex = 0;
    $attributes_query = "select products_options_id, products_options_values_id, products_options, products_options_values, products_attributes_weight, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
    where orders_id = '" . (int)$order_id . "'
    and orders_products_id = '" . (int)$orders_products->fields['orders_products_id'] . "'";

    $attributes = $db->Execute($attributes_query);
    if ($attributes->RecordCount()) {
    while (!$attributes->EOF) {
    $this->products[$index]['attributes'][$subindex] = array('option' => $attributes->fields['products_options'],
    'value' => $attributes->fields['products_options_values'],
    'weights' => $attributes->fields['products_attributes_weight'],
    'prefix' => $attributes->fields['price_prefix'],
    'price' => $attributes->fields['options_values_price']);

    $subindex++;
    $attributes->MoveNext();
    }
    }

  8. #28
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    This is how it looks in admin/orders.php

    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
    for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
    echo '<br /><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])) . $order->products[$i]['attributes'][$j]['weights'];
    By the way I used weight singular as well, it doesn't really matter if I build it with whatever name I want to right?

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

    Default Re: How can I show the attribute weight for each item in cart?

    You are in v1.3.7.1 correct?

    Without any add-ons etc. in the admin in regard to attributes and such?
    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. #30
    Join Date
    Aug 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How can I show the attribute weight for each item in cart?

    Hi Ajeh,

    No addons - latest version - downloaded 2 weeks ago.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. how can I force the customer to enter a Code for each item that he adds?
    By iwashere in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 31 Aug 2011, 08:29 PM
  2. list a price for each item on the shopping cart content page
    By hoang in forum Templates, Stylesheets, Page Layout
    Replies: 23
    Last Post: 16 Apr 2010, 08:17 PM
  3. Can I have each attribute show its price without using Priced By Attribute?
    By linuxmant in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Nov 2009, 07:58 PM
  4. How to find out the total weight for each order?
    By doubletiger in forum General Questions
    Replies: 0
    Last Post: 12 Nov 2007, 05:58 PM
  5. Can I have each attribute separately in the shopping cart?
    By vatel in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 May 2007, 05:45 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