Forums / General Questions / Apppend Manufacturer to Product names in customer orders??

Apppend Manufacturer to Product names in customer orders??

Locked

Views: 1,376

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
9 Feb 2009, 3:19 PM
#1
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Apppend Manufacturer to Product names in customer orders??

I'm sorry for posting this question here if this is not the best forum section....

Simplified question:
What file is responsible for writing the contents of the clients cart to the table "orders_products" during checkout completion???


Why do I ask?
Here's the longer version of the same question:

I'd like to have my cart append the current manufacturer of a product to the products' name when an order is completed. Currently the data is saved to the table: orders_products but does not include manufacturer data.

example data:
Manuf: Everready
Product Name: 12 v flashlight

Currently an order Invoice displays only:
" 1 x 12 v flashlight"

I would prefer the Invoice to read as:
" 1 x 12 v flashlight, Everready"

I am not interested in just pulling the info at the time of viewing and printing of an Invoice (there is another thread that discusses this but it is not the same as what I wish to do).

Since, in my case, my manuf info may change from time to time, I would prefer to actually store this info with the order's product data itself, as it existed at the time of checkout. It appears the easiest way would be to simply append or concatenate the manuf name to the product_name at the time the order is saved. This should not cause a problem as product_name value is not used as a key.

Anyone know what file / line would need to be located to allow this? I can't seem to find it.

Or is there another way of achieving the same the end result????

Thanks for any feedback!!!

10 Feb 2009, 6:41 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Apppend Manufacturer to Product names in customer orders??

There is a function for this in the functions_lookups.php that you could use:

/*
 * Return a product's manufacturer's name, from ID
 * TABLES: products, manufacturers
 */
  function zen_get_products_manufacturers_name($product_id) {

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!

11 Feb 2009, 1:40 AM
#3
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Re: Apppend Manufacturer to Product names in customer orders??

Thanks, Ajeh!

I could easily write a db query to obtain the manuf ....but knowing that a function is already in place sure simplifies that part of the task immeasurably.

The problem i have is not figuring out how to get the data but where to put it (the function). I spent a couple hours looking for the file responsible for generating the data that gets written to "orders_products" table ...but haven't been able to find the section or lines involved. Guess i'll have to spend some more time ...but if anyone can point me to it sooner, that'd be great.

Thanks.

11 Feb 2009, 4:56 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Apppend Manufacturer to Product names in customer orders??

If it has to be in the database, you would want to lengthen the products_name field to ensure it will fit ...

Then, in the orders class look for the code:

      $sql_data_array = array('orders_id' => $zf_insert_id,
                              'products_id' => zen_get_prid($this->products[$i]['id']),
                              'products_model' => $this->products[$i]['model'],
                              'products_name' => $this->products[$i]['name'],
                              'products_price' => $this->products[$i]['price'],
                              'final_price' => $this->products[$i]['final_price'],
                              'onetime_charges' => $this->products[$i]['onetime_charges'],
                              'products_tax' => $this->products[$i]['tax'],
                              'products_quantity' => $this->products[$i]['qty'],
                              'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
                              'product_is_free' => $this->products[$i]['product_is_free'],
                              'products_discount_type' => $this->products[$i]['products_discount_type'],
                              'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
                              'products_prid' => $this->products[$i]['id']);
      zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

and customize what is added for the products_name field ...

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!

11 Feb 2009, 2:01 PM
#5
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Re: Apppend Manufacturer to Product names in customer orders??

Thank you so much! This is immensely helpful.

I'm going to buy your team a few cups of coffee for all your help over the last few months. The support of the Zen Team is all too often taken for granted!

-Darrin

11 Feb 2009, 5:57 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Apppend Manufacturer to Product names in customer orders??

Glad that this can help you and thanks for the coffee!! It really helps to keep us going and going and going ... sounds like an energizer bunny ... :flex:

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!