Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
4b6572d6
Commit
4b6572d6
authored
Aug 27, 2012
by
Jean-Paul Smets
Committed by
Xiaowu Zhang
Feb 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use shopping cart properties and improve redirect
Also improved comments and docstring including TODO.
parent
0bd9e1cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml
.../portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml
+19
-8
No files found.
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_paymentRedirect.xml
View file @
4b6572d6
...
@@ -50,23 +50,30 @@
...
@@ -50,23 +50,30 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# check if the user is Anonymous, if yes it must be redirected to Registration Dialog\n
<value>
<string>
"""\n
Redirect to relevant payment mode and force if necessary user\n
to register first.\n
"""\n
# check if the user is Anonymous, if yes he/she must be redirected to Registration Dialog\n
# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
request = context.REQUEST\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
translateString = context.Base_translateString\n
\n
\n
if field_my_comment is not None:
\n
shopping_cart = context.SaleOrder_getShoppingCart()
\n
shopping_cart = context.SaleOrder_getShoppingCar
t()\n
field_my_comment = shopping_cart.getCommen
t()\n
shopping_cart.setComment(field_my_comment
)\n
field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode(
)\n
\n
\n
if isAnon:\n
if isAnon:\n
# create first an account for user\n
# create first an account for user\n
web_site = context.getWebSiteValue()\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 create an account to continue. If you already have please login.")\n
web_site.Base_redirect(\'register\', \\\n
from ZTUtils import make_query\n
keep_items={\'portal_status_message\': msg})\n
parameter_string = make_query(field_my_comment=field_my_comment, field_my_payment_mode=field_my_payment_mode)\n
return\n
coming_from_url = \'%s/SaleOrder_paymentRedirect?%s\' % (context.absolute_url(), parameter_string)\n
return web_site.Base_redirect(\'register\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'coming_from_url\': coming_from_url})\n
\n
\n
if field_my_payment_mode is None:\n
if field_my_payment_mode is None:\n
msg = translateString("You must select a payment mode.")\n
msg = translateString("You must select a payment mode.")\n
...
@@ -85,7 +92,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
...
@@ -85,7 +92,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
field_my_comment=None, field_my_payment_mode=None,
**kw
</string>
</value>
<value>
<string>
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
...
@@ -99,6 +106,10 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
...
@@ -99,6 +106,10 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleOrder_paymentRedirect
</string>
</value>
<value>
<string>
SaleOrder_paymentRedirect
</string>
</value>
</item>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Redirect to registration or payment page
</string>
</value>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment