[Erp5-report] r29041 - /erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_com...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 14 22:24:36 CEST 2009


Author: lucas
Date: Mon Sep 14 22:24:35 2009
New Revision: 29041

URL: http://svn.erp5.org?rev=29041&view=rev
Log:
Check if the user is Anonymous before to proceed with the purchase.

Modified:
    erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml

Modified: erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml?rev=29041&r1=29040&r2=29041&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml [utf8] Mon Sep 14 22:24:35 2009
@@ -53,8 +53,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string># redirect the user to the good payment form\n
+            <value> <string># check if the user is Anonymous, if yes it must be redirected to Registration Dialog\n
+# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
+request = context.REQUEST\n
+isAnon = context.portal_membership.isAnonymousUser()\n
 translateString = context.Base_translateString\n
+\n
+if isAnon:\n
+  # create first an account for user\n
+  msg = translateString("You need to create an account to continue. If you already have please login.")\n
+  context.Base_redirect(\'WebSite_viewRegistrationDialog\', \\\n
+                      keep_items={\'editable_mode\': 0,\n
+                                  \'portal_status_message\': msg})\n
+  return\n
 \n
 if field_my_payment_mode is None:\n
   msg = translateString("You must select a payment mode.")\n
@@ -81,6 +92,12 @@
         <item>
             <key> <string>_params</string> </key>
             <value> <string>field_my_payment_mode=None, **kw</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple/>
+            </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -110,9 +127,11 @@
                             <string>kw</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>request</string>
+                            <string>isAnon</string>
                             <string>translateString</string>
+                            <string>msg</string>
                             <string>None</string>
-                            <string>msg</string>
                             <string>dict</string>
                           </tuple>
                         </value>




More information about the Erp5-report mailing list