FAQ
Hi all,

One of my customer requires a non trivial shipping strategy (similar to the
advanced setup in http://guides.spreecommerce.com/developer/shipments.html)


    - The products can be classified in four shipping categories
    (Ultra-light, light, medium and heavy)
    - Products can be sold to different zones (US, Canada, Europe and rest
    of world)
    - The shipping rate calculator are all Flexi rates:
    - For instance
       - USA, Heavy 15$ first item, 10$ for each additional item
       - Canada. Heavy 10$ first item, 7$ for each additional item
       - USA, Light 5$ first item, 2$ for each additional item
       - etc..

Following the instructions on the guide, it is pretty straight forward to
setup the shipping categories that would work when the user only selects
products from one categories only (i.e add only heavy items or light items
to the cart).

As soon as the user however decides to add a heavy item *AND *a light item,
I am having a dilemma understanding how to model that with spree.

If the rule for match is "one", then when checking out, both shipping
methods for light and heavy in Canada are available, which is clearly
wrong.
if the rule for match is "all", then I get the error that no shipping
method is available for a mixed cart.

I am sure there is a way to model that correctly but I am just not sure how.

Thanks for any input on that.

Take care,
Michael

Search Discussions

  • Alberto Vena at Jun 3, 2013 at 7:49 am
    Hi Michael,

    I had a similar scenario for one of or clients.

    Try putting "all" to Light shipping rate and "one" to Heavy one. This way to just have one (or more) Heavy product will make the shipment Heavy. Instead, if all elements are Light, the Light shipping will be applied.

    Let me know if this works.

    Cheers

    --
    Alberto Vena

    http://nebulab.it/


    Il giorno sabato 1 giugno 2013, alle ore 23:20, Michael Sevestre ha scritto:
    Hi all,

    One of my customer requires a non trivial shipping strategy (similar to the advanced setup in http://guides.spreecommerce.com/developer/shipments.html)

    The products can be classified in four shipping categories (Ultra-light, light, medium and heavy)
    Products can be sold to different zones (US, Canada, Europe and rest of world)
    The shipping rate calculator are all Flexi rates:
    For instance
    USA, Heavy 15$ first item, 10$ for each additional item
    Canada. Heavy 10$ first item, 7$ for each additional item
    USA, Light 5$ first item, 2$ for each additional item
    etc..


    Following the instructions on the guide, it is pretty straight forward to setup the shipping categories that would work when the user only selects products from one categories only (i.e add only heavy items or light items to the cart).

    As soon as the user however decides to add a heavy item AND a light item, I am having a dilemma understanding how to model that with spree.

    If the rule for match is "one", then when checking out, both shipping methods for light and heavy in Canada are available, which is clearly wrong.
    if the rule for match is "all", then I get the error that no shipping method is available for a mixed cart.

    I am sure there is a way to model that correctly but I am just not sure how.

    Thanks for any input on that.

    Take care,
    Michael

  • Alberto Vena at Jun 3, 2013 at 1:10 pm
    You are right Michael, I was assuming you just have 2 categories for each country. Actually, I don't think it's doable with default Spree shipping methods.
    Maybe you'll have to overload some methods which choose the eligible shipping methods changing it so it will take just the first of them if multiple are eligible. This suppose you have to sort them on a priority base before selecting the first.

    Could something like that work?

    --
    Alberto Vena

    http://nebulab.it/


    Il giorno lunedì 3 giugno 2013, alle ore 14:58, Michael Sevestre ha scritto:
    Thanks for the reply Alberto

    This solution works if and only if you have two categories (Light and Heavy) . Things get more complicated with three (Light, Medium and Heavy)
    How would I model one light and one medium item in a shopping cart?

    Following settings:
    Light=>all
    Medium=>one
    Heavy=>one

    It would work for Light + Medium
    But the combination Heavy + Medium would create two shipping methods (Medium and Heavy). One of which is actually wrong :(

    Cheers







    On Mon, Jun 3, 2013 at 9:49 AM, Alberto Vena (mailto:kennyadsl@gmail.com)> wrote:
    Hi Michael,

    I had a similar scenario for one of or clients.

    Try putting "all" to Light shipping rate and "one" to Heavy one. This way to just have one (or more) Heavy product will make the shipment Heavy. Instead, if all elements are Light, the Light shipping will be applied.

    Let me know if this works.

    Cheers

    --
    Alberto Vena

    http://nebulab.it/


    Il giorno sabato 1 giugno 2013, alle ore 23:20, Michael Sevestre ha scritto:
    Hi all,

    One of my customer requires a non trivial shipping strategy (similar to the advanced setup in http://guides.spreecommerce.com/developer/shipments.html)

    The products can be classified in four shipping categories (Ultra-light, light, medium and heavy)
    Products can be sold to different zones (US, Canada, Europe and rest of world)
    The shipping rate calculator are all Flexi rates:
    For instance
    USA, Heavy 15$ first item, 10$ for each additional item
    Canada. Heavy 10$ first item, 7$ for each additional item
    USA, Light 5$ first item, 2$ for each additional item
    etc..


    Following the instructions on the guide, it is pretty straight forward to setup the shipping categories that would work when the user only selects products from one categories only (i.e add only heavy items or light items to the cart).

    As soon as the user however decides to add a heavy item AND a light item, I am having a dilemma understanding how to model that with spree.

    If the rule for match is "one", then when checking out, both shipping methods for light and heavy in Canada are available, which is clearly wrong.
    if the rule for match is "all", then I get the error that no shipping method is available for a mixed cart.

    I am sure there is a way to model that correctly but I am just not sure how.

    Thanks for any input on that.

    Take care,
    Michael


  • Michael Sevestre at Jun 3, 2013 at 3:01 pm
    Yes that's what I was thinking too. But I am surprised that one has to hack
    in the code in order to get that feature going
    Can someone tell me if this scenario would work out of the box in Spree 2.x
    with the split shipments feature?

    On Mon, Jun 3, 2013 at 3:10 PM, Alberto Vena wrote:

    You are right Michael, I was assuming you just have 2 categories for each
    country. Actually, I don't think it's doable with default Spree shipping
    methods.
    Maybe you'll have to overload some methods which choose the eligible
    shipping methods changing it so it will take just the first of them if
    multiple are eligible. This suppose you have to sort them on a priority
    base before selecting the first.

    Could something like that work?

    --
    Alberto Vena

    http://nebulab.it/

    Il giorno lunedì 3 giugno 2013, alle ore 14:58, Michael Sevestre ha
    scritto:

    Thanks for the reply Alberto

    This solution works if and only if you have two categories (Light and
    Heavy) . Things get more complicated with three (Light, Medium and Heavy)
    How would I model one light and one medium item in a shopping cart?

    Following settings:
    Light=>all
    Medium=>one
    Heavy=>one

    It would work for Light + Medium
    But the combination Heavy + Medium would create two shipping methods
    (Medium and Heavy). One of which is actually wrong :(

    Cheers








    On Mon, Jun 3, 2013 at 9:49 AM, Alberto Vena wrote:

    Hi Michael,

    I had a similar scenario for one of or clients.

    Try putting "all" to Light shipping rate and "one" to Heavy one. This way
    to just have one (or more) Heavy product will make the shipment Heavy.
    Instead, if all elements are Light, the Light shipping will be applied.

    Let me know if this works.

    Cheers

    --
    Alberto Vena

    http://nebulab.it/

    Il giorno sabato 1 giugno 2013, alle ore 23:20, Michael Sevestre ha
    scritto:

    Hi all,

    One of my customer requires a non trivial shipping strategy (similar to
    the advanced setup in
    http://guides.spreecommerce.com/developer/shipments.html)


    - The products can be classified in four shipping categories
    (Ultra-light, light, medium and heavy)
    - Products can be sold to different zones (US, Canada, Europe and rest
    of world)
    - The shipping rate calculator are all Flexi rates:
    - For instance
    - USA, Heavy 15$ first item, 10$ for each additional item
    - Canada. Heavy 10$ first item, 7$ for each additional item
    - USA, Light 5$ first item, 2$ for each additional item
    - etc..

    Following the instructions on the guide, it is pretty straight forward to
    setup the shipping categories that would work when the user only selects
    products from one categories only (i.e add only heavy items or light items
    to the cart).

    As soon as the user however decides to add a heavy item *AND *a light
    item, I am having a dilemma understanding how to model that with spree.

    If the rule for match is "one", then when checking out, both shipping
    methods for light and heavy in Canada are available, which is clearly
    wrong.
    if the rule for match is "all", then I get the error that no shipping
    method is available for a mixed cart.

    I am sure there is a way to model that correctly but I am just not sure
    how.

    Thanks for any input on that.

    Take care,
    Michael



  • Michael Sevestre at Jun 3, 2013 at 10:28 pm
    FYI
    I managed to get it working by overriding the method category_match?(order)
    in ShippingMethod.rb

    Hope that helps anyone out there
    Cheers.
    Michael

    On Mon, Jun 3, 2013 at 11:01 AM, Michael Sevestre wrote:

    Yes that's what I was thinking too. But I am surprised that one has to
    hack in the code in order to get that feature going
    Can someone tell me if this scenario would work out of the box in Spree
    2.x with the split shipments feature?

    On Mon, Jun 3, 2013 at 3:10 PM, Alberto Vena wrote:

    You are right Michael, I was assuming you just have 2 categories for each
    country. Actually, I don't think it's doable with default Spree shipping
    methods.
    Maybe you'll have to overload some methods which choose the eligible
    shipping methods changing it so it will take just the first of them if
    multiple are eligible. This suppose you have to sort them on a priority
    base before selecting the first.

    Could something like that work?

    --
    Alberto Vena

    http://nebulab.it/

    Il giorno lunedì 3 giugno 2013, alle ore 14:58, Michael Sevestre ha
    scritto:

    Thanks for the reply Alberto

    This solution works if and only if you have two categories (Light and
    Heavy) . Things get more complicated with three (Light, Medium and Heavy)
    How would I model one light and one medium item in a shopping cart?

    Following settings:
    Light=>all
    Medium=>one
    Heavy=>one

    It would work for Light + Medium
    But the combination Heavy + Medium would create two shipping methods
    (Medium and Heavy). One of which is actually wrong :(

    Cheers








    On Mon, Jun 3, 2013 at 9:49 AM, Alberto Vena wrote:

    Hi Michael,

    I had a similar scenario for one of or clients.

    Try putting "all" to Light shipping rate and "one" to Heavy one. This way
    to just have one (or more) Heavy product will make the shipment Heavy.
    Instead, if all elements are Light, the Light shipping will be applied.

    Let me know if this works.

    Cheers

    --
    Alberto Vena

    http://nebulab.it/

    Il giorno sabato 1 giugno 2013, alle ore 23:20, Michael Sevestre ha
    scritto:

    Hi all,

    One of my customer requires a non trivial shipping strategy (similar to
    the advanced setup in
    http://guides.spreecommerce.com/developer/shipments.html)


    - The products can be classified in four shipping categories
    (Ultra-light, light, medium and heavy)
    - Products can be sold to different zones (US, Canada, Europe and
    rest of world)
    - The shipping rate calculator are all Flexi rates:
    - For instance
    - USA, Heavy 15$ first item, 10$ for each additional item
    - Canada. Heavy 10$ first item, 7$ for each additional item
    - USA, Light 5$ first item, 2$ for each additional item
    - etc..

    Following the instructions on the guide, it is pretty straight forward to
    setup the shipping categories that would work when the user only selects
    products from one categories only (i.e add only heavy items or light items
    to the cart).

    As soon as the user however decides to add a heavy item *AND *a light
    item, I am having a dilemma understanding how to model that with spree.

    If the rule for match is "one", then when checking out, both shipping
    methods for light and heavy in Canada are available, which is clearly
    wrong.
    if the rule for match is "all", then I get the error that no shipping
    method is available for a mixed cart.

    I am sure there is a way to model that correctly but I am just not sure
    how.

    Thanks for any input on that.

    Take care,
    Michael



Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedJun 1, '13 at 9:20p
activeJun 3, '13 at 10:28p
posts5
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Michael Sevestre: 3 posts Alberto Vena: 2 posts

People

Translate

site design / logo © 2022 Grokbase