Commit f41075e5 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_advanced_ecommerce: custom improvement

1. add brand
2. facebook like button, twitter share
3. display correct currency symbole
4. product is always available: user can purchase then we order from customer
5. change cache policy
parent c563b6a2
......@@ -182,7 +182,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: request.get("login_come_from_url") is not None and "Save and Return" or "Save"</string> </value>
<value> <string>python: here.Base_translateString(request.get("login_come_from_url") is not None and "Save and Return" or "Save")</string> </value>
</item>
</dictionary>
</pickle>
......
from ZTUtils import make_query
like_url = "https://www.facebook.com/plugins/like.php"
query = make_query({"href" : context.absolute_url(),
"send" : "false",
"layout":"button_count",
"width":"450",
"show_faces":"false",
"colorscheme":"light",
"action":"like",
"height":"21",
"appId":"3304473559563683",
})
return like_url + "?" + query
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_getFacebookLikeURL</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -32,9 +32,11 @@ current_inventory = context.portal_simulation.getCurrentInventory(**kw)
if current_inventory > 0:
return "STOCK"
return 'AVAILABLE'
"""
future_inventory = context.portal_simulation.getFutureInventory(**kw)
if future_inventory > 0:
return "AVAILABLE"
return "UNAVAILABLE"
"""
......@@ -14,6 +14,8 @@ currency = here.WebSite_getShoppingCartDefaultCurrencyCode()
title = cell.getTitle()
if currency == 'EUR':
currency = '&euro;'
elif currency == 'CNY':
currency = '¥'
output = """%s<br /><br />""" % (title.upper(),)
......
......@@ -101,8 +101,10 @@
<string>default_image</string>
<string>my_default_image_absolute_url</string>
<string>my_title</string>
<string>my_brand_title</string>
<string>inventory_status</string>
<string>variation_box</string>
<string>social_box</string>
<string>my_price</string>
<string>my_old_price</string>
</list>
......
......@@ -281,7 +281,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: "%.2f €" % here.getDefaultSaleSupplyLineBasePrice()</string> </value>
<value> <string>python: "%.2f %s" % (here.getDefaultSaleSupplyLineBasePrice(), \'¥\' if here.WebSite_getShoppingCartDefaultCurrencyCode() == \'CNY\' else \'€\')</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -279,7 +279,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: "%.2f €" % here.Resource_getShopPrice()</string> </value>
<value> <string>python: "%.2f %s" % (here.Resource_getShopPrice(), \'¥\' if here.WebSite_getShoppingCartDefaultCurrencyCode() == \'CNY\' else \'€\')</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_viewSocialBox</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<div class="social_box">
<div class="facebook_box">
<iframe tal:attributes="src here/Resource_getFacebookLikeURL"
scrolling="no" frameborder="0" allowTransparency="true"
style="border:none; overflow:hidden; width:90px; height:21px;"> </iframe>
</div>
<div class="tweet_box">
<a href="https://twitter.com/share" class="twitter-share-button"
tal:attributes="data-url here/absolute_url" i18n:translate="" i18n:domain="ui">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
\ No newline at end of file
......@@ -46,11 +46,11 @@
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>iso-8859-15</string> </value>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Default Template</unicode> </value>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -63,7 +63,7 @@
<div id="main">
<div class="logo">
<div class="logo_content">
<a href="#" title="Zawee: pr&#234;t-&#224;-port&#233; &amp; accessoires" tal:attributes="href portal_path">
<a href="#" title="Rapid.Space" tal:attributes="href portal_path">
<img src="images/logo.jpg" height="100" border="0"
tal:attributes="src string:${portal_path}/${logo}?format"></a>
</div>
......@@ -167,6 +167,9 @@
</div>
</div>
<div id="footer">
<tal:block tal:condition='python: here.Localizer.get_selected_language() == "zh"'>
<p>© 2020 - ViFiB.com <a href="http://www.miibeian.gov.cn/" >晋ICP备19010409号</a></p>
</tal:block>
</div>
</tal:block>
......
......@@ -1205,6 +1205,13 @@ div.unavailable_stock {
padding: 20px;
}
div.social_box div {
float: left;
margin-right: 3px;
width: 90px;
}
a.lang_icon_en:before {
content: url(advanced_ecommerce_image/icon_lang_en.png);
padding-right: 3px;
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>advanced_ecommerce_web.css</string> </value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>advanced_ecommerce_web.js</string> </value>
......
......@@ -49,6 +49,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</div>
</div>
<div class="detail_right">
<span class="product_title">
<tal:block tal:define="field nocall:form/my_brand_title">
<tal:block metal:use-macro="field_render" />
</tal:block>
</span>
<div class="product_from">
<tal:block tal:define="field nocall:form/my_title">
<tal:block metal:use-macro="field_render" />
......@@ -109,6 +114,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</div>
</tal:block>
<div class="clear"></div>
<tal:block tal:define="field nocall:form/social_box">
<tal:block metal:use-macro="field_render" />
</tal:block>
<div class="clear"></div>
<br/>
......@@ -116,10 +126,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<div id="tabs">
<div class="tab_header">
<ul>
<li><a href="#tabs-1">Description</a></li>
<li><a href="#tabs-2">Delivery</a></li>
<li><a href="#tabs-3">Return</a></li>
<li><a href="#tabs-4" class="last">Payment</a></li>
<li><a href="#tabs-1" i18n:translate="" i18n:domain="ui" >Description</a></li>
<li><a href="#tabs-2" i18n:translate="" i18n:domain="ui" >Delivery</a></li>
<li><a href="#tabs-3" i18n:translate="" i18n:domain="ui" >Return</a></li>
<li><a href="#tabs-4" i18n:translate="" i18n:domain="ui" class="last">Payment</a></li>
</ul>
<div class="clear"></div>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment