• Resolved jordicastalla

    (@dianiatv)


    What file do I have to edit to put the product meta (the content of templates/single-product/meta.php file, with SKU, tags and more…) on other place inside a product’s page???

    I want to put the code above, but I don’t find the correct file… ??
    Is not on content-product.php, not on content-single-product.php…
    I try to find on Documentation and with a search with KFind on Linux, but with no results…

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Go back to look at content-single-product.php.

    The approach is to firstly remove the meta section:
    remove_action( 'woocommerce_single_product_summary', woocommerce_template_single_meta', 40);
    note the priority in the remove() must be the same as when the action was added.

    Secondly, add it back in with a different priority corresponding to the place where you want it to go, for example:
    add_action( 'woocommerce_single_product_summary', woocommerce_template_single_meta', 15 );
    where priority 15 is between the price (10) and the excerpt (20).

    This code goes in functions.php for your child theme or you can try a snippets plugin. Don’t edit plugin files because any edits will be overwritten by updates.

    If your theme has already changed the standard hook names and section positions, you’ll need to start by looking at the theme version of content-single-product.php.

    Thread Starter jordicastalla

    (@dianiatv)

    Oh! Works fine!!!

    I put the 2 lines on my Functions.php (on my Child Theme), like this:

    //SKU reorganize

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40);
    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 15 );

    Thanks!!

    • This reply was modified 5 years, 7 months ago by jordicastalla.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reorganize product meta’ is closed to new replies.