Commit 2eb59c1b authored by Lucas Carvalho's avatar Lucas Carvalho

* fixed payment_mode bug

* fixed currency

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28314 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec37e342
......@@ -92,7 +92,7 @@ line_found=False\n
for order_line in shopping_cart_items:\n
if order_line.getResource() == resource.getRelativeUrl():\n
new_quantity = int(order_line.getQuantity()) + quantity\n
if new_quantity<=0:\n
if new_quantity <= 0:\n
## remove items with zero quantity\n
shopping_cart.manage_delObjects(order_line)\n
else:\n
......
......@@ -79,7 +79,7 @@ else:\n
if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n
shopping_cart = newTempOrder(portal_sessions, shopping_cart_id)\n
shopping_cart.setPriceCurrency(\'currency_module/1\')\n
shopping_cart.setPriceCurrency(\'currency_module/EUR\')\n
session[shopping_cart_id] = shopping_cart\n
\n
## return just a part of session for shopping cart\n
......
......@@ -58,7 +58,7 @@
Please update accordingly relative path. \n
XXX: there must be an way to do this better?\n
"""\n
return context.getPortalObject().restrictedTraverse(\'currency_module/1\')\n
return context.getPortalObject().restrictedTraverse(\'currency_module/EUR\')\n
</string> </value>
</item>
<item>
......
......@@ -60,7 +60,7 @@ if field_my_payment_mode is None:\n
\n
if field_my_payment_mode == \'Credit Card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\n
elif field_my_payment_mode == \'PayPal\':\n
elif field_my_payment_mode.lower() == \'paypal\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
else:\n
return "This method is actually not activated, sorry : %s" % field_my_payment_mode\n
......
......@@ -53,10 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
if parameter_dict is None:\n
return None\n
response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(parameter_dict=parameter_dict,\n
<value> <string>response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n
if response_parameter_dict is None:\n
......@@ -104,9 +101,8 @@ return \'\'\n
<string>alternative_url</string>
<string>_getattr_</string>
<string>context</string>
<string>parameter_dict</string>
<string>None</string>
<string>response_parameter_dict</string>
<string>None</string>
<string>_getitem_</string>
</tuple>
</value>
......
......@@ -59,17 +59,11 @@ 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
......@@ -140,7 +134,6 @@ 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>
......
146
\ No newline at end of file
147
\ 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