To display WooCommerce one page checkout anywhere just insert
[anwr_checkout id="PRODUCT IDS"] in that place, replace PRODUCT IDS with the IDs of product you would like to make this checkout for. It is possible to specify multiple product IDs comma separated. Read full shortcode documentation below.
You can also use the appropriate button in WordPress editor:
But where to get product IDs?
Yes, I know, I could make a search field with a dropdown product list inside this popup in the editor, but my main goal was to make the plugin as simple and fast as possible.
Is it really so difficult just to open All Products page and find out IDs there? ? Instead of overloading your website admin with unnecessary code.
Variable products are also supported but in this case you have to pass a variation ID.
Compatible with Gutenberg and Page Builders
If you didn’t know, Gutenberg is the new WordPress visual editor, which is coming in 5.0 version, but at this moment it is available as a plugin.
My checkout plugin is tested with Gutenberg, you can use it with a Shortcode block, but in future I’m looking forward to add it as a separate block.
What about other visual builders like Divi, Elementor, Visual Composer etc?
As long as the shortcode option is available in all of them, you can use my checkout plugin without any problems. But if you have one, just contact me and I will help you.
WooCommerce One Page Checkout Shortcode
First of all, there are two variations of using the shortcode:
[anwr_checkout id="15"]– display checkout directly on a page,
[anwr_checkout id="15"]Button text[/anwr_checkout]– display checkout as a popup.
- Product ID, you can also use multiple product IDs separated by commas. For variable products use variation IDs.
- class (popup only)
- One or multiple HTML classes of the “Buy Now” button. Separate multiple classes by spaces. No matter if you pass this parameter or not, in both cases the button will have its own class
anwr-checkout-showwhich allows you to add as many buttons with checkout popups on a single page as you want, example:
<!-- when somebody clicks this link, the checkout popup will be displayed --> <a href="#" class="anwr-checkout-show anything blablabla">One more button</a>
- title (popup only)
- Allows to change the popup title.