• Resolved isaacibrahim

    (@isaacibrahim)


    Hi,

    I’m trying to move the price above the description on single product page but instead ending up with the price twice on the single product page where the “new” price is under the add to cart button.

    I’m using OceanWP child theme and adding the following in functions.php

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 10 );

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 20 );


    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    This seems to be resolved, as on the link you sent, the price is above the description where you were wanting it. Can you please confirm if this is or is not the case?

    Thanks!

    Thread Starter isaacibrahim

    (@isaacibrahim)

    @slash1andy

    Hey Andrew and thanks for your answer!

    Maybe I was not clear enough in my text. I want to have the other way around, in other words.

    Title
    Meta tag /category
    Description
    Price
    Add to cart

    I’m using the following code to move the description out of the tabs that are located below “add to cart”
    function woocommerce_template_product_description() {
    wc_get_template( ‘single-product/tabs/description.php’ );
    }
    add_action( ‘woocommerce_before_add_to_cart_form’, ‘woocommerce_template_product_description’);

    Then I’m using the following code to change the place of price and description (but I’m ending up with two prices and the description is not moving):
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 10 );

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 20 );

    Do you have any advice? Much appreciated

    Thread Starter isaacibrahim

    (@isaacibrahim)

    Anyone that can solve this problem please? ??

    Thread Starter isaacibrahim

    (@isaacibrahim)

    No one?

    @slash1andy ?

    Howdy ??

    Couple things…

    Elements are most likely showing up twice because your calls to remove_action and add_action want to be wrapped in a callback function on the woocommerce_init action hook.

    Similarily, the description isn’t moving because

    1. It hasn’t ever been removed properly
    2. It hasn’t been added back properly.

    Putting all of this together, something like this:

    Will result in something like this:

    Hope that helps. Kind regards,

    Thread Starter isaacibrahim

    (@isaacibrahim)

    Hi @wbrubaker
    Thank you for your answer!
    I tried your code but it still shows two prices, two meta tags and add_to_cart somewhere in the middle.

    I just changed the domain name so you can take a look at the website and how your code works at:
    https://www.klockwebben.com/herrklockor/klocka-1-klocka-1-klocka-1/

    any suggestion?

    Thread Starter isaacibrahim

    (@isaacibrahim)

    Hi again, @wbrubaker

    Now I noticed that when I change the theme, your code works just fine. So the problem is probably with my theme OCEANWP.
    Is there any solution for that?

    Thread Starter isaacibrahim

    (@isaacibrahim)

    @wbrubaker

    Now I noticed that your code works just fine when implemented in another theme. So the problem is probably with my theme..
    How can we solve that?

    Contact the theme author.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Move price above description not working’ is closed to new replies.