Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi Drew707, please read the following URL. It will help you with your question.

    Kind regards

    Thread Starter Drew707

    (@drew707)

    That appears to only have the short codes for variations. Do I need to use PHP to call the short codes?

    Plugin Contributor mbrsolution

    (@mbrsolution)

    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

    Thread Starter Drew707

    (@drew707)

    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.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi Drew707, I am sorry for misunderstanding your original question above. One of the developers will answer your question.

    Kind regards

    Plugin Author mra13

    (@mra13)

    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);

    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP for product variations.’ is closed to new replies.