Add a product to the cart.
public add_to_cart ( integer $product_id, integer $quantity = 1, integer $variation_id, array $variation = [], array $cart_item_data = [] ) : string | boolean | ||
$product_id | integer | contains the id of the product to add to the cart |
$quantity | integer | contains the quantity of the item to add |
$variation_id | integer | |
$variation | array | attribute values |
$cart_item_data | array | extra cart item data we want to pass into the item |
return | string | boolean | $cart_item_key |