Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2115 Lượt xem

Hi, Did anyone find a solution for this "problem"


I have an external Website / landing page, but want to sell the product with odoo. Is there any way to go directly to the checkout page (like with the "buy now") button?


Thx

Andi

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can always create a server action, with a website url that do it.

By default we avoid since it allow anybody to update your cart. But in your case, seems to be what you want...


New Server action > website_path > add2cart

A model writable for public user: e.g. Custom View

Code:

sale_order = request.website.sale_get_order(force_create=True)
sale_order._cart_update(product_id=int(request.params.get('p')), add_qty=1)
response = request.redirect('/shop/checkout?express=1')

And now you can create link to your odoowebsite.com/website/action/add2cart?p=


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Thanks for the help, are the chain sequences with descriptions available somewhere? For example I would like to add product 10,11,15 with this and that attribute (quantity) and for example discount code. What brands/characters are used for product combinations etc.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thank you very much! Will try!

Do I need a Enterprise subscription for the server action?

Thx


Ảnh đại diện
Huỷ bỏ