Commit 766405bf authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Xiaowu Zhang

Fix name Convention at Forms

Fix name convention on forms and use login_form instead register section for request the user login.
parent 2427af63
......@@ -60,6 +60,9 @@ request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
\n
# Make sure we save shopping cart informations modified on last minute.\n
context.SaleOrder_editShoppingCart(redirect=False, **kw)\n
\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
field_my_comment = shopping_cart.getComment()\n
field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
......@@ -67,26 +70,26 @@ field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
if isAnon:\n
# create first an account for user\n
web_site = context.getWebSiteValue()\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n
msg = translateString("You need to login or create an account to continue.")\n
from ZTUtils import make_query\n
parameter_string = make_query(field_my_comment=field_my_comment, field_my_payment_mode=field_my_payment_mode)\n
coming_from_url = \'%s/SaleOrder_paymentRedirect?%s\' % (context.absolute_url(), parameter_string)\n
return web_site.Base_redirect(\'register\', \\\n
return web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'coming_from_url\': coming_from_url})\n
\'came_from\': coming_from_url})\n
\n
if field_my_payment_mode is None:\n
if context.SaleOrder_getSelectedShippingResource() is None:\n
msg = translateString("You must select a payment mode.")\n
else:\n
if field_my_payment_mode.lower() == \'credit card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\n
return context.getWebSectionValue().WebSection_viewConfirmCreditCardPayment()\n
elif field_my_payment_mode.lower() == \'paypal\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
return context.getWebSectionValue().WebSection_viewConfirmPayPalPayment()\n
else:\n
msg = translateString("This payment mode is actually not activated, sorry: ${payment_mode}", \n
msg = translateString("This payment mode is currently not activated, sorry: ${payment_mode}", \n
mapping=dict(payment_mode=field_my_payment_mode))\n
\n
context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
context.Base_redirect(\'WebSection_viewShoppingCart\', \\\n
keep_items={\'portal_status_message\': msg})\n
</string> </value>
</item>
......
......@@ -105,7 +105,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewAsWebConfirmCreditCardPayment</string> </value>
<value> <string>WebSection_viewCreditCardPayment</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -103,7 +103,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewAsWebConfirmPayPalPayment</string> </value>
<value> <string>WebSection_viewPayPalPayment</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
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