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
1c2e67e4
Commit
1c2e67e4
authored
Mar 14, 2013
by
Rafael Monnerat
Committed by
Xiaowu Zhang
Feb 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Included script for one-click-order
parent
d4c96e60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
3 deletions
+94
-3
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_addToShoppingCart.xml
...portal_skins/erp5_commerce/Resource_addToShoppingCart.xml
+11
-2
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_checkout.xml
...lateItem/portal_skins/erp5_commerce/Resource_checkout.xml
+82
-0
bt5/erp5_commerce/bt/revision
bt5/erp5_commerce/bt/revision
+1
-1
No files found.
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_addToShoppingCart.xml
View file @
1c2e67e4
...
...
@@ -105,13 +105,16 @@ for order_line in shopping_cart_items:\n
if order_line.getResource() == resource.getRelativeUrl():\n
if (not variation or order_line.getVariation() == variation)\\\n
and (not size or order_line.getSize() == size):\n
line_found = True\n
if checkout:\n
# We don\'t update quantities if it is a direct checkout.\n
break\n
new_quantity = int(order_line.getQuantity()) + quantity\n
if new_quantity <= 0:\n
## remove items with zero quantity\n
shopping_cart.manage_delObjects(order_line)\n
else:\n
order_line.setQuantity(new_quantity)\n
line_found=True\n
break\n
\n
if not line_found:\n
...
...
@@ -123,6 +126,12 @@ if not line_found:\n
if size: order_line.setSize(size)\n
order_line.setPrice(context.getPrice(supply_path_type=["Sale Supply Line", "Sale Supply Cell"], context=order_line))\n
\n
if checkout:\n
website = context.getWebSiteValue()\n
if website is not None:\n
return website.cart.Base_redirect("", \n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart.")})\n
\n
if( context.getPortalType() == \'Product\'):\n
context.Base_redirect(\'Resource_viewAsShop\',\n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart."),\n
...
...
@@ -137,7 +146,7 @@ else:\n
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
resource=None, quantity=1, form_id=None
</string>
</value>
<value>
<string>
resource=None, quantity=1, form_id=None
, checkout=False
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_checkout.xml
0 → 100644
View file @
1c2e67e4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
return context.Resource_addToShoppingCart(resource=resource, \n
quantity=quantity, \n
form_id=form_id, \n
checkout=True)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
resource=None, quantity=1, form_id=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Resource_checkout
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Add resource to shopping cart
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_commerce/bt/revision
View file @
1c2e67e4
31
6
31
7
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