Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipping Calculator vs Simple Theme #19

Open
Daaaaad opened this issue Oct 29, 2017 · 0 comments
Open

Shipping Calculator vs Simple Theme #19

Daaaaad opened this issue Oct 29, 2017 · 0 comments

Comments

@Daaaaad
Copy link

Daaaaad commented Oct 29, 2017

Hello,

I followed carefully the https://help.shopify.com/themes/customization/cart/add-shipping-calculator tutorial but I'm stuck with the same error message in the console :

Uncaught TypeError: Cannot read property '1' of null
    at _formatRate (theme.js?4269964971980373709:11)
    at _onCartShippingRatesUpdate (theme.js?4269964971980373709:11)
    at Object.success (theme.js?4269964971980373709:11)
    at j (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at x (jquery.min.js:4)
    at XMLHttpRequest.b (jquery.min.js:4)

That corresponds to the switch condition here (coming from the gist in the tutorial) :

var n = "",
                a = /\{\{\s*(\w+)\s*\}\}/,
                i = _config.moneyFormat;
            switch (i.match(a)[1]) {
                case "amount":
                    n = r(e, 2);
                    break;
                case "amount_no_decimals":
                    n = r(e, 0);
                    break;
                case "amount_with_comma_separator":
                    n = r(e, 2, ".", ",");
                    break;
                case "amount_no_decimals_with_comma_separator":
                    n = r(e, 0, ".", ",")
            }

My currency is EUR (€) and my store is configured to use "Weight based rates".

Can you help ?

Regards,

David.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant