Hello,
Any one please help me find the solution.
My client has a wholesale business, in which he don’t need woocommerce checkout functionality. He needs woocommerce functionality upto cart, but instead of checkout he wants a “Place Order” button.
Now, everything is working fine, placing order correctly, order is storing into database and mailing to admin, but the problem is that I want to store variations as well, my question is how to get selected variation (if there is any) of a product inside functions.php for that product, which is already in cart?
Any hint will be much appreciated.
Hope that I’ve understood your query correctly.
You are saying that you want to get variations detail (if available) of the product, which is there in cart.
Cart contains many items. You can loop over items & can get variation details of each items.
A cart item is an associative array & you may find product id in
$item['product_id']
& variation id in$item['variation_id']
Please use following function & pass variation id to get variation detail:
Now let’s see how to use this function
Hope it’ll be useful.
Hope this one will help…