Home Forums WoodMart support forum Woocommerce hook

Woocommerce hook

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #568439

    Hello, 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 you

    #568486

    Artem Temos
    Keymaster

    Hello,

    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

    #568495

    Hello,

    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.
    #568498

    Artem Temos
    Keymaster

    As 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.

    #568509

    Thank 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.

    #568520

    Artem Temos
    Keymaster

    Did you try to add this hook to the checkout page? Please send us a screenshot so we can see.

    #568610

    Hello,

    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.
    #568615

    5th screenshot

    Attachments:
    You must be logged in to view attached files.
    #568634

    Artem Temos
    Keymaster

    Both 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.

    #569424

    After 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.

    #569442

    Artem Temos
    Keymaster

    Sorry 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/

Viewing 11 posts - 1 through 11 (of 11 total)