Home › Forums › WoodMart support forum › Woocommerce hook
Woocommerce hook
- This topic has 10 replies, 2 voices, and was last updated 6 months, 2 weeks ago by Artem Temos.
-
AuthorPosts
-
May 27, 2024 at 2:47 pm #568439
HellenicTechnologiesParticipantHello, we are facing an issue with woodmart theme and a shipping plugin’s compatibility. The plugin we are using, is calling a default Woocommerce hook, which for some reason is fails.
The hook:
add_action(‘woocommerce_before_checkout_form’, array($this, ‘add_map_in_checkout’), 10, 1);
If we replace the woocommerce_before_checkout_form hook with for example woocommerce_review_order_after_cart_contents, it works fine. We tested the plugin with the default WordPress theme and it works fine.
Thank youMay 27, 2024 at 4:33 pm #568486
Artem TemosKeymasterHello,
Could you please provide us with a step by step instruction with screenshots on how to reproduce the issue? Also, allow us to switch between themes on your website to see the difference.
Kind Regards
May 27, 2024 at 4:42 pm #568495
HellenicTechnologiesParticipantHello,
To select a pickup location from ACS Points, first, add a product to your cart and proceed to checkout. Choose the delivery option “Pickup from ACS Points,” then click the button labeled “Please select an ACS Point.” After clicking the button, a map should appear, allowing you to choose your preferred drop point.
We switched themes and it worked, you can try it too.Attachments:
You must be logged in to view attached files.May 27, 2024 at 4:46 pm #568498
Artem TemosKeymasterAs we can see, there is a JS script from the plugin that should be loaded on checkout but it is not loaded
/wp-content/plugins/acs-points/js/script.js
.You need to ask plugin’s developers when exactly it should be loaded and what hook should be added to load it.
May 27, 2024 at 4:59 pm #568509
HellenicTechnologiesParticipantThank you for your prompt response.
It seems that the issue we are seeking support for is related to the script not loading on checkout as expected. We appreciate your understanding of our initial request. We have already provided the correct hook and used another hook as an example to show that the scripts do load, but not in the correct place.
Specifically, the “woocommerce_before_checkout_form” hook is not working in this context. We’ve observed that:
The same plugin with a different theme works.
The same plugin with a different hook (in your theme) works fine.
The same plugin using the “woocommerce_before_checkout_form” hook does not work.This indicates that the problem lies with the “woocommerce_before_checkout_form” hook not functioning correctly in the theme.
May 27, 2024 at 5:21 pm #568520
Artem TemosKeymasterDid you try to add this hook to the checkout page? Please send us a screenshot so we can see.
May 28, 2024 at 9:35 am #568610
HellenicTechnologiesParticipantHello,
Using the woocommerce_before_checkout_form (screenshot 1), the button appears (html) but on click it does nothing (screenshot 2). Not scripts are loaded. We looked up the code. When using for example merce_review_order_after_cart_contents hook (screenshot 3), the button works (screenshot 4) and shows the popup (screenshot 5) when clicked. Please, ignore the map error, it’s because of the API key and is not related to the issue described. (I can not upload the 5th screenshot, i will send in a new comment)
Attachments:
You must be logged in to view attached files.May 28, 2024 at 9:35 am #568615
HellenicTechnologiesParticipant5th screenshot
Attachments:
You must be logged in to view attached files.May 28, 2024 at 10:24 am #568634
Artem TemosKeymasterBoth hooks are working as expected from our end. If the button appears then hooks is called. But we don’t know why the button appears without script when using the first hook. You need to ask the plugin developer for help.
Or you can just use the second hook.May 30, 2024 at 1:46 pm #569424
HellenicTechnologiesParticipantAfter our developers investigated the issue, they discovered that the WooCommerce hooks were not loading at all. To fix this, we had to manually add the required hook to the WPBakery checkout template. We are not satisfied with your support in this particular instance. You could have simply informed us that we needed to add the hooks manually, which would have saved our developers time spent on debugging.
May 30, 2024 at 2:13 pm #569442
Artem TemosKeymasterSorry for the inconvenience. Our checkout page contains all default WooCommerce hooks. But when you create a custom layout, you actually disable the checkout page with all the hooks. But you can add them separately using a dedicated element. This information is covered in our documentation https://xtemos.com/docs-topic/custom-hooks-and-plugins-compatibility/
-
AuthorPosts
- You must be logged in to create new topics. Login / Register