Hi Josh,
  Thanks for your reply.
Got that and I will try later on,

Wesley

You should be able to do that in the billship handler.  You can see the 
> default here,
>
> https://bitbucket.org/stephenmcd/cartridge/src/57a56a41baf1b70789567a1d06b79a473e719a22/cartridge/shop/checkout.py?at=default#cl-26
>
> The important part is that it points out that you can access request.cart
>
> So in your handler you would want to do something like:
>
> for item in request.cart:
>     # if this is the max price so far store it
>     # else continue
>
> # set the shipping to the max price
>
> On Tue, Feb 3, 2015 at 1:43 AM, Wesley <[email protected] <javascript:>> 
> wrote:
>
>> Hi ,
>>  I have one question.
>> Assume you've finished this feature.
>>
>> So, when one order comes, containing multiple products, so, how to set 
>> the final shipping value?
>>
>> Filter all items and set to the most expensive one?
>>
>> Thanks.
>> Wesley
>>
>>
>> Hey everyone,
>>>
>>> After browsing on the forum, I successfully setup a custom 
>>> billship_hander depending on the country from the order_form
>>>
>>> SHOP_HANDLER_BILLING_SHIPPING = "myapp.checkout.custom_billship_handler"
>>>
>>> def custom_billship_handler(request, order_form):
>>>
>>>     if order_form is not None:
>>>         if not request.session.get("free_shipping"):
>>>             settings.use_editable()
>>>
>>>
>>>             if order_form.cleaned_data["shipping_detail_country"] == 
>>> "Canada":
>>>                 set_shipping(request, "CanadaPost Regular", 5.00)
>>>
>>>
>>>             elif order_form.cleaned_data["shipping_detail_country"] == 
>>> "US":
>>>                 set_shipping(request, "CanadaPost US Regular", 7.90)
>>>
>>>
>>>             else:
>>>                 set_shipping(request, _("Flat rate shipping"), settings.
>>> SHOP_DEFAULT_SHIPPING_VALUE)
>>>
>>>
>>>
>>> But now, is there a way to filter my shipping by location + category, or 
>>> product type as defined in my child_categories ?
>>>
>>> I've been trying with the cart and order instance, but it doesn't work:
>>>
>>> #cart = Cart.objects.from_request(request)
>>> #cart_test = request.cart.has_items()
>>> #order = Order.objects.from_request(request)
>>>
>>> Any tips is appreciated! Thanks 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to