[Resolved] Woocommerce move product meta info from below the short description to above it?

Home Forums Support [Resolved] Woocommerce move product meta info from below the short description to above it?

Home Forums Support Woocommerce move product meta info from below the short description to above it?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1582376
    John MacKenzie

    how to move the single product meta info from below the short description to above it?

    thanks!

    John

    #1582665
    David
    Staff
    Customer Support

    Hi there,

    the Woocommerce plugin uses hooks to add the various elements to its templates – you can see the hooks being used on the single product here:

    https://github.com/woocommerce/woocommerce/blob/44d508e3327b1745866b0b251ec09414eb284eed/templates/content-single-product.php#L46-L62

    So to move something like the meta first it needs be unhooked and then rehooked with a PHP Snippet like so:

    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 15);

    The priority numbers are important – the woocommerce_template_single_meta is initally hooked in at a priority of 40, we remove it from there and add it back with a priority of 15 which comes before the single_excerpt

    #1583600
    John MacKenzie

    great thanks!

    John

    #1583626
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.