Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

add to cart with subscription option or update cart item with subscription option in custom page #388

Closed
stevechoi opened this issue Nov 18, 2018 · 1 comment

Comments

@stevechoi
Copy link

stevechoi commented Nov 18, 2018

Hi. We have Woocommerce variable product and bundle product, and want to add these products to cart with 'subscribe all the thing'`s subscription option like '2_weeks' or '3_weeks' in our custom page but I cannot find how to do that.

Is there a proper way?

I tried to do following methods.

  1. $cart_item_key = WC()->cart->add_to_cart(11121, 1, 11151);
    => Item is inserted in cart. (is there way to set subscription option in this add to cart step?)

  2. WC()->cart->cart_contents[ $cart_item_key ][ 'wcsatt_data' ][ 'active_subscription_scheme' ] = '5_week';

=> item's subscription option in cart not changed.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants