Вопрос

I have spent the last hour or so trying to make this work, several examples appear to be from over a year ago and I'm wondering if either something changed or if I am just missing something.

My client wants to have free shipping on orders over $149. All products are listed under the DEFAULT category, shipping is set to Flat Rate $14.95. I am using the Javascript custom rule below along with this code - https://wiki.foxycart.com/snippets/shipping/tiered_flat_rate_shipping

function calculateShipping() {
        var shippingCost = 14.95;

        /* BEGIN CUSTOM SHIPPING LOGIC */
        var amount = fc_json.total_price;
        if (amount >= 149) {
            shippingCost = 0;
        }

        /* END CUSTOM SHIPPING LOGIC */
        FC.checkout.config.orderFlatRateShipping = shippingCost;
        FC.checkout.updateShipping(-1);
    }

I have tested the ability to detect the total of the cart with an alert in the code, that is working fine - but the shipping & handling fee remains at $14.95 no matter what. What am I doing wrong?

Это было полезно?

Решение

Being fairly new to Foxy Cart I did not fully understand the shipping options. Multi-ship was enabled in the store settings and was preventing this code from working properly. Disabling multi-ship solved this issue.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top