Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


add meta value while adding to cart in woocommerce using -'php,ajax,wordpress,shopping-cart,cart'


add meta value while adding to cart in woocommerce  using -'php,ajax,wordpress,shopping-cart,cart'

I am using AJAX to add an item to a cart in woocommerce. Adding to the cart is working successfully but I am not able to add an extra variable or meta value to access on the cart page.

How can I add an extra meta value while adding to cart. I am using the code below for adding:

$productid = 123;
global $woocommerce;
$woocommerce->cart->add_to_cart($productid);


Product is adding successfully.

For example, I want to add custom value in the cart "Duration=2 hours". How can I do this?
    

asked Sep 7, 2015 by rajesh
0 votes
16 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...