Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2005
    Posts
    16
    Plugin Contributions
    0

    Product Sort Order in Email Confirmation

    Could someone please tell me where to add an "ORDER BY products_name" clause to the SELECT that grabs the products for an order that goes into the "Order Confirmation" email. As it is the products are either ordered randomly or by how they were put in the cart.

  2. #2
    Join Date
    Aug 2005
    Posts
    16
    Plugin Contributions
    0

    Re: Product Sort Order in Email Confirmation

    I added "ORDER BY products_name"; on line 163 in /includes/classes/order.php which looks like it should work but the products_ordered is still displaying in random order.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Product Sort Order in Email Confirmation

    I suspect you'll need to do a sort on the
    Code:
    $this->products
    array prior to this loop inside the create_add_products() function/element in that class:
    Code:
        for ($i=0, $n=sizeof($this->products); $i<$n; $i++) {
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

    help question Re: Product Sort Order in Email Confirmation

    Hi

    I want to do the same, except sort it by product model. At first I couldn't figure out why the SQL ORDER BY solution did not work from the previous poster, but with some more investigation I think I figured out why.

    The order seems to be determined, not by any SQL query in the order.php class, but by the shopping_cart.php class via the $products = $_SESSION['cart']->get_products(); on line #424 in order.php

    Correct me if I'm wrong.

    I'm fairly OK with PHP, but I don't have any experience with the sorting functions. Could someone assist me in sorting the output by products model?

    Thanks for any assistance.

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

    Default Re: Product Sort Order in Email Confirmation

    On a side note, I figured out it was easier to adjust the order in the invoice or packing slip in the admin, which is helpful on the larger orders, but the way our system is set up I still need the email confirmations to be ordered.

 

 

Similar Threads

  1. Product images on order confirmation email
    By dealbyethan.com in forum General Questions
    Replies: 26
    Last Post: 2 Oct 2010, 06:50 PM
  2. add product url in order confirmation email
    By alvalong in forum Managing Customers and Orders
    Replies: 2
    Last Post: 22 Jun 2010, 07:28 AM
  3. Include product id in email order confirmation
    By silverwoman in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 29 Aug 2009, 10:40 AM
  4. Sort order-confirmation email
    By ksoup in forum General Questions
    Replies: 1
    Last Post: 22 Jan 2008, 04:24 AM
  5. Product names Garbled in Order Confirmation email
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 24 Aug 2006, 06:57 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