I am using woocommerce's session variables to store extra meta data using cart items ID's. However I now need to access the data when the order is processed and the cart object is destroyed. Is there a way to match the Cart items with the newly generated order items?
Related
The PRODUCT custom fields already exist and are populated. A customer can only purchase 1 product in each order. I'm able to display ORDER custom fields, by adding a snippet to the functions.php file, but I need to display the PRODUCT's custom fields (again, only 1 product per order is allowed).
I am using wpforms elite (with webhooks) in hopes to simplify the order process for woocommerce customers.
When a user submits the form at this url, http://implantlogic.wpengine.com/device-selection/ I hope to have products added to the cart based on users selections.
For example, if the user selects tooth one on the tooth selection page of the form, this product will need to be added to the cart with all fields populated http://implantlogic.wpengine.com/product/tooth-1/ and this applies to other things the user selects on the form as well which would trigger simple field mapping or the addition of simple products to the cart.
Right now I just need to know if this is possible or if I should seek other methods to solve this issue and create the same experience.
Is there anything i have to do to programmatically complete order and create new cart so the new items is not added to the old order/cart?
There is no new cart or old cart. The cart keeps track of record per user. And for each item you add to cart, there is a record inserted in cart table. If you intend to separate the order per item, you have to write some code. Also try CA
I would like to know if its possible if we could filter the results from the Add items field when adding new order. I have a custom post meta branch_location on the product post and want to only show specific products which contains a meta value of cdo.
here's the screenshot: http://i.stack.imgur.com/5I3xH.jpg
thanks!
I've found the following example (WooCommerce: Add product to cart with price override?) which lets the user add a product to the cart. However, it hard codes the prices directly on the cart itself.
Is there a way to make adjustments to a product instance i.e. costs, append additional user input, etc. and then add the product to the cart?
Thank you very much for everyones help.
Edit:
Having another crack at explaining, as doublesharp has pointed out it's not quite clear.
Joe clicks on a product, he then chooses various options on the product form which then calculates a custom cost after the 'add to cart' button is clicked but before it is added to the cart.
These options need to be completely custom as the calculations involved are outside of scope of a woocommerce 'variable product'. What I'm trying to achieve is the customer being able to add multiple instances of the same product with various costs and info associated with it.
With regards to the first part of your question where you want to add multiple instances of a product with various costs, you can have a look at the following plugins to achieve that objective
Dynamic Pricing
Pricing Deals for WooCommerce
As for the second part of your question where you want to append additional user input to the cart. This can be done using the following steps
Create a custom session and add the custom data to this session.
Add the data from the custom session to the WooCommerce session.
Extract custom data from WooCommerce session and insert it into cart
object.
Display custom data in Cart and Checkout page.
Add custom data as metadata to the order items.
Remove the associated custom data if an item is removed from the
cart.
For a more detailed on the above steps you have a look at the following link,
How to Add Custom Data to WooCommerce Order