This question has been flagged
2 Replies
4168 Views

I have my webshop set up with Odoo 8.0 online version. I have a problem with setting up my shipment costs at the check out page.

I made a delivery pricelist: orders below €50 --> €6.95 shipping costs order above €50 --> €0 shipping costs.

At the checkout page you have 4 main blocks (review order / shipping & blling / payment / confirmation). When a client is choosing from the first time the correct quantity there is no problem. The problem is that when a customer is adjusting quantities in block "review order" the shipping costs don't follow the new order value. Odoo does not adjust the shipping costs directly and that is very confusing for customers. 

Has anybody got a solution?

 

 

Avatar
Discard
Best Answer

Hello Hans

Its not working because whenever you update the cart it will not trigger any delivery cost method right now .

You need to add the code in website_sale module .

The code is below . either you can change the code and you can make a new module for inherit the website_sale mathod.

@http.route(['/shop/cart/update_json'], type='json', auth="public", methods=['POST'], website=True)
    def cart_update_json(self, product_id, line_id, add_qty=None, set_qty=None, display=True):
        cr, uid, context = request.cr, request.uid, request.context
        order = request.website.sale_get_order(force_create=1)
        order._check_carrier_quotation(order, force_carrier_id=order.carrier_id)
        value = order._cart_update(product_id=product_id, line_id=line_id, add_qty=add_qty, set_qty=set_qty)
        if not display:
            return None
        value['cart_quantity'] = order.cart_quantity
        value['website_sale.total'] = request.website._render("website_sale.total", {
                'website_sale_order': request.website.sale_get_order()
            })
        return value

Hope that this answer will help you.

Please don't hesitate to ask any question regarding this.

If you get the answer as you need then please accept the answer.

Thank You

 

Avatar
Discard

This code it doesn't work on Odoo 8.0-20160607

Nobody has a solution.. This is still happening on 2016........ Incredible..

Author Best Answer

Dear Kazim,

Thanks for your quick response. But I'm not familar with adding codes to modules. Can somebody explain what I should do? Like a said I'm an Odoo 8 web client.

Hans W

 

Avatar
Discard

Sorry but the only way is to make a module if you dont want to loss the code.