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
b7fd20df
Commit
b7fd20df
authored
Sep 28, 2022
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_advanced_ecommerce: improvements
support promotional code display nicely
parent
010d4a6b
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
995 additions
and
36 deletions
+995
-36
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop.xml
...e/PathTemplateItem/portal_categories/base_amount/shop.xml
+117
-0
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop/discounted.xml
...ateItem/portal_categories/base_amount/shop/discounted.xml
+117
-0
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop/discounted/coupon.xml
.../portal_categories/base_amount/shop/discounted/coupon.xml
+77
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Product_getAdditionalService.zpt
.../erp5_advanced_ecommerce/Product_getAdditionalService.zpt
+2
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Product_getSaleSupplyLine.py
...kins/erp5_advanced_ecommerce/Product_getSaleSupplyLine.py
+21
-6
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
...ins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
+30
-16
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getProductDecoratedPriceAsHTML.py
...nced_ecommerce/Resource_getProductDecoratedPriceAsHTML.py
+1
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getShopPrice.py
...al_skins/erp5_advanced_ecommerce/Resource_getShopPrice.py
+8
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_viewAsShop.xml
...tal_skins/erp5_advanced_ecommerce/Resource_viewAsShop.xml
+1
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_viewAsShop/your_promotional_code.xml
...d_ecommerce/Resource_viewAsShop/your_promotional_code.xml
+287
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getAvailableShippingResourceList.py
...d_ecommerce/SaleOrder_getAvailableShippingResourceList.py
+19
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getAvailableShippingResourceList.xml
..._ecommerce/SaleOrder_getAvailableShippingResourceList.xml
+211
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalDiscount.py
...ins/erp5_advanced_ecommerce/SaleOrder_getTotalDiscount.py
+1
-5
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_getPromotionalCodeTrade.py
..._advanced_ecommerce/WebSection_getPromotionalCodeTrade.py
+12
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_getPromotionalCodeTrade.xml
...advanced_ecommerce/WebSection_getPromotionalCodeTrade.xml
+70
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_updateShoppingCartTradeCondition.py
..._ecommerce/WebSection_updateShoppingCartTradeCondition.py
+9
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_updateShoppingCartTradeCondition.xml
...ecommerce/WebSection_updateShoppingCartTradeCondition.xml
+1
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_web.css.css
...ns/erp5_advanced_ecommerce/advanced_ecommerce_web.css.css
+1
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/product_view.zpt
...tem/portal_skins/erp5_advanced_ecommerce/product_view.zpt
+8
-4
bt5/erp5_advanced_ecommerce/bt/template_path_list
bt5/erp5_advanced_ecommerce/bt/template_path_list
+2
-0
No files found.
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop.xml
0 → 100644
View file @
b7fd20df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
shop
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Shop
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop/discounted.xml
0 → 100644
View file @
b7fd20df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
discounted
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Discounted
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/PathTemplateItem/portal_categories/base_amount/shop/discounted/coupon.xml
0 → 100644
View file @
b7fd20df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
coupon
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Coupon
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Product_getAdditionalService.zpt
View file @
b7fd20df
...
...
@@ -3,11 +3,12 @@
minimal_quantity python: getattr(supply_line, 'additional_service_min_quantity', None);
">
<tal:block tal:condition="python: additional_service is not None">
<label tal:content='python: additional_service.getDescription()'></label>
<label tal:content='python: additional_service.get
Translated
Description()'></label>
<div class="input" style="display: inline-block;">
<input name="field_your_additional_service_quantity"
tal:attributes='min python: minimal_quantity;
value python: minimal_quantity;'>
<p style="display: inline;" tal:content='python: additional_service.getQuantityUnitTranslatedTitle()'></p>
</div>
</tal:block>
</tal:block>
\ No newline at end of file
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Product_getSaleSupplyLine.py
View file @
b7fd20df
price_currency_value
=
context
.
getWebSiteValue
().
WebSite_getShoppingCartDefaultCurrency
()
return
context
.
portal_catalog
(
portal_type
=
'Sale Supply Line'
,
resource_relative_url
=
context
.
getRelativeUrl
(),
price_currency_relative_url
=
price_currency_value
.
getRelativeUrl
(),
limit
=
1
)[
0
]
web_site
=
context
.
REQUEST
.
get
(
'current_web_site'
,
context
.
getWebSiteValue
())
price_currency_value
=
web_site
.
WebSite_getShoppingCartDefaultCurrency
()
variation
=
context
.
REQUEST
.
get
(
'variation'
,
None
)
if
not
variation
or
(
context
.
getRelativeUrl
()
not
in
variation
):
result
=
context
.
portal_catalog
(
portal_type
=
'Sale Supply Line'
,
resource_relative_url
=
context
.
getRelativeUrl
(),
price_currency_relative_url
=
price_currency_value
.
getRelativeUrl
(),
limit
=
1
)
else
:
result
=
context
.
portal_catalog
(
portal_type
=
'Sale Supply Cell'
,
variation_relative_url
=
variation
,
resource_relative_url
=
context
.
getRelativeUrl
(),
price_currency_relative_url
=
price_currency_value
.
getRelativeUrl
(),
limit
=
1
)
if
result
:
return
result
[
0
]
return
None
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
View file @
b7fd20df
...
...
@@ -30,6 +30,28 @@ if form_id is not None:
return
form
(
request
)
session_id
=
request
.
get
(
'session_id'
,
None
)
promotional_code
=
request
.
get
(
'field_your_promotional_code'
,
None
)
# get category like size and variation
category
=
request
.
form
.
get
(
'field_variation_box_your_category'
,
''
)
if
category
:
[
base_category
,
category
]
=
category
.
split
(
'/'
,
1
)
variation
=
request
.
form
.
get
(
'field_variation_box_your_variation'
,
None
)
keep_items
=
{}
if
variation
:
keep_items
[
'variation'
]
=
variation
if
context
.
getPortalType
()
==
'Product'
:
redirect_view
=
"Resource_viewAsShop"
else
:
redirect_view
=
"view"
if
promotional_code
:
sale_trade_condition
=
context
.
WebSection_getPromotionalCodeTrade
(
promotional_code
)
if
not
sale_trade_condition
:
keep_items
[
'portal_status_message'
]
=
context
.
Base_translateString
(
"Invalide Promotional Code."
)
return
context
.
Base_redirect
(
redirect_view
,
keep_items
=
keep_items
)
if
session_id
in
[
None
,
''
]:
# Rely on cookies information
session_id
=
request
.
cookies
.
get
(
'session_id'
,
None
)
...
...
@@ -39,17 +61,13 @@ if session_id in [None, '']:
now
=
DateTime
()
session_id
=
context
.
Base_generateSessionID
(
max_long
=
20
)
expire_timeout_days
=
90
request
.
RESPONSE
.
setCookie
(
'session_id'
,
session_id
,
request
.
RESPONSE
.
setCookie
(
'session_id'
,
session_id
,
expires
=
(
now
+
expire_timeout_days
).
rfc822
(),
path
=
'/'
)
request
.
set
(
'session_id'
,
session_id
)
shopping_cart
=
context
.
SaleOrder_getShoppingCart
()
shopping_cart_items
=
context
.
SaleOrder_getShoppingCartItemList
()
# get category like size and variation
category
=
request
.
form
.
get
(
'field_variation_box_your_category'
,
''
)
if
category
:
[
base_category
,
category
]
=
category
.
split
(
'/'
,
1
)
variation
=
request
.
form
.
get
(
'field_variation_box_your_variation'
,
None
)
## check if we don't have already such a resource in cart
line_found
=
False
for
order_line
in
shopping_cart_items
:
...
...
@@ -102,7 +120,8 @@ if not line_found:
# set aggregate so we know it's who's additional service
additional_order_line
.
setAggregate
(
variation
or
context
.
getRelativeUrl
())
context
.
WebSection_updateShoppingCartTradeCondition
(
shopping_cart
,
None
)
shopping_cart
.
edit
(
promotional_code
=
promotional_code
)
context
.
WebSection_updateShoppingCartTradeCondition
(
shopping_cart
,
None
,
promotional_code
=
promotional_code
)
context
.
getPortalObject
().
portal_sessions
[
session_id
].
update
(
shopping_cart
=
shopping_cart
)
if
checkout
:
...
...
@@ -111,13 +130,8 @@ if checkout:
return
website
.
cart
.
Base_redirect
(
""
,
keep_items
=
{
'portal_status_message'
:
context
.
Base_translateString
(
"Added to cart."
)})
keep_items
=
{
'portal_status_message'
:
context
.
Base_translateString
(
"Added to cart."
)}
if
variation
:
keep_items
[
'variation'
]
=
variation
if
(
context
.
getPortalType
()
==
'Product'
):
context
.
Base_redirect
(
'Resource_viewAsShop'
,
keep_items
=
keep_items
)
else
:
context
.
Base_redirect
(
'view'
,
keep_items
[
'portal_status_message'
]
=
context
.
Base_translateString
(
"Added to cart."
)
context
.
Base_redirect
(
redirect_view
,
keep_items
=
keep_items
)
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getProductDecoratedPriceAsHTML.py
View file @
b7fd20df
...
...
@@ -20,7 +20,7 @@ if currency == 'EUR':
elif
currency
==
'CNY'
:
currency
=
'¥'
output
=
"""%s<br /><br />"""
%
(
title
.
upper
()
,)
output
=
"""%s<br /><br />"""
%
(
title
,)
#if old_price is not None and price != old_price:
# output += """<span class="new_price">%s %s</span>""" % (price, currency)
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getShopPrice.py
View file @
b7fd20df
supply
=
context
.
Product_getSaleSupplyLine
()
if
supply
:
return
getattr
(
supply
,
'base_price'
)
return
None
"""
#this search all supply, too slow
return context.getPrice(supply_path_type=["Sale Supply Line", "Sale Supply Cell"],
context=context.Resource_getPriceCalculationDefaultContext())
"""
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_viewAsShop.xml
View file @
b7fd20df
...
...
@@ -108,6 +108,7 @@
<string>
my_price
</string>
<string>
my_old_price
</string>
<string>
your_additional_service
</string>
<string>
your_promotional_code
</string>
</list>
</value>
</item>
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_viewAsShop/your_promotional_code.xml
0 → 100644
View file @
b7fd20df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"StringField"
module=
"Products.Formulator.StandardFields"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_promotional_code
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
<item>
<key>
<string>
required_not_found
</string>
</key>
<value>
<string>
Input is required but no input given.
</string>
</value>
</item>
<item>
<key>
<string>
too_long
</string>
</key>
<value>
<string>
Too much input was given.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_maxwidth
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
40
</int>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string>
text
</string>
</value>
</item>
<item>
<key>
<string>
max_length
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Promotional Code
</string>
</value>
</item>
<item>
<key>
<string>
truncate
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
unicode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
whitespace_preserve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: getattr(here.SaleOrder_getShoppingCart(), \'promotional_code\', \'\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getAvailableShippingResourceList.py
0 → 100644
View file @
b7fd20df
"""
This will return all Products that have set product_line='shipping'. XXX
Such products are used for shipping purposes i.e. they can not be sold.
"""
portal
=
context
.
getPortalObject
()
only_small_product
=
False
if
only_small_product
:
shipping_product_line_category_uid
=
portal
.
portal_categories
.
product_line
.
shipping
.
ship_small_product
.
getUid
()
else
:
shipping_product_line_category_uid
=
[
x
.
getUid
()
for
x
in
portal
.
portal_categories
.
product_line
.
shipping
.
contentValues
()
if
x
.
getId
()
!=
'ship_small_product'
]
return
[
r
.
getObject
()
for
r
in
portal
.
portal_catalog
(
limit
=
10
,
product_line_uid
=
shipping_product_line_category_uid
,
portal_type
=
portal
.
getPortalResourceTypeList
())]
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getAvailableShippingResourceList.xml
0 → 100644
View file @
b7fd20df
<?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>
_Change_Python_Scripts_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Change_bindings_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Change_cache_settings_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Change_permissions_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Change_proxy_roles_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Manage_WebDAV_Locks_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Manage_properties_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Take_ownership_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_Undo_changes_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_View_History_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_View_management_screens_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_WebDAV_Lock_items_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_WebDAV_Unlock_items_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</value>
</item>
<item>
<key>
<string>
_WebDAV_access_Permission
</string>
</key>
<value>
<list>
<string>
Manager
</string>
</list>
</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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleOrder_getAvailableShippingResourceList
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Get list of available shipping methods
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalDiscount.py
View file @
b7fd20df
return
0
"""
return round(sum([i.getTotalPrice() for i in context.getAggregatedAmountList(rounding=True)
if "base_amount/loyalty_program/discount" in i.getBaseApplicationList() or "base_amount/loyalty_program/coupon" in i.getBaseApplicationList()]), 2)
"""
return
round
(
sum
([
i
.
getTotalPrice
()
for
i
in
context
.
getAggregatedAmountList
(
rounding
=
True
)
if
"base_amount/shop/discounted/coupon"
in
i
.
getBaseApplicationList
()]),
2
)
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_getPromotionalCodeTrade.py
0 → 100644
View file @
b7fd20df
if
promotional_code
:
trade_condition_reference
=
"%s-%s"
%
(
context
.
restrictedTraverse
(
context
.
WebSection_getDefaultTradeCondition
()).
getReference
(),
promotional_code
)
sale_trade_condition
=
context
.
portal_catalog
(
portal_type
=
'Sale Trade Condition'
,
reference
=
trade_condition_reference
,
validation_state
=
(
'published'
,
'validated'
),
limit
=
1
,
sort_on
=
((
'version'
,
'descending'
),))
if
sale_trade_condition
:
return
sale_trade_condition
[
0
]
return
None
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_getPromotionalCodeTrade.xml
0 → 100644
View file @
b7fd20df
<?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>
_params
</string>
</key>
<value>
<string>
promotional_code
</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>
WebSection_getPromotionalCodeTrade
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_updateShoppingCartTradeCondition.py
View file @
b7fd20df
"""
Update Trade Condition with the appropriated Trade Condition.
"""
shopping_cart
.
setSpecialise
(
context
.
WebSection_getDefaultTradeCondition
())
if
promotional_code
:
trade_condition
=
context
.
WebSection_getPromotionalCodeTrade
(
promotional_code
)
if
trade_condition
:
shopping_cart
.
setSpecialiseValue
(
trade_condition
)
else
:
if
not
shopping_cart
.
getSpecialise
():
shopping_cart
.
setSpecialise
(
context
.
WebSection_getDefaultTradeCondition
())
portal
=
context
.
getPortalObject
()
portal
.
portal_sessions
[
container
.
REQUEST
[
'session_id'
]].
update
(
shopping_cart
=
shopping_cart
)
return
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_updateShoppingCartTradeCondition.xml
View file @
b7fd20df
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
shopping_cart, payment_mode, preserve=False
</string>
</value>
<value>
<string>
shopping_cart, payment_mode, pr
omotional_code=None, pr
eserve=False
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_web.css.css
View file @
b7fd20df
...
...
@@ -363,7 +363,7 @@ border:1px solid #000;
.cyan
{
background
:
#00FFFF
}
.choice_box
{
margin-left
:
20px
;
margin-top
:
30px
;}
.choice_box
input
[
type
=
"text"
]
{
width
:
30px
;
.choice_box
input
[
type
=
"text"
]
{
border
:
1px
solid
#000
;
height
:
17px
;
padding
:
2px
;}
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/product_view.zpt
View file @
b7fd20df
...
...
@@ -89,7 +89,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</tal:block-->
<div class="clear"></div>
<div class="choice_box">
<tal:block tal:define="field nocall:form/your_additional_service">
<tal:block metal:use-macro="field_render" />
</tal:block>
<br>
<tal:block tal:define="field nocall:form/your_promotional_code">
<tal:block metal:use-macro="field_render" />
</tal:block>
<br>
<tal:block tal:define="field nocall:form/variation_box">
<tal:block metal:use-macro="field_render" />
</tal:block>
...
...
@@ -98,9 +105,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<br/>
<!--tal:block tal:define="is_unavailable python: here.Resource_getInventoryStatus(request.get('variation', None)) == 'UNAVAILABLE'"-->
<tal:block tal:define="field nocall:form/your_additional_service">
<tal:block metal:use-macro="field_render" />
</tal:block>
<tal:block tal:define="field nocall:form/your_buy_quantity">
<tal:block metal:use-macro="field_render" />
...
...
bt5/erp5_advanced_ecommerce/bt/template_path_list
View file @
b7fd20df
portal_categories/base_amount/shop
portal_categories/base_amount/shop/**
portal_categories/role/client/shop
\ No newline at end of file
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