• Hi community,
    does anybody know how to change the position of the price of a chosen variation? (see pic)
    price

    I want to put it under the “add to cart button, but that does not work. Playing around with filters in the functions.php like this one, does not make any difference.

    // Move WooCommerce price
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 25 ); 

    So where is the information about the position of this price stored? Can anybody help me please?

    Thank you!
    rabox

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think you need to look in:
    plugins/woocommerce/templates/single-product/variable.php lines 63 and 64
    Remove woocommerce_single_variation (empty div for price) from 10 and put it at 30. add-to-cart is at 20. Sorry, not tested.

    If your theme has a variable.php template, that’s the one to look at.

    The empty div is populated with the price of the selected variation by Javascript within the user’s browser. You might find the Javascript is expecting this div in its usual place, but see how you go.

    Thread Starter rabox66

    (@rabox66)

    Hi lorro,
    thank you for the answer. Now I know where that piece of code is located. I will work on it later, so I cannot tell you now, whether your proposition worked or not.
    Thanks
    Rabox

    lorro, this doesn’t work

    Hi, I have same problem.
    I am working on Porto Woo-commerce theme. I am trying to move product variation price above sku code. I have found a code.

    function move_variation_price() {
    remove_action( ‘woocommerce_single_variation’, ‘woocommerce_single_variation’, 10 );
    add_action( ‘woocommerce_before_variations_form’, ‘woocommerce_single_variation’, 10 );
    }
    add_action( ‘woocommerce_before_add_to_cart_form’, ‘move_variation_price’ );

    which bring price to above variation but not above sku. I have try many class but it didn’t work. Is there any way to move the price above SKU ?

    Here is the Link for referance: https://maplesotre.vista.net.pk/product/michael-fassbender-brown-x-men-leather-jacket/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Moving the price of a chosen variation’ is closed to new replies.