Woocommerce single page checkout - URL parameters

Hey guys, I am trying to create a single-page checkout that shows the checkout on the right and the product details on the left similar to the Samcart checkout pages.

I am having purchasers come in through a link with parameters so the product is automatically in the checkout. Here is the example - www.site.com/checkout/?add-to-cart=[PRODUCT_ID]

I know I can get the parameter value using {{dc:url:param key=“add-to-cart” fallback=""}} and I can show the product ID on the page to prove that it is being received correctly. My question is, how do I add that to the dynamic content code such as {{dc:woocommerce:product_title product="[PRODUCT_ID]"}} so the product in the cart is shown on the same page?

Thanks in advance.

Hello @lloydbh,

Thanks for writing in!

You can use this one:

{{dc:woocommerce:product_title product="{{dc:url:param key="add-to-cart" fallback=""}}"}}

Kindly let us know how it goes.

Thanks for the response. I did try that (I should have said soz) but I get this as a result.

Here is the editor

I am not sure why the "}} is returned in the editor and on the page.

Hey @lloydbh,

To better assist you with your issue, please provide us with your WP Access so we can check your layout. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hello @Delamour,

By withdrawing the post, I believe you already have resolved the issue. If the issue still existed, you can let us know.

Thanks.

Thanks for that please, find the info below

Hello @lloydbh,

Your method will not work and also not be efficient. What you can do is use a Looper Provider Query String post_type=product&p={{dc:url:param key="add-to-cart" fallback=""}} instead:

And then use the normal {{dc:woocommerce:product_title}} and {{dc:woocommerce:product_description}} dynamic shortcode.

Hope this makes sense.

Oh awesome, that does make sense. I assumed you could do it straight in the variable but your method is, as you say, so much more efficient. Thanks for your time :slight_smile:

Hi @lloydbh,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.