Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Posts
    65
    Plugin Contributions
    0

    Default Concatenation of product name and decription

    I would like to have the product description appended to the product name once the order is placed. (my descriptions are very short : "case of xx") and I want them to stay in their own field (I don't want them to show up in my titles because of the SEO urls) to have my PDF orders & packing slips displaying:

    1 x case of 24 Rosated Chesnuts 13.5 oz

    instead of

    1 x Rosated Chesnuts 13.5 oz

    So basically in my table [order_products] , I would like my field [order_products]products_name to become [order_products]products_name . [products_description]products_description when the order is inserted.

    Couls someone point me in which file in the workflow (I'm suspecting includes/classes/orders..) the [order_products]products_name is inserted, and what would be the alteration to the query to append the [products_description]products_name to it.

    Thank you for your time!

  2. #2
    Join Date
    Mar 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: Concatenation of product name and decription

    This is not a very dynamic solution.. but..

    You could export them in phpmyadmin then concat in excel , then import in phpmyadmin.

  3. #3
    Join Date
    Jan 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Concatenation of product name and decription

    Quote Originally Posted by www.raceonusa.com View Post
    This is not a very dynamic solution.. but..

    You could export them in phpmyadmin then concat in excel , then import in phpmyadmin.
    I appreciate your input, but this is not the kind of solution I'm looking for :-) I want to put php and mysql at work for a fraction of a second, not Excel and my fingers for hours :-)

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,709
    Plugin Contributions
    6

    Default Re: Concatenation of product name and decription

    Do you need this in the database table orders_products field products_name or do you need this in the email of the order or where precisely ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Jan 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Concatenation of product name and decription

    Quote Originally Posted by Ajeh View Post
    Do you need this in the database table orders_products field products_name or do you need this in the email of the order or where precisely ...
    In fact, everywhere, and I figured out

    After heavy brainstorming here is the answer:

    in includes/classes/orders.php

    line 155, I replaced:

    Code:
     $index = 0;
        $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 . "'";


    by

    Code:
     $orders_products_query = "select op.orders_products_id, op.products_id, op.products_name,
                                     op.products_model, op.products_price, op.products_tax,
                                     op.products_quantity, op.final_price,
                                     op.onetime_charges,
                                     op.products_priced_by_attribute, op.product_is_free, op.products_discount_type,
                                     op.products_discount_type_from, pd.products_description
                                      from " . TABLE_ORDERS_PRODUCTS . " op left join " .TABLE_PRODUCTS_DESCRIPTION . " on (op.products_id = pd.products.id) 
                                      where orders_id = '" . (int)$order_id . "'";
    line 190, I replaced

    Code:
     
    'name' => $orders_products->fields['products_name'],
    by

    Code:
    'name' => $orders_products->fields['products_name'] . " (". $orders_products->fields['products_description'] .")",

    line 422, I replaced

    Code:
    'name' => $products[$i]['name'],
    by

    Code:
    'name' => $products[$i]['name']. " (". $products[$i]['description'] .")",
    and there we go:

    http://www.thefrenchybee.com/bulk/

    I think I will leave Excel alone :-)

 

 

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
  •