Skip to main content

Bricks Builder: Get Direct Checkout URL dynamically

Hi,

I am using Bricks Builder to loop through products. I would like to dynamically have a button link to a product's direct checkout URL as opposed to a typical product page. How would this be done? I would expect it to be something along the line of https://theurl.com/?fluent-cart=instant_checkout&item_id={subscription_product_id}&quantity=1, but I don't know what should be referenced with the {}.

Thank you!

Taylor Drayson

You are very close. You need to include the checkout url. So

http://localhost:10174/checkout/?fluent-cart=instant_checkout&item_id=52&quantity=1

Where item_id is the product or variation ID - https://share.zight.com/JruRn0r1

Koi

Taylor DraysonΒ thank you so much! The URL made the difference completely. Using {postid}, while changing to the post ID identified by Wordpress, was giving a 404 with the original URL I was using. The url you provided fixed it right up, still using {post_id}. For understanding reasons, do you know why that URL you provided is working instead of the Direct Checkout link format provided by the system in the back-end (the one I provided) of the product information?

EDIT

Actually I looked at what happened to the Direct Checkout link after loading and it basically acted as a redirect, and includes /checkout/a hash/. So yeah, that explains it. Thanks again!!