Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Calculating Shipping Costs using weight and customer spend (UK)

fox101fox101 Member
in Help edited October 2012
Hello, we would like to calculate shipping costs as below. Is it possible to take into consideration both weight and customer spend?
I am using the Perch CMS and there seems nowhere to enter the weight of a product in their app.

Under £55 and under 500g = £2
Under £55 and under 31kg = £5
Over £55 and up to 31kg = Free
Over £55 and over 31kg = £5 per kilo extra
Plus free local delivery

Thank you!
  • lukeluke FoxyCart Team
    Hello fox101. @fc_adam may be able to put something together for you using these scripts as a starting point:

    As for Perch not allowing you to specify the product weight, can you specify other custom attributes? As long as it's sent to the cart as "weight" you should be good to go. After that, it's a matter of checking the order price via JavaScript and going from there.
  • Hi Luke,

    Thanks for this. I am a web designer not a programmer, so if Adam is able to help at all that would be great - I am out of my depth playing with the shopping cart code and would not want to mess anything up.

    Yes, it is possible to specify various custom attributes in Perch, and I may well be able to customise their product template to include a weight value if it is simply the number that is needed.
  • fox101fox101 Member
    edited October 2012
    Hi - just an update to my above post. I have managed to add 'Weight' as an option in Perch so this could be passed to FoxyCart.

    Help with JavaScript would be much appreciated!

  • fc_adamfc_adam FoxyCart Team

    What constitutes 'local delivery'?
  • Hi Adam, would it be possible to work this out using the customer's postcode? e.g. free delivery to postcodes beginning 'LS'?
  • fc_adamfc_adam FoxyCart Team
    Yep it is :)

    Run through the steps described on this page:

    Using this for the custom logic:
  • Hi Adam,

    Sorry - old thread - but we're just ready to go live with this site now. The postage calculator seems to work well, except with the 'LS' postcodes part. It has calculated shipping charges before you can enter a delivery address. If you enter a LS postcode, it makes no difference to the shipping charge. Do you have any ideas how we can resolve? Thanks very much for your help so far :-)
  • fc_adamfc_adam FoxyCart Team

    Could you link me to your checkout? I'd like to see this in action to debug
  • fc_adamfc_adam FoxyCart Team

    Could you try changing the 'onLocationChange' setting to true in the custom shipping snippet please?
  • Hi Adam, thanks - I have changed this but it still doesn't seem to be working.
  • fc_adamfc_adam FoxyCart Team

    Oh man, sorry - can't believe I've missed this to date.

    Change this line:
    var postal_code = (jQuery("#use_different_addresses").is(":checked") ? $("#shipping_country").val() : $("#customer_country").val());

    To this:
    var postal_code = (jQuery("#use_different_addresses").is(":checked") ? $("#shipping_postal_code").val() : $("#customer_postal_code").val());
  • Fantastic - that works perfectly! Thank you so much.
Sign In or Register to comment.