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
d5351fa9
Commit
d5351fa9
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
Added checkout section
Also improved comments and docstring including TODO.
parent
4b6572d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSite_setupECommerceWebSite.xml
...tal_skins/erp5_commerce/WebSite_setupECommerceWebSite.xml
+35
-7
No files found.
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSite_setupECommerceWebSite.xml
View file @
d5351fa9
...
...
@@ -50,28 +50,48 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
translateString = context.Base_translateString \n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
"""\n
This script initializes an ecommerce web site by creating relevant\n
web sections.\n
\n
It is a destructive script. Make sure you never run it on an \n
existing site.\n
\n
TODO:\n
- add security definitions and workflows (or in bt5)\n
- product module security & commerce workflow\n
- service module security & commerce workflow\n
- currency module security & commerce workflow\n
- anonymous access to person module\n
- anonymous access to Sale Order Module\n
- anonymous access to sale_trade_condition_module\n
"""\n
translateString = context.Base_translateString \n
\n
if (context.getPortalType() != \'Web Site\'):\n
context.Base_redirect(\'\', keep_items={\n
\'portal_status_message\': translateString("You can only launch this script on a web site.", mapping = dict())\n
})\n
\n
# creation the default sections\n
object_id_list = [\'cart\', \'account\', \'register\']\n
# Create default sections (cart, account, register, checkout)\n
# First delete whatever exists\n
object_id_list = [\'cart\', \'account\', \'register\', \'checkout\']\n
for id in object_id_list:\n
if id in context.objectIds():\n
context.manage_delObjects([id])\n
\n
# Then recreate sections with default title\n
cart_section = context.newContent(portal_type=\'Web Section\', title=\'Cart\', id=\'cart\')\n
account_section = context.newContent(portal_type=\'Web Section\', title=\'My account\', id=\'account\')\n
register_section = context.newContent(portal_type=\'Web Section\', title=\'Register\', id=\'register\')\n
checkout_section = context.newContent(portal_type=\'Web Section\', title=\'Checkout\', id=\'checkout\')\n
\n
#
make som
e visible by default\n
#
Some sections should b
e visible by default\n
cart_section.setVisible(True)\n
\n
#
setup site properti
es\n
#
Setup site properties to default valu
es\n
context.setContainerLayout(\'erp5_web_multiflex5_commerce_layout\')\n
context.setLayoutConfigurationFormId(\'WebSection_viewMultiflex5Configuration\')\n
context.setProperty(\'layout_right_column\', True)\n
...
...
@@ -79,16 +99,22 @@ context.setSiteMapSectionParent(True)\n
context.setContentLayout(None)\n
context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n
\n
#
setup default render method
\n
#
Setup default render method for cart section
\n
cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n
cart_section.setProperty(\'ecommerce_default_content\', True)\n
cart_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for account section\n
account_section.setCustomRenderMethodId(\'WebSection_viewCurrentPersonAsWeb\')\n
account_section.setProperty(\'ecommerce_default_content\', True)\n
account_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for registration section\n
register_section.setCustomRenderMethodId(\'WebSite_viewRegistrationDialog\')\n
register_section.setProperty(\'ecommerce_default_content\', True)\n
register_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for checkout section\n
checkout_section.setCustomRenderMethodId(\'SaleOrder_viewConfirmAsWeb\')\n
checkout_section.setProperty(\'ecommerce_default_content\', True)\n
checkout_section.setProperty(\'ecommerce_product_list\', False)\n
...
...
@@ -96,7 +122,9 @@ checkout_section.setProperty(\'ecommerce_product_list\', False)\n
context.Base_redirect(\'\', keep_items={\n
\'portal_status_message\': translateString("Your web site is now an ecommerce plateform.", mapping = dict())\n
})\n
</string>
</value>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</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