Hi Drew707, please read the following URL. It will help you with your question.
Kind regards
That appears to only have the short codes for variations. Do I need to use PHP to call the short codes?
Hi Drew707, no you don’t need to use PHP to call the shortcode. The plugin is already setup for you to use the shortcode in a page or post.
Let me know if this helps you.
Kind regards
Well, I am trying to hard code it into the theme so the client could enter product information in an ACF field and have it output to the product post without them using short codes.
Hi Drew707, I am sorry for misunderstanding your original question above. One of the developers will answer your question.
Kind regards
You can use the following PHP function that will embed the add to cart button with variations. The following is just an example code snippet.
<?php
$name = “Test Product Name”;
$price = “25.00”;
$shipping = “0”;
$var1 = “Size|small|medium|large”;
$var2 = “Color|red|green|blue”;
$var3 = “”;
echo print_wp_cart_button_for_product($name, $price, $shipping, $var1, $var2, $var3);
?>