• Resolved swapot

    (@swapot)


    I am trying to move Product Variations, which I believe are in ‘woocommerce_before_variations_form’, on Single Product Page to above the Product Title, Price, and everything else in the ‘woocommerce_single_product_summary’. See Image.

    The code I have tried is:

    
    function move_variations(){ ?>
      </div>
      <div class="summary entry-summary">
    <?php }
    add_action('woocommerce_before_variations_form', 'move_variations', 1);
    

    Placed at the bottom of my child theme’s function.php file.

    It is moving the Variations and everything below them (buy buttons, description) to below the main product image.

    Anyone know what I need to fix?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Afzal (woo-hc)

    (@afzalpansuvi)

    Hi @swapot,

    Thank you for contacting WooCommerce Plugin Support. I understand you are having trouble with moving the product variations on your single product page. From your code snippet, it seems that you are trying to close the div element that contains the product image and open a new one for the summary. However, this might not work as expected, because the woocommerce_before_variations_form action hook is inside the woocommerce_single_variation template file, which is already inside the div element with the class summary entry-summary.

    To move the product variations above the product title, price, and other elements, you might need to use a different action hook, such as woocommerce_before_single_product_summary, and then remove the default output of the product image and the product summary from that hook. You can then add them back in the order you want using other hooks, such as woocommerce_single_product_summary or woocommerce_after_single_product_summary.

    Please note that writing or providing custom code is not within the scope of our support policy. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. You can also seek help from the following:

    I hope this helps. If you have any questions or need further assistance, please let us know and share the direct link to the product page.

    Thank you for choosing WooCommerce and have a great day! ??

    Thread Starter swapot

    (@swapot)

    Hi Afzal,

    Thank you for the reply and explanation. That will get me headed in the right direction. I will also try Woo Slack – thanks for the tip.

    I will hire a developer if needed, but I am trying to learn and enjoy trying to figure it out so I can try other things as well.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello swapot

    I am glad to know that found our explanation helpful.

    If you feel that our plugin has been beneficial to your business, we would be truly grateful if you could take a few moments to leave a review.

    Your feedback not only supports our continuous improvement but also helps others make informed decisions about using WooCommerce.

    Thank you for choosing WooCommerce. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Move (woocommerce_before_variations_form) above (woocommerce_single_product_sum)’ is closed to new replies.