Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Location
    Phoenix, Arizona
    Posts
    6
    Plugin Contributions
    0

    Default Group attributes on order confirmation and order information pages

    Hello, I've searched around everywhere but can't quite find anything pertaining to this question. Please direct me if there's a module floating around that can help with what I need to do (Zen 1.3.9h).

    I have a store under development with a LOT of attributes for one product. Most of them are grouped, and a lot of them allow multiple checkbox selections per group.

    On the order summary during checkout and on the email confirmation, all of the options print out and it looks horrible. For example, let's say I have 30 attributes in 3 groups selected. The confirmation email looks something like this:

    Products
    1 X Product Cool Duster $999.99
    GROUP A: Option 1
    GROUP A: Option 2
    GROUP A: Option 3
    GROUP A: Option 4
    GROUP B: Option 2
    GROUP B: Option 5
    GROUP B: Option 9
    GROUP D: Option 1
    GROUP E: Option 1
    GROUP E: Option 2
    GROUP E: Option 3
    GROUP E: Option 4
    Etc...

    I'd rather this listed instead:
    GROUP A: Option 1, Option 2, Option 3, Opetion 4
    GROUP B: Option 2, Option 5....

    I found the code in order.php to start changing this the way I would like.

    Code:
    this->products_ordered_attributes .= "\n\t" .
    That code can be modified pretty heavily to make it so that all of the individual options appear in a uniform way under the GROUP and the products_options_name doesn't appear more than once for each option being listed.

    However, I still have this problem throughout the store (in the checkout summary, when visiting the client order details page). It looks like a ton of coding to make this change throughout the entire Zen Cart.

    Has anyone already created a MOD that lists attributes in a cleaner way, grouped with the options name instead of listing each option name every time?

    TIA
    ------------------------------------------
    Andre Morris
    seenBEST Web Design

  2. #2
    Join Date
    Aug 2009
    Location
    Phoenix, Arizona
    Posts
    6
    Plugin Contributions
    0

    red flag Re: Group attributes on order confirmation and order information pages

    This project is on a tight deadline so I coded something that works just for me. It's not fleshed out enough to post all of the code, so if someone finds this thread and wants to know how to do something like this you'll have to modify the following files.

    I think this would make a cool mod if someone has the time to write it out. If you plan on doing it let me know if I can help!

    includes\classes\order.php
    This is the page that displays order details in a confirmation email. Find the line starting with:

    Code:
    $this->products_ordered_attributes .= "\n\t"
    .

    This line is running inside of a loop and displays each attribute one by one. Every time the loop runs you'll need to check the attribute name. I used something like this to check for OPTION A in the name of the attribute:

    Code:
    if (stristr($attributes_values->fields['products_options_name'],'OPTION A')) {
    Then I wrote my own logic. If the option name was repeating from the last time in the loop, strip out the name and write a comma instead.

    includes\templates\template_default\templates\tpl_account_history_info_default.p hp
    This is the code for the account history when a customer views what has been ordered before. Similar to above you'll need to check the option name through each instance of the loop.

    Code:
    echo '<li>' . $order->products[$i]['attributes'][$j]['option'] . TEXT_OPTION_DIVIDER . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])) . '</li>';
    includes\templates\template_default\templates\tpl_checkout_confirmation_default. php
    This page displays the checkout confirmation pages. Replace each attribute instance of the loop the same as before.

    Code:
          <li><?php echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])); ?></li>
    includes\templates\template_default\templates\tpl_shopping_cart_default.php
    This is what shows when adding the product to the shopping cart. The code to hook into is:

    Code:
    <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
    ------------------------------------------
    Andre Morris
    seenBEST Web Design

 

 

Similar Threads

  1. Adding Information to Order Confirmation Email
    By solarguy in forum General Questions
    Replies: 1
    Last Post: 24 Nov 2010, 04:52 AM
  2. Did not recieve Order Confirmation email and no order exists in admin
    By gws76 in forum Managing Customers and Orders
    Replies: 4
    Last Post: 19 May 2008, 12:44 AM
  3. Add more information to order confirmation?
    By fr3spirit in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Jan 2008, 09:14 PM

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