Add the product price in between the variations selection and the add to cart button

This topic has 4 replies, 3 voices, and was last updated 4 months, 3 weeks ago ago by Andrew Mitchell

  • Avatar: carlyliczyk
    carliczyk
    Participant
    June 25, 2024 at 19:11

    Sorry I originally closed the the thread too soon.

    I originally asked if there’s a way to add the product price in between the variations selection and the add to cart button and the code provided worked great for a variation product, but not the ones without variations.

    Is there a way to make the price above the add to cart button on all products?

    Here was the code provided:

    add_action(‘wp_footer’, ‘n2t_wp_footer’);
    function n2t_wp_footer(){
    if(is_singular(‘product’)){
    ?>

    Please, contact administrator
    for this information.
    3 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    June 26, 2024 at 07:43

    Hi @carlyliczyk,

    Please update the previous codes to this:

    
    add_action('wp_footer', 'n2t_wp_footer');
    function n2t_wp_footer(){
        if(is_singular('product')){
    	?>
        <script>
            jQuery( function($){
                $(document).ready(function(){
                    $('[data-widget_type="woocommerce-product-etheme_price.default"]').insertBefore($("form.cart button.single_add_to_cart_button"));
                })
            });
        </script>
    	<?php
        }
    }
    

    Hope it helps!

    Avatar: carlyliczyk
    carliczyk
    Participant
    June 26, 2024 at 16:07

    Perfect! Thanks so much

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    June 26, 2024 at 16:07

    Dear carlyliczyk,

    Choosing our theme reflects your commitment to quality, and for that, we’re genuinely grateful. As we constantly strive to elevate your experience, your feedback is an invaluable gift. Could you kindly take a moment to rate our product with 5 stars on ThemeForest?

    Click here to share your insights: https://themeforest.net/downloads

    Your support fuels our journey, and we appreciate it more than words can express.

    Best Regards,
    The 8Theme Team

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Add the product price in between the variations selection and the add to cart button’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.