Commit 961072c9 authored by Vincent Desmares's avatar Vincent Desmares

#vincentd

Dont generate Order dict if there is no product in the cart. And fix the price of shipping to 0 if no shipping selected (shipping requierement is not to handle at this level).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28192 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2357bcd1
......@@ -59,11 +59,17 @@ if order_parameter_dict is None:\n
\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_product_list = shopping_cart.SaleOrder_getShoppingCartItemList()\n
\n
if len(shopping_cart_product_list) == 0:\n
return None \n
\n
shopping_cart_price = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice())\n
taxes_amount = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) - \\\n
float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_shipping=True));\n
shipping = context.SaleOrder_getSelectedShippingResource()\n
shipping_price = context.restrictedTraverse(shipping).getPrice()\n
if shipping_price is None:\n
shipping_price = 0\n
customer = context.SaleOrder_getShoppingCartCustomer()\n
site_url = context.getWebSiteValue().absolute_url()\n
\n
......@@ -134,6 +140,7 @@ return order_parameter_dict\n
<string>None</string>
<string>shopping_cart</string>
<string>shopping_cart_product_list</string>
<string>len</string>
<string>float</string>
<string>shopping_cart_price</string>
<string>True</string>
......
144
\ No newline at end of file
145
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment