• Resolved isaacibrahim

    (@isaacibrahim)


    Hi,
    I would like to move the short description on the single product page above the price but I cannot figure out how to do it in functions.php

    I used the following code to move short description out from the tabs:

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

    However, my problem is that the description is under the price meanwhile I need the description to be above the price. I tried the following code to change priority but it didn’t work:

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

    Is there anyone out there who can help me get this problem solved?

    I would like the single product page in the following order:

    title
    meta tag
    description
    price
    add to cart

    Visit the following link to see the problem yourselves:
    https://www.klockjatten.com/herrklockor/klocka-2

    Thank you!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mohit Mishra

    (@mohitmishra)

    Hello @isaacibrahim, Thanks for reaching out here. I would say that you can achieve your goals by overriding the single product page of the woocommerce.You can take reference from here
    https://docs.woocommerce.com/document/template-structure/

    Hi

    Use this snippet please:

    
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
    
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 30 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 40 );

    Good luck

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there @isaacibrahim,

    We haven’t heard back from you in a while, so I’m going to mark this thread as resolved. Hopefully the advice provided helped you sort things out!

    If you have any further questions, please start a new thread.

    Have a wonderful day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Moving price and short description in single product page’ is closed to new replies.