This topic has 5 replies, 2 voices, and was last updated 1 years, 6 months ago ago by Prashant
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 );
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
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.
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
Thank you for the response.
This worked well.
Thank you so much.
Tagged: button, position, rearrange, size chart, template, woocommerce, wordpress
The issue related to '‘Rearrange the position of Size Chart button.’' has been successfully resolved, and the topic is now closed for further responses