Forums / Customization from the Admin / Concatenation of product name and decription

Concatenation of product name and decription

Locked

Started by frenchfrog on 22 Mar 2007, 6:22 PM · Views: 1,448

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
22 Mar 2007, 6:22 PM
#1
frenchfrog avatar

frenchfrog

New Zenner

Join Date:
Jan 2007
Posts:
65
Plugin Contributions:
0

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!

22 Mar 2007, 7:24 PM
#2
www_raceonusa_com avatar

www_raceonusa_com

New Zenner

Join Date:
Mar 2007
Posts:
2
Plugin Contributions:
0

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.

22 Mar 2007, 9:43 PM
#3
frenchfrog avatar

frenchfrog

New Zenner

Join Date:
Jan 2007
Posts:
65
Plugin Contributions:
0

Re: Concatenation of product name and decription

www.raceonusa.com:

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 :-)

22 Mar 2007, 11:06 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!]
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!

22 Mar 2007, 11:19 PM
#5
frenchfrog avatar

frenchfrog

New Zenner

Join Date:
Jan 2007
Posts:
65
Plugin Contributions:
0

Re: Concatenation of product name and decription

Ajeh:

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 :P here is the answer:

in includes/classes/orders.php

line 155, I replaced:

 $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

 $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

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

by

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

line 422, I replaced

'name' => $products[$i]['name'],

by

'name' => $products[$i]['name']. " (". $products[$i]['description'] .")",

and there we go:

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

I think I will leave Excel alone :-)