I am trying to figure out how to allow people to switch subscription variations using an add to cart method. Currently, people sign up using a direct link that adds a product to the cart rather than using the product variation drop down list. It looks something like this: http://my-url/cart/?add-to-cart=38395&variation_id=38398&attribute_pa_subscription_name=variation_name. This part works fine.

The problem is, we limit customers to 1 active subscription at a time, so if someone wants to upgrade, they can’t use our sign up page because they will get an error of “product cannot be purchased” when they attempt to add this to their cart.

I need to know the proper URL formatting for a variation button that allows people to add a variation to the cart. I’m guessing it has something to do with the parameter of ?switch_subscription=

This is my first post here so if i’m missing some critical detail that you need, please let me know.

Read more here: woocommerce – switch account from URL


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: