Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Aug 2008
    Posts
    50
    Plugin Contributions
    0

    Default Capture additional product information for an order

    Hi,

    Hopefully you guys can help me out, tried searching with no answers.

    My question is, can I add additional fields to the orders_products table that stores the information for each product of an order. What I want to achieve is from a txt box on the product page store this into a field when added to basket as you would with qty – and record this in the orders_products table once the user checks out.

    The reason for doing this instead of using attributes which is an obvious solution is because I already capture attributes, but I want to be able to sort using my own report(sql) products by the additional field I will capture.

    Many Thanks

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Capture additional product information for an order

    You have explained why you want this but have not elaborated on what it is....
    There may be a 3rd paety module already created or one you can base upon
    Zen-Venom Get Bitten

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

    Default Re: Capture additional product information for an order

    Hi Kobra Thanks for your reply.

    From searching their isnt a module for what I need, but I didnt elaborate on the exact field because eventually I need to store various other information that will make it easier to sort orders. All mods I've found add extra information for the order, and not the ordered products.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Capture additional product information for an order

    There's a mod here that might give you some ideas:

    http://www.zen-cart.com/index.php?ma...oducts_id=1331

    I haven't used it.

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

    Default Re: Capture additional product information for an order

    Hi Thanks for your suggestion, this only adds fields for the actual product, whereas I want to record information regarding the ordered product, for eample final_price is stored within orders_products.

    I've got a suspition that this is handled in orders.php so just trying to figure it it is.

    Thanks

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

    Default Re: Capture additional product information for an order

    This is done in the order.php class ...

    The actual information being put into the orders_products table is done around 738-752:
    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);
    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!

  7. #7
    Join Date
    Aug 2008
    Posts
    50
    Plugin Contributions
    0

    Default Re: Capture additional product information for an order

    Thanks Ajeh,

    So now I know how to store it, lastly how can I store the value to begin with from the product page when the user adds the product to cart.

    As an idea somthing like this on the product page?

    $this->products['new_field] = document.getElementById('new_field');

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

    Default Re: Capture additional product information for an order

    You can obtain the information in any manner to store in the orders_products table ...

    So if the data you need is not available, you can gather it from the products table or whatever and add it to the fields you need via that array to be run to update the orders_products table ...
    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!

  9. #9
    Join Date
    Aug 2008
    Posts
    50
    Plugin Contributions
    0

    Default Re: Capture additional product information for an order

    Hi, Im still struggling.

    I now know how to store extra information into the order_products table, but from the product page how do I first capture extra information.

    Say I have a textbox on the product page 'colour', how do I store this as a variable for that product when added to cart. I'm guessing the logic is within the shopping_cart class but cannot figure how to do it.

    I know attributes would work but I need specific information separate so I can sort orders by it.

    I would really appreciate more help on this.

    Thanks

  10. #10
    Join Date
    Aug 2008
    Posts
    50
    Plugin Contributions
    0

    Default Re: Capture additional product information for an order

    Still trying to figure this out. Within the shopping cart class theres the add_to_cart class, I'm guessing any additional information has to be passed within that.

    Also for what I'm wanting to achieve, would I first have to store any new information regarding the product in the customers basket table?

    Would really appreciate any help with this.

    Thanks

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Additional data, information or text capture during checkout
    By JonnoC in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 8 Jul 2013, 04:19 AM
  2. capture additional information during checkout
    By peteratdd in forum Managing Customers and Orders
    Replies: 3
    Last Post: 14 Jun 2013, 04:06 PM
  3. Capture Order, Edit for Shipping THEN pay with Credit Card?
    By chadderuski in forum Addon Payment Modules
    Replies: 2
    Last Post: 6 Mar 2013, 11:41 PM
  4. Requesting additional information for each product
    By tcjay in forum General Questions
    Replies: 3
    Last Post: 12 Aug 2010, 01:37 PM
  5. Adding additional information to cart/order/packing slip
    By Talib in forum Customization from the Admin
    Replies: 9
    Last Post: 16 Jun 2006, 09:44 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