Ecommerce Shopify WordPress Discussion

WooCommerce Add to cart URL not working with a Variation Subscription

In my WordPress Project, I created a couple of variable subscription products with WooCommerce. I created an attribute called "billing_period" for each, with values of "monthly | yearly", and generated variations. I changed each variation to virtual (as it's subscription), and set billing intervals with needed prices. Before this, I had simple subscriptions with monthly billing with one price. And I had pulled those product posts with WordPress to my page template and had put a button to buy it which redirects to URL like following:<<product-id>> But when I'm doing it now, it's not working (with my variable subscriptions setup). I even tried putting the following URL to the button, but this one also doesn't work (it redirects to home page, instead of checkout).<<product-id>>&billing_period=<<monthly_or_yearly>> From the shop page or from the product page itself, there is an option to select billing period and then sign up for it, but I don't have plans using WooCommerce own pages (styles, etc.). That's why I had my own page for that and would like to solve this issue.
Replace Product ID in "add-to-cart" parameter with Variation ID. I just replaced the Subscription Product ID in add-to-cart parameter with Variation ID and it worked.<<variation-id>> Tip: You can get the variation id by exporting the products, and getting the id for the needed variation.

February 4, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.