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
d61398d1
Commit
d61398d1
authored
Feb 15, 2013
by
Rafael Monnerat
Committed by
Xiaowu Zhang
Feb 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Script Name to follow Conventions
It includes minor improvements.
parent
5483f491
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
36 deletions
+26
-36
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_editShoppingCart.xml
...ortal_skins/erp5_commerce/WebSection_editShoppingCart.xml
+16
-17
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_paymentRedirect.xml
...portal_skins/erp5_commerce/WebSection_paymentRedirect.xml
+3
-3
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart.xml
...5_commerce_widget_library/WebSection_viewShoppingCart.xml
+2
-2
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart/my_payment_mode.xml
...t_library/WebSection_viewShoppingCart/my_payment_mode.xml
+4
-13
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart/submit_payment.xml
...et_library/WebSection_viewShoppingCart/submit_payment.xml
+1
-1
No files found.
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/
SaleOrder
_editShoppingCart.xml
→
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/
WebSection
_editShoppingCart.xml
View file @
d61398d1
...
...
@@ -200,7 +200,7 @@
request = context.REQUEST\n
translateString = context.Base_translateString \n
if field_my_buy_quantity is None:\n
field_my_buy_quantity
=
context.REQUEST.get("field_my_buy_quantity", None)\n
field_my_buy_quantity
=
context.REQUEST.get("field_my_buy_quantity", None)\n
\n
if field_my_shipping_method is None:\n
field_my_shipping_method=context.REQUEST.get("field_my_shipping_method", None) \n
...
...
@@ -209,11 +209,9 @@ if field_my_payment_mode is None:\n
field_my_payment_mode = context.REQUEST.get("field_my_payment_mode", None) \n
\n
quantity = field_my_buy_quantity\n
shipping_method = field_my_shipping_method\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_product_item_list = context.SaleOrder_getShoppingCartItemList()\n
\n
# Handle change in quantity for shopping items\n
if quantity is not None:\n
...
...
@@ -223,7 +221,7 @@ if quantity is not None:\n
quantity = [quantity]\n
\n
counter = 0\n
for order_line in shopping_cart_product
s_items
:\n
for order_line in shopping_cart_product
_item_list
:\n
new_quantity = int(quantity[counter])\n
if new_quantity>
=1:\n
order_line.setQuantity(new_quantity)\n
...
...
@@ -233,23 +231,24 @@ if quantity is not None:\n
counter += 1\n
\n
# Handle shipping\n
order_line = getattr(shopping_cart, \'shipping_method\', None)
\n
if shipping_method not in [\'\', None]:
\n
shipping = context.getPortalObject().restrictedTraverse(shipping_method)
\n
if order_line is not None:
\n
shopping_cart.manage_delObjects(order_line.getId()
)\n
if field_my_shipping_method not in [\'\', None]:
\n
line = getattr(shopping_cart, \'shipping_method\', None)
\n
if line is not None:
\n
shopping_cart.manage_delObjects(line.getId())
\n
shipping = context.getPortalObject().restrictedTraverse(field_my_shipping_method
)\n
# create new shipping method order line\n
order_line = shopping_cart.newContent(id=\'shipping_method\', portal_type=\'Sale Order Line\')\n
# .. and update it\n
order_line.setResource(shipping.getRelativeUrl())\n
order_line.setQuantity(1)\n
shopping_cart.newContent(\n
id=\'shipping_method\', \n
portal_type=\'Sale Order Line\', \n
resource_value=shipping, \n
quantity=1)\n
\n
# Handle payment mode and comment\n
if field_my_comment is not None:\n
shopping_cart.setComment(field_my_comment)\n
\n
if field_my_payment_mode is not None:\n
shopping_cart.setPaymentConditionPaymentMode(field_my_payment_mode)
# XXX This is bad because it does not use trade conditions XXX
\n
shopping_cart.setPaymentConditionPaymentMode(field_my_payment_mode)\n
\n
if redirect:\n
# Hardcode redirection.\n
...
...
@@ -274,7 +273,7 @@ if redirect:\n
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleOrder
_editShoppingCart
</string>
</value>
<value>
<string>
WebSection
_editShoppingCart
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/
SaleOrder
_paymentRedirect.xml
→
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/
WebSection
_paymentRedirect.xml
View file @
d61398d1
...
...
@@ -61,7 +61,7 @@ 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
context.
WebSection
_editShoppingCart(redirect=False, **kw)\n
\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
field_my_comment = shopping_cart.getComment()\n
...
...
@@ -73,7 +73,7 @@ if isAnon:\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
coming_from_url = \'%s/
WebSection
_paymentRedirect?%s\' % (context.absolute_url(), parameter_string)\n
return web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'came_from\': coming_from_url})\n
...
...
@@ -107,7 +107,7 @@ context.Base_redirect(\'WebSection_viewShoppingCart\', \\\n
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleOrder
_paymentRedirect
</string>
</value>
<value>
<string>
WebSection
_paymentRedirect
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart.xml
View file @
d61398d1
...
...
@@ -35,7 +35,7 @@
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
SaleOrder
_editShoppingCart
</string>
</value>
<value>
<string>
WebSection
_editShoppingCart
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
...
...
@@ -139,7 +139,7 @@
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
Product_view
</string>
</value>
<value>
<string>
WebSection_viewShoppingCart
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
...
...
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart/my_payment_mode.xml
View file @
d61398d1
...
...
@@ -134,26 +134,20 @@
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
<tuple/>
</tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: here.
getWebSiteValue().
SaleOrder_getShoppingCart().getPaymentConditionPaymentMode()
</string>
</value>
<value>
<string>
python: here.SaleOrder_getShoppingCart().getPaymentConditionPaymentMode()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
<tuple/>
</tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
...
...
@@ -166,10 +160,7 @@
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
<tuple/>
</tuple>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
...
...
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_viewShoppingCart/submit_payment.xml
View file @
d61398d1
...
...
@@ -164,7 +164,7 @@
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
SaleOrder
_paymentRedirect:method
</string>
</value>
<value>
<string>
WebSection
_paymentRedirect:method
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
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