Rearrange the position of Size Chart button.

This topic has 5 replies, 2 voices, and was last updated 1 years, 6 months ago ago by Prashant

  • Avatar: Prashant
    Prashant
    Participant
    April 30, 2023 at 15:52

    I have been playing with hooks and actions, but still I am unable to rearrange the Size Chart button position on single product page.

    I am using this code, but getting new Size Chart button with your them’s default size chart image.

    remove_action( ‘woocommerce_single_product_summary’, ‘etheme_product_single_size_guide’);
    add_action( ‘woocommerce_single_product_summary’, ‘etheme_product_single_size_guide’, 60 );

    4 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 1, 2023 at 07:08

    Hello, Prashant,

    Thank you for contacting us and for using XStore.

    The function you use for that hook is named →
    etheme_product_single_size_guide
    is related to Single product builder only.
    You are using one of the default templates (non-builder) so you should use another function for such cases
    etheme_size_guide
    Example:

    remove_action( ‘woocommerce_single_product_summary’, ‘etheme_size_guide’, 21);
    add_action( ‘woocommerce_single_product_summary’, ‘etheme_size_guide’, 60 );

    We hope this information is helpful.

    Kind Regards,
    8theme team

    Avatar: Prashant
    Prashant
    Participant
    May 1, 2023 at 13:42

    Thank you for the correction but I was unable to get the priority number of that action, please let me know from where we could find priority number.

    and yes the code you gave isn’t working, I am adding the code the function.php of child theme, still not changing the “size chart” button order on single product page.

    remove_action( ‘woocommerce_single_product_summary’, ‘etheme_product_single_size_guide’, 21);
    add_action( ‘woocommerce_single_product_summary’, ‘etheme_product_single_size_guide’, 1 );

    Please find the attached temporary credentials to troubleshoot on urgent basis.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 1, 2023 at 14:51

    Hello, Prashant,

    As you can see on the next screenshot → https://prnt.sc/ju9ZdPhqnmEs quote symbols differ in previous and next hooks.
    After fixing the quotes → https://prnt.sc/iHFJ_FvFHQok there are shown 2 size guide elements, but we already wrote you to use not the function you still had ‘etheme_product_single_size_guide’ but ‘etheme_size_guide’.
    The ready solution is next:

    add_action('wp', function() {
        remove_action( 'woocommerce_single_product_summary', 'etheme_size_guide', 21);
        add_action( 'woocommerce_single_product_summary', 'etheme_size_guide', 1 );
    }, 70);

    The result → https://prnt.sc/vVmPlMdItw1a

    Kind Regards,
    8theme team

    Avatar: Prashant
    Prashant
    Participant
    May 1, 2023 at 16:06

    Thank you for the response.

    This worked well.

    Thank you so much.

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘Rearrange the position of Size Chart button.’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.