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 ...@@ -92,7 +92,7 @@ line_found=False\n
for order_line in shopping_cart_items:\n for order_line in shopping_cart_items:\n
if order_line.getResource() == resource.getRelativeUrl():\n if order_line.getResource() == resource.getRelativeUrl():\n
new_quantity = int(order_line.getQuantity()) + quantity\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 ## remove items with zero quantity\n
shopping_cart.manage_delObjects(order_line)\n shopping_cart.manage_delObjects(order_line)\n
else:\n else:\n
......
...@@ -79,7 +79,7 @@ else:\n ...@@ -79,7 +79,7 @@ else:\n
if not shopping_cart_id in session.keys():\n if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n from Products.ERP5Type.Document import newTempOrder\n
shopping_cart = newTempOrder(portal_sessions, shopping_cart_id)\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 session[shopping_cart_id] = shopping_cart\n
\n \n
## return just a part of session for shopping cart\n ## return just a part of session for shopping cart\n
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
Please update accordingly relative path. \n Please update accordingly relative path. \n
XXX: there must be an way to do this better?\n XXX: there must be an way to do this better?\n
"""\n """\n
return context.getPortalObject().restrictedTraverse(\'currency_module/1\')\n return context.getPortalObject().restrictedTraverse(\'currency_module/EUR\')\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -60,7 +60,7 @@ if field_my_payment_mode is None:\n ...@@ -60,7 +60,7 @@ if field_my_payment_mode is None:\n
\n \n
if field_my_payment_mode == \'Credit Card\':\n if field_my_payment_mode == \'Credit Card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\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 return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
else:\n else:\n
return "This method is actually not activated, sorry : %s" % field_my_payment_mode\n return "This method is actually not activated, sorry : %s" % field_my_payment_mode\n
......
...@@ -53,10 +53,7 @@ ...@@ -53,10 +53,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n <value> <string>response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(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
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n \n
if response_parameter_dict is None:\n if response_parameter_dict is None:\n
...@@ -104,9 +101,8 @@ return \'\'\n ...@@ -104,9 +101,8 @@ return \'\'\n
<string>alternative_url</string> <string>alternative_url</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>parameter_dict</string>
<string>None</string>
<string>response_parameter_dict</string> <string>response_parameter_dict</string>
<string>None</string>
<string>_getitem_</string> <string>_getitem_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -59,17 +59,11 @@ if order_parameter_dict is None:\n ...@@ -59,17 +59,11 @@ if order_parameter_dict is None:\n
\n \n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_product_list = shopping_cart.SaleOrder_getShoppingCartItemList()\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 shopping_cart_price = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice())\n
taxes_amount = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) - \\\n taxes_amount = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) - \\\n
float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_shipping=True));\n float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_shipping=True));\n
shipping = context.SaleOrder_getSelectedShippingResource()\n shipping = context.SaleOrder_getSelectedShippingResource()\n
shipping_price = context.restrictedTraverse(shipping).getPrice()\n shipping_price = context.restrictedTraverse(shipping).getPrice()\n
if shipping_price is None:\n
shipping_price = 0\n
customer = context.SaleOrder_getShoppingCartCustomer()\n customer = context.SaleOrder_getShoppingCartCustomer()\n
site_url = context.getWebSiteValue().absolute_url()\n site_url = context.getWebSiteValue().absolute_url()\n
\n \n
...@@ -140,7 +134,6 @@ return order_parameter_dict\n ...@@ -140,7 +134,6 @@ return order_parameter_dict\n
<string>None</string> <string>None</string>
<string>shopping_cart</string> <string>shopping_cart</string>
<string>shopping_cart_product_list</string> <string>shopping_cart_product_list</string>
<string>len</string>
<string>float</string> <string>float</string>
<string>shopping_cart_price</string> <string>shopping_cart_price</string>
<string>True</string> <string>True</string>
......
146 147
\ No newline at end of file \ 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