Custom Add to Cart URL for Subscriptions
-
Hi howdy I am using WooCommerce plugin Yith Subscription PRO and Membership PRO. I am creating the plans page and the add to product button is not working as it should run.
For example:
The urls we see below, it adds the product, but in the tests we have done the subscription does not work:
https://wwww.domain.com/?add-to-cart=2401
https://wwww.domain.com/name-product/?add-to-cart=2401
https://wwww.domain.com/cart/?add-to-cart=2401
https://wwww.domain.com/checkout/?add-to-cart=2401Try to look at the url of the membership product button but as you are using AJAX it does not allow to see your original url. Maybe you are wrong or it is not intepreting the information shown in Inspect.
I did another test and create a variable product and from there enable the subscription:
https://wwww.domain.com/?add-to-cart=2401&variation_id=2410&atrribute_frequency=1-month
But if you go directly to the product for example the original url:
https://wwww.domain.com/name-product/
And click the add to cart button, the system does load all the subscription and membership information. In all the tests I did the payment process and it only works in this last one.
I want to create a URL to use it in the buttons, I used Elementor PRO, I have also used the add to cart customizer and it doesn’t work either, because it adds a simple product without subscription and without membership.
I just found this, but I haven’t tried it because I don’t know what “WC_Cart::add_to_cart() ph” is.
If we look at the URL it has the information to use, but I don’t know if a script or plugin is needed to make it work.
- The topic ‘Custom Add to Cart URL for Subscriptions’ is closed to new replies.