The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Default weight type

bjbkbjbk Member
in Bugs & Feature Requests edited December 2009
So I'm currently working on an intergration with FoxyCart, and am currently needing to intergrate with Australia Post to calculate shipping costs. Obviously, without SuperShip, this requires some hacks on my part, which is fine.

I am currently including the weight as part of the hidden product options in the form, but the weight modifier is defaulting to lbs. Is there any way to make it kg's when using flat rate shipping in the category options? (I'm under the understanding that I need to set it to flat rate shipping to enable my hacks for shipping to work).
Comments
  • lukeluke FoxyCart Team
    edited December 2009
    Hey bjbk. You're actually in uncharted waters... if you're trying to get live rates using weights, then you'll need to select live rates, but you might be able to get away with overriding our updateShipping method and use your own instead. We really can't do much for you here since whatever we tell you will be a complete hack and will probably break in future versions. Just to get you started though, you should probably upgrade to 060 and take a look at checkout.js. Everything that was previously forced is not now configurable as a javascript config value.

    That js needs quite a bit of work, but you might be able to get what you need by poking around in there a bit. If you're not using multiship, you can override updateShipping (which is passed a -1 to indicate multiship is not being used) and call your own method which should simulate what updateShipping does as far as populating shipping_methods_inner with shipping options. That's going to be a little strange, however, since those ids and values come from our database and you'd have to fake them on your end. It would also not work if you have recurring shippable products in your subscriptions.

    On our list of "todo"'s for future versions is the idea of building custom end points for shipping and taxes so basically FoxyCart could just ask your server, 'hey, what do you want here?' and then use what you give us. We're a couple versions away from doing that, but it's something we think will be really flexible.

    Good luck and let us know how it goes.
  • Hey Luke,

    Thanks for the reply mate.

    I'm currently testing on 0.6.0, and as they won't be using paypal it should be pretty stable for their needs. It's also a products only shop, no subscriptions or downloadables so it makes it eaiser.

    Australia Post has an api I can hook into to get shipping rates returned to me based on the weight and size of the parcel being sent, and I've previously hacked the shipping to get postcode based shipping in a previous shop, so thats not an issue for me at this point. My question was more pointed towards the fact that in the cart, the weights are defaulted to lbs. Is it possible to alter this? Something I hadn't considered, and its probably the answer, is that I could just change that text via javascript. Although thinking out loud, isnt there a stage of the reciepts that doesnt actually apply javascript to the template?
  • brettbrett FoxyCart Team
    Check the bottom of the category pages. The lbs/kgs should be a store setting, but it's a category setting at this point. I'm not entirely sure it'd matter for what you're doing (other than for display), but that's where you can set it.
  • Hey brett, thanks for that, but thats only an option that I can see when I choose to use live rates, not an option for flat rate. Which makes sense as its not needed for flat rate calculations really, but it kinda it is needed when displayed inside the cart.
  • brettbrett FoxyCart Team
    AH. Gotcha... Have you tried setting it to live rates and setting it to kgs, saving, then flipping it back to flat rate and seeing if the kgs hold?

    It's a good question that we'll have to look into a bit more.
  • Setting it for live rates, saving, then resaving as flat rate keeps the KGS set. Cheers Brett.
  • Just bumping this.
    The problem still exists.

    I have two categories. One has weight in KGS showing in the cart etc.
    The other is LBS.
    I'm using Flat Rate Shipping with Multiple Flat Rate Shipping as discussed here
    http://forum.foxycart.com/comments.php?DiscussionID=3132&page=2

    So the weight is important for customer feedback etc.

    From the Categories setup there appears to be no way to change metric to imperial. But as discussed you temporarily select Live Shipping and change the LBS to KGS.
    Elsewhere on the forum I found a discussion of a bug with a mix of KGS and inches. Unless that has been fixed best to change both. Makes sense anyway.
    Remember to switch back from Live Shipping!
  • fc_adamfc_adam FoxyCart Team
    @Parthian,

    Just to clarify, did the workaround of setting live rates and then changing back to flat rate fix it for you?
  • Adam,

    Yes, KGS in Cart where previously LBS. Easy when you know how but too obscure to be acceptable without a fix.

    I wonder if there is a need for Weights to be set at the Category as current (but not hidden away under Live Shipping) or, as planned a while back, to have a default for the entire shop.
    Maybe some shops would like to have some Categories in Imperial and some in Metric.
    A Shop Default with per Category override?

    Only circumstance I can think of would be a shop selling stuff by weight for we backward Anglo-Saxons and also for enlightened Europeans with their Base 10 system!
    Seems a bit unlikely though.

    A while back, in the UK, companies could be prosecuted for selling in Imperial - an attempt to enforce standardisation (not a bad thing generally). Rules have been relaxed lately though.
  • fc_adamfc_adam FoxyCart Team
    @Parthian,

    Yeah definitely not an ideal situation. From what I can see there wasn't a ticket for this issue, so I've made one now. We'll look into this and see if we can find a solution that makes sense for everyone.
Sign In or Register to comment.