Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Confirmation E-mail - Sort products by manufacturer?

    I can get the manufacturer to show up for each product in the order confirmation e-mail, but I would like to go beyond that and have the products display in order of manufacturer, so that all the products from one manufacturer are together. I'm just not sure how to go about this. I thought of going all the way back to the cart and doing the sort there, but I played around a bit and am not sure how to do that either
    Danielle

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Confirmation E-mail - Sort products by manufacturer?

    Quote Originally Posted by Danielle View Post
    I can get the manufacturer to show up for each product in the order confirmation e-mail, but I would like to go beyond that and have the products display in order of manufacturer, so that all the products from one manufacturer are together. I'm just not sure how to go about this. I thought of going all the way back to the cart and doing the sort there, but I played around a bit and am not sure how to do that either
    The cart order display basically has been put together to give a top down view of product addition such that newly added product go towards the bottom.

    What you would likely want to do say just before processing to display/output the cart contents is to first determine what the sort order of each product should be then create a temporary cart that is to receive the content of each of the product and add the product from the live cart to the temporary cart in the desired order, then process the display using the temporary cart. An alternative could be to maintain two different cart values such that whenever something is added to the main cart it is added to this other cart variable but in a sorted manner (even if it means after an add to resort the array).

    The only thing that I can see as a concern is where in the process is this to be introduced because might it not cause confusion if say the sequence has been changed during checkout making the customer second guess site operation? If it's for some report or offered as a sort option when viewing the cart contents I get it, but not sure otherwise.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,889
    Plugin Contributions
    13

    Default Re: Confirmation E-mail - Sort products by manufacturer?

    hi danielle,
    to change the sort for ONLY the email confirmation, you need to modify the following code in includes/classes/order.php:

    Code:
        $orders_products_query = "select orders_products_id, products_id, products_name,
                                     products_model, products_price, products_tax,
                                     products_quantity, final_price,
                                     onetime_charges,
                                     products_priced_by_attribute, product_is_free, products_discount_type,
                                     products_discount_type_from
                                      from " . TABLE_ORDERS_PRODUCTS . "
                                      where orders_id = '" . (int)$order_id . "'
                                      order by orders_products_id";
    in version 155e, this starts on line 168. you can change the code to:

    Code:
    $orders_products_query = "select orders_products_id, op.products_id, op.products_name,
        op.products_model, op.products_price, products_tax,
        op.products_quantity, op.final_price,
        onetime_charges, p.manufacturers_id,
        op.products_priced_by_attribute, op.product_is_free, op.products_discount_type,
        op.products_discount_type_from
        from " . TABLE_ORDERS_PRODUCTS . " op
        left join " . TABLE_PRODUCTS . " p on op.products_id = p.products_id
        where orders_id = '" . (int)$order_id . "'
        order by p.manufacturers_id";
    good luck!
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Confirmation E-mail - Sort products by manufacturer?

    Quote Originally Posted by carlwhat View Post
    hi danielle,
    to change the sort for ONLY the email confirmation, you need to modify the following code in includes/classes/order.php:

    Code:
        $orders_products_query = "select orders_products_id, products_id, products_name,
                                     products_model, products_price, products_tax,
                                     products_quantity, final_price,
                                     onetime_charges,
                                     products_priced_by_attribute, product_is_free, products_discount_type,
                                     products_discount_type_from
                                      from " . TABLE_ORDERS_PRODUCTS . "
                                      where orders_id = '" . (int)$order_id . "'
                                      order by orders_products_id";
    in version 155e, this starts on line 168. you can change the code to:

    Code:
    $orders_products_query = "select orders_products_id, op.products_id, op.products_name,
        op.products_model, op.products_price, products_tax,
        op.products_quantity, op.final_price,
        onetime_charges, p.manufacturers_id,
        op.products_priced_by_attribute, op.product_is_free, op.products_discount_type,
        op.products_discount_type_from
        from " . TABLE_ORDERS_PRODUCTS . " op
        left join " . TABLE_PRODUCTS . " p on op.products_id = p.products_id
        where orders_id = '" . (int)$order_id . "'
        order by p.manufacturers_id";
    good luck!
    Thank you, unfortunately it didn't work.
    Danielle

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,889
    Plugin Contributions
    13

    Default Re: Confirmation E-mail - Sort products by manufacturer?

    danielle,
    can you be more specific? did the email come in, and the products were the same as the way it was placed? or did you not get an order confirmation email?

    this would NOT change the order of how the products get displayed on the admin side.

    thanks.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  6. #6
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Confirmation E-mail - Sort products by manufacturer?

    Quote Originally Posted by carlwhat View Post
    danielle,
    can you be more specific? did the email come in, and the products were the same as the way it was placed? or did you not get an order confirmation email?

    this would NOT change the order of how the products get displayed on the admin side.

    thanks.
    The e-mail came, but the products in it were not sorted.
    Danielle

 

 

Similar Threads

  1. v153 Manufacturer sort in default sort drop down
    By vacuumwarlock in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Nov 2014, 02:58 PM
  2. Sort by Manufacturer... SLOW!
    By DigitalShadow in forum General Questions
    Replies: 5
    Last Post: 23 Jun 2010, 06:35 PM
  3. sort by manufacturer
    By etoile03 in forum Customization from the Admin
    Replies: 1
    Last Post: 5 Nov 2006, 06:33 PM
  4. E-mail Text on Confirmation e-mail
    By beth99 in forum General Questions
    Replies: 3
    Last Post: 18 Sep 2006, 02:37 AM

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