Hey guys! i need some help to solve a little problem with my shipping module.. all the module is working fine, but when i put a zip code, the rate doesn't update.
1.put any product inside your cart
PS>: i saw the AJAX/knockout 'estimate-shipping-methods' is not sended if i set only my module active.. but if i allow "flat rate" or any native shipping method it update normally.
i used some tutorial to convert magento 2 module, but i dont know which part of it i forgot something.
Not sure if what I experienced will be the same as your issue, but I thought I'd share. I updated my shipping methods to only be FedEx, yet whenever I changed my zip on the "estimate shipping" part of the checkout page.... no rate updates!
I tracked the issue to the file "Magento_Fedex/js/model/shipping-rates-validation-rules" which specifies that city must be available to make a rate requests. I replaced that file in my theme to have city as not required, and now it updates just fine with the proper rates.
If you do some javascript debugging and look at the callstack for any of the getRules() functions, you should be headed in the right direction to find out why your problem is happening and it what point it decides not to request new rates. Hope this helps.
actually i followed your steps, but my module doesn't use JS files to get validation on shipping rates, its a gateway to calculate the rates on Brazil, i use soap to call the methods inside this gateway, which is included some transporting enterprises and delivery services on Brazil.. but still, thanks for supporting!!
Hi All,
I also get the same issue.
When i am enabling default shipping module with my custom shipping module, it is refreshing the shipping section.
But when i am enabling only my custom shipping code, it is not getting refreshed when i am changing pincode.
Is there any update for this issues.
Hi All,
I got the same issue on my site.
I need enable one of system shipping method to enable validation working.
Otherwise it won't load my checkout_index_index.xml.
<?xml version="1.0"?>
<!--
/**
* Copyright 漏 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="step-config" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-rates-validation" xsi:type="array">
<item name="children" xsi:type="array">
<item name="simple-shipping-rates-validation" xsi:type="array">
<item name="component" xsi:type="string">Simple_Shipping/js/view/shipping-rates-validation</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
Looking for solution, but nothing found.
@uileprojecttus, thank you for your report.
Please try to reproduce this issue on a clean installation without any third-party dependencies.
@uileprojecttus, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.
Hi there, I'm with the same problem here ...
I have followed this instructions to create my custom shipping module. But my custom shipping validations are not loading, and even the .js files aren't load in my page, I don't know why ...
look:
checkout_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="step-config" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-rates-validation" xsi:type="array">
<item name="children" xsi:type="array">
<item name="inchoo" xsi:type="array">
<item name="component" xsi:type="string">Inchoo_Shipping/js/view/inchoo</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
checkout_cart_index.xml:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.cart.shipping">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="summary-block-config" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-rates-validation" xsi:type="array">
<item name="children" xsi:type="array">
<item name="inchoo" xsi:type="array">
<item name="component" xsi:type="string">Inchoo_Shipping/js/view/inchoo</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
And Finally, my inchoo.js in Inchoo/Shipping/view/frontend/web/js/view/inchoo.js, with this content:
define([
'uiComponent',
'Magento_Checkout/js/model/shipping-rates-validator',
'Magento_Checkout/js/model/shipping-rates-validation-rules',
'../model/inchoo-validatior',
'../model/inchoo-rules'
],function (
Component,
defaultShippingRatesValidator,
defaultShippingRatesValidationRules,
shippingRatesValidator,
shippingRatesValidationRules
) {
'use strict';
defaultShippingRatesValidator.registerValidator('carrierName', shippingRatesValidator);
defaultShippingRatesValidationRules.registerRules('carrierName', shippingRatesValidationRules);
return Component;
}
);
But when I'm at guest checkout page, I've noticed that inchoo.js file is not loaded.
And when a change postcode value, nothing happens as well.
Any idea of why it occurs?
Thanks in advance.
Most helpful comment
Hi there, I'm with the same problem here ...
I have followed this instructions to create my custom shipping module. But my custom shipping validations are not loading, and even the .js files aren't load in my page, I don't know why ...
look:
checkout_index_index.xml
checkout_cart_index.xml:
And Finally, my inchoo.js in
Inchoo/Shipping/view/frontend/web/js/view/inchoo.js, with this content:But when I'm at guest checkout page, I've noticed that
inchoo.jsfile is not loaded.And when a change postcode value, nothing happens as well.
Any idea of why it occurs?
Thanks in advance.