Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    115
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

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

    There is a function for this in the functions_lookups.php that you could use:
    Code:
    /*
     * 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!

  3. #3
    Join Date
    Aug 2008
    Posts
    115
    Plugin Contributions
    0

    Default 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.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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:
    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!

  5. #5
    Join Date
    Aug 2008
    Posts
    115
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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 ...
    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!

 

 

Similar Threads

  1. v151 manufacturer select sidebar truncated names
    By noyloza in forum Addon Sideboxes
    Replies: 2
    Last Post: 12 Apr 2013, 03:28 PM
  2. Dealing with Options Names, sort orders, when product share similar names?
    By printchic in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 15 Jun 2009, 01:53 PM
  3. Ampersands in category and manufacturer names
    By nigelt74 in forum General Questions
    Replies: 1
    Last Post: 6 Dec 2007, 12:38 AM
  4. Character limit on manufacturer names
    By shirster in forum General Questions
    Replies: 2
    Last Post: 25 Jul 2007, 01:01 PM

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