Commit d2d55f54 authored by Jean-Paul Smets's avatar Jean-Paul Smets Committed by Xiaowu Zhang

erp5_commerce_related

parent b928e3e4
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrderModule_viewAsWebSaleOrderList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and object.isWebMode() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrder_viewDetailAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and object.isWebMode() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -7,4 +7,12 @@
<type>Product</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain>
<chain>
<type>Sale Trade Condition</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain>
<chain>
<type>Service</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
......@@ -51,7 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Generate random id which is generally used as a session ID.\n
Generate random ID which is generally used as a session ID\n
"""\n
from random import choice\n
import string\n
......
......@@ -50,13 +50,24 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Only save basic personal information for an ecommerce website\n
<value> <string>"""\n
Edit the personal information of a client through specific form\n
which takes into account only basic personal information \n
\n
TODO:\n
- handle form validation errors after the call to\n
Base_edit (not the case currently)\n
\n
BUG:\n
- make sure personal address can be updated from\n
account page (no the case currently)\n
"""\n
translateString = context.Base_translateString \n
\n
context.Base_edit(form_id=\'Person_viewAsWeb\')\n
\n
context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_url(), \\\n
keep_items={\'portal_status_message\': translateString("Your personal informations are updated.", mapping = dict())})\n
keep_items={\'portal_status_message\': translateString("Your personal informations are now updated.", mapping = dict())})\n
</string> </value>
</item>
<item>
......@@ -67,6 +78,10 @@ context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_ur
<key> <string>id</string> </key>
<value> <string>Person_editPersonalInformation</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit customer information</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -187,11 +187,10 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script is a sceleton for implementing discounts per customer basis.\n
This script is a skeleton for implementing discounts per customer basis.\n
Because it\'s specific for every shop it needs to be implemented accordingly. \n
See also SaleOrder_viewDiscountRenderer. \n
See also SaleOrder_viewDiscountRenderer.\n
"""\n
\n
return None\n
</string> </value>
</item>
......
......@@ -187,16 +187,28 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script will find applicable taxes for customer based on his/hers location.\n
This script will find applicable taxes for customer based on his/her location.\n
For example.\n
- B2B in EU in same country, tax \n
- B2B in EU in different country, no tax \n
- B2B and B2P from EU to outside EU, no tax \n
- B2P in EU, tax\n
- B2B in EU in same country, VAT applicable \n
- B2B in EU in different country, no VAT applicable \n
- B2B and B2C from EU to outside EU, no VAT applicable\n
- B2C in EU, VAT applicable\n
\n
TODO:\n
- use same keys as in ERP5 propertysheets (ex. ratio instead of percent)\n
- should become Resource_getApplicableTaxList and use the tax generation\n
model of ERP5 instead of ad-hoc one, maybe with some optimizations for\n
high performance price display. There is no reason to handle price\n
and tax in a different way.\n
\n
BUG:\n
- some shops are "tax inclusive" which is not currently possible and\n
prevents B2C ecommerce. Tax inclusive requires business model\n
requires a different kind of simulation rules and trade models.\n
"""\n
\n
return {\'VAT\': {\'translated_title\':context.Base_translateString(\'VAT\'),\n
\'percent\': 20.,\n
\'percent\': 19.6,\n
},\n
}\n
</string> </value>
......
......@@ -50,16 +50,32 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
<value> <string>"""\n
Tries to find a Web Page related to the current Product\n
with publication section set to "website/product/short_description"\n
\n
#get cached description\n
# TODO\n
This short description made of HTML can be used to provide\n
a better description than the one provided by default on\n
the product.\n
\n
#get live description\n
TODO:\n
- use cache for description\n
- remove hardcoding by using site properties\n
- make sure we can include javascript in HTML\n
of web pages (a generic requirement which will lead\n
to changes in ERP5 TextDocument class)\n
- Rename to Resource_... since this script also\n
applied to services\n
- Handle language and version selection, possibily predicate\n
just like WebSection\n
- rename to use asHTML terminology\n
"""\n
portal = context.getPortalObject()\n
\n
# Find a related web page with appropriate publication_section\n
web_page = portal.portal_catalog(portal_type=\'Web Page\',\n
default_follow_up_uid=context.getUid(),\n
default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(),\n
#src__=1,\n
default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(), # XXX Bad hardcoding\n
)\n
if web_page is None or len(web_page) == 0:\n
return context.Base_translateString("No more information for this product.")\n
......@@ -74,6 +90,10 @@ return web_page[0].getObject().asStrippedHTML()\n
<key> <string>id</string> </key>
<value> <string>Product_getRelatedDescription</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get product description</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -54,6 +54,14 @@
"""\n
Add resource to shopping cart.\n
\n
TODO:\n
- support generic variations beyond size and variation\n
(through introspection of resource) also in\n
SaleOrder_viewShoppingCartRenderer and\n
SaleOrder_viewShoppingCartWidgetRenderer\n
- implement form validation and parameter retrieval using Base_edit\n
- Resource_viewAsShop should be select through portal types\n
"""\n
request = container.REQUEST\n
if resource is None:\n
......@@ -64,7 +72,7 @@ if form_id is not None:\n
form = getattr(context, form_id, None)\n
quantity = int(request.get(\'field_your_buy_quantity\'))\n
# FIXME:\n
# this handling of validation errors should be automatically handled by the \n
# this handling of validation errors should be automatically handled by the\n
# button itself\n
try:\n
params = form.validate_all_to_request(request)\n
......@@ -84,31 +92,45 @@ if form_id is not None:\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
\n
# Add-hoc access to parameters (use instead Base_edit)\n
# and quick dirty hack\n
# XXX - This must be rewritten to support any variation dimensions\n
# (not only size and variation)\n
size = request.form.get(\'field_variation_box_your_size\', \'\')\n
variation = request.form.get(\'field_variation_box_your_variation\', None)\n
\n
## check if we don\'t have already such a resource in cart\n
line_found=False\n
for order_line in shopping_cart_items:\n
if order_line.getResource() == resource.getRelativeUrl():\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
if (not variation or order_line.getVariation() == variation)\\\n
and (not size or order_line.getSize() == size):\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 line_found == False:\n
if not line_found:\n
## new Resource so add it to shopping cart\n
order_line = shopping_cart.newContent(portal_type=\'Sale Order Line\')\n
order_line.setResource(resource.getRelativeUrl())\n
order_line.setQuantity(quantity)\n
if variation: order_line.setVariation(variation)\n
if size: order_line.setSize(size)\n
order_line.setPrice(context.getPrice(context=order_line))\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
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart."),\n
\'variation\':variation})\n
else:\n
context.Base_redirect(\'view\',\n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart.")})\n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart."),\n
\'variation\':variation})\n
]]></string> </value>
......
<?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>"""\n
Create a temporary movement with properties and categories\n
needed to provide a default price for a given resource\n
\n
TODO:\n
- add support to input parameters (**kw) so that it\n
is possible specialize price calculation\n
"""\n
from Products.ERP5Type.Document import newTempMovement\n
\n
# Try to find out the current web site\n
web_site_value = context.REQUEST.get(\'current_web_site\', None)\n
if web_site_value is None:\n
web_site_value = context.getWebSiteValue() \n
if web_site_value is None:\n
raise ValueError("Could not determine the current web site to compute default currency of price")\n
\n
# If this resource is variated, initialize the default\n
# variation context\n
variation_dict = {}\n
if len(context.getVariationRangeCategoryList()):\n
request = context.REQUEST\n
# Set each category of variation either to the default value\n
# or to the value provided by the REQUEST object\n
for variation_base_category in context.getVariationBaseCategoryList():\n
default_variation = context.getVariationCategoryList(base_category_list=[variation_base_category])\n
# circumvent inconsistency for individual variations\n
default_variation = default_variation or \\\n
context.getVariationRangeCategoryList(base_category_list=[variation_base_category])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
variation_category = request.get(variation_base_category, default_variation)\n
variation_dict[variation_base_category] = variation_category\n
\n
movement = newTempMovement(context, "temp_pricing_movement", resource_value=context,\n
price_currency_value=web_site_value.WebSite_getShoppingCartDefaultCurrency(),\n
**variation_dict)\n
return movement\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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_getPriceCalculationDefaultContext</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Build movement context to compute price</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -188,8 +188,11 @@
<key> <string>_body</string> </key>
<value> <string>"""\n
Delete a shopping cart item.\n
"""\n
\n
TODO:\n
- use form validation (Base_edit)\n
- use \'form_id\' instead of hardcoded value \'SaleOrder_viewAsWeb\'\n
"""\n
translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
......
......@@ -189,10 +189,14 @@
<value> <string encoding="cdata"><![CDATA[
"""\n
Update shopping cart by change items quantity and setting preferred \n
shipping.\n
"""\n
Update shopping cart by changing item quantities and by setting preferred\n
shipping method and payment method.\n
\n
TODO:\n
- support modern payment conditions (instead of payment_mode)\n
- use Base_edit and a real ERP5 Form in order to benefit from\n
field reusability and property validation\n
"""\n
request = context.REQUEST\n
translateString = context.Base_translateString \n
quantity = field_my_buy_quantity\n
......@@ -201,10 +205,10 @@ shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping
shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
# handle change in quantity for shopping items\n
# Handle change in quantity for shopping items\n
if quantity is not None:\n
# when we have one item in shoppping cart we get \n
# quantity as a string rather as a list\n
# Whenever there is onlu one item in shoppping cart, quantity\n
# is a string rather as a list\n
if isinstance(quantity, str):\n
quantity = [quantity]\n
\n
......@@ -214,11 +218,11 @@ if quantity is not None:\n
if new_quantity>=1:\n
order_line.setQuantity(new_quantity)\n
else:\n
# remove it from shopping cart\n
# Remove it from shopping cart\n
shopping_cart.manage_delObjects(order_line.getId())\n
counter += 1\n
\n
# handle shipping\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
......@@ -232,7 +236,11 @@ else:\n
if field_my_shipping_method in [\'\', None] and order_line is not None:\n
shopping_cart.manage_delObjects(order_line.getId())\n
\n
return context.SaleOrder_paymentRedirect(field_my_comment, field_my_payment_mode)\n
# Handle payment mode and comment\n
shopping_cart.setComment(field_my_comment)\n
shopping_cart.setPaymentConditionPaymentMode(field_my_payment_mode) # XXX This is bad because it does not use trade conditions XXX\n
\n
return context.SaleOrder_paymentRedirect()\n
]]></string> </value>
......
......@@ -188,7 +188,7 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
This script is called by external payment system.\n
Here you can check if payment was successfull or not.\n
It is possible to check here whether payment was successfull or not.\n
"""\n
\n
# XXX: implement external payment check\n
......
......@@ -187,8 +187,14 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Do whatever is necessary to finalize an order.\n
This script is called after customer completes shopping.\n
Do whatever is necessary to finalize an order. This script\n
is called after customer completes shopping (and payment).\n
\n
TODO:\n
- support generic variations\n
- rename buyer to supplier (everywhere)\n
- clean up python style such as space in "a = b" inside function calls\n
(hint: add global syntax and lexical analysis to ERP5 scripts)\n
"""\n
from DateTime import DateTime\n
request = context.REQUEST\n
......@@ -201,32 +207,33 @@ customer = shopping_cart.SaleOrder_getShoppingCartCustomer()\n
buyer = shopping_cart.SaleOrder_getShoppingCartBuyer()\n
\n
if isAnon:\n
# create first an account for user\n
# Create first an account for user\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n
web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg})\n
return\n
\n
#Check if payment is sucessfull\n
# Check if payment is sucessfull (comment the if buyer line and uncoment the next to be able to test)\n
if buyer is None:\n
raise ValueError, "Impossible to finalize and order not payed"\n
# if False:\n
raise ValueError, "Impossible to finalize an order which was not payed before"\n
\n
portal_type = "Sale %s" % shopping_cart.getPortalType()\n
portal_type = shopping_cart.getPortalType()\n
module = context.getDefaultModule(portal_type)\n
sale_order = module.newContent(portal_type=portal_type,\n
destination_value = customer,\n
destination_section_value = customer,\n
destination_decision_value = customer,\n
source_section_value = buyer,\n
source_value = buyer,\n
start_date = DateTime(),\n
received_date = DateTime(),\n
comment = shopping_cart.getComment(),\n
# set order default currency,\n
default_price_currency = web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl(),\n
# set trade condition\n
specialise_value = web_site.SaleOrder_getDefaultTradeCondition()\n
)\n
destination_value = customer,\n
destination_section_value = customer,\n
destination_decision_value = customer,\n
source_section_value = buyer,\n
source_value = buyer,\n
start_date = DateTime(),\n
received_date = DateTime(),\n
comment = shopping_cart.getComment(),\n
# set order default currency,\n
default_price_currency = web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl(),\n
# set trade condition\n
specialise_value = web_site.SaleOrder_getDefaultTradeCondition()\n
)\n
\n
for order_line in shopping_cart_item_list:\n
resource = order_line.getResourceValue()\n
......@@ -235,14 +242,18 @@ for order_line in shopping_cart_item_list:\n
aggregate_list = order_line.getAggregateList(),\n
quantity = order_line.getQuantity(),\n
price = order_line.getPrice(),\n
title = resource.getTitle())\n
title = resource.getTitle(),\n
variation=order_line.getVariation(),\n
size=order_line.getSize(),\n
)\n
\n
# order it\n
sale_order.order()\n
sale_order.activate().order()\n
\n
# clean up shopping cart\n
context.SaleOrder_getShoppingCart(action=\'reset\')\n
\n
# Display nice message\n
context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
</string> </value>
</item>
......
......@@ -187,8 +187,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This will return all Products that have set product_line=\'shipping\'. XXX\n
This script return all Products which product_line category is set to \'shipping\'. \n
Such products are used for shipping purposes i.e. they can not be sold.\n
\n
TODO:\n
- change hardcoded category from \'product_line\' to a site dependent category\n
"""\n
portal = context.getPortalObject()\n
\n
......
......@@ -50,7 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Return the default trade condition"""\n
<value> <string>"""\n
Return the default trade condition for thie ecommerce site\n
"""\n
default = "sale_trade_condition_module/default_trade_condition"\n
\n
website = context.getWebSiteValue()\n
......@@ -68,6 +70,10 @@ return context.getPortalObject().restrictedTraverse(default)\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_getDefaultTradeCondition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Return default trade condition</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -50,7 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>creation_date = context.getCreationDate()\n
<value> <string>"""\n
Return the creation date of the current context with\n
a niceer format.\n
\n
TODO:\n
- use a field and form for this purpose\n
"""\n
creation_date = context.getCreationDate()\n
return creation_date.strftime(\'%a, %d %b %Y %H:%M %p\')\n
</string> </value>
</item>
......
......@@ -50,7 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return \'%s %s\' %(context.getTotalPrice(), context.getPriceCurrencyTitle())\n
<value> <string>"""\n
Return the price and currency, with some\n
ad-hoc pretty printing\n
\n
TODO:\n
- implement generic pretty printing of currencies\n
"""\n
price_currency_title = context.getPriceCurrencyTitle()\n
if price_currency_title == "Euro": price_currency_title = "€"\n
return \'%s %s\' %(context.getTotalPrice(), price_currency_title)\n
</string> </value>
</item>
<item>
......
......@@ -186,7 +186,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>shopping_cart = context.SaleOrder_getShoppingCart()\n
<value> <string>"""\n
Return selected shipping method from shopping cart\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shipping_method = getattr(shopping_cart, \'shipping_method\', None)\n
if shipping_method is not None:\n
return shipping_method.getResourceValue()\n
......
......@@ -50,8 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Add resource to current (or to be created shopping cart). \n
<value> <string>"""\n
Create a new shopping cart if needed. Return\n
shopping cart for current customer. Set all local roles\n
permissins so that shopping cart can be modified by anonymous.\n
\n
TODO:\n
- handle reset with another method\n
(more explicit, less risky)\n
- decide whether to keep or remove new_shopping_cart parameter\n
(is it really useful to create a new shopping cart here)\n
"""\n
from DateTime import DateTime\n
\n
......@@ -61,28 +69,44 @@ session_id = request.get(\'session_id\', None)\n
portal_sessions = context.portal_sessions\n
\n
if session_id is None:\n
## first call so generate session_id and send back via cookie\n
# first call so generate session_id and send back via cookie\n
now = DateTime()\n
session_id = context.Base_generateSessionID(max_long=20)\n
request.RESPONSE.setCookie(\'session_id\', session_id, expires=(now +expire_timeout_days).fCommon(), path=\'/\')\n
\n
if action==\'reset\':\n
## reset cart \n
portal_sessions.manage_delObjects(session_id)\n
else:\n
## take shopping cart for this customer\n
shopping_cart_id = \'shopping_cart\'\n
session = portal_sessions[session_id]\n
if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n
web_site = context.getWebSiteValue()\n
shopping_cart = newTempOrder(portal_sessions, shopping_cart_id)\n
shopping_cart.setPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
session[shopping_cart_id] = shopping_cart\n
# reset cart and return (a separate method would be better XXX)\n
return portal_sessions.manage_delObjects(session_id)\n
\n
# take shopping cart for this customer\n
shopping_cart_id = \'shopping_cart\'\n
session = portal_sessions[session_id]\n
\n
## return just a part of session for shopping cart\n
# some cleanup could be required if the shopping cart\n
# comes from a previous user with same session\n
if shopping_cart_id in session.keys():\n
shopping_cart = session[shopping_cart_id]\n
return shopping_cart\n
if not shopping_cart.SaleOrder_isShoppingCartConsistent():\n
portal_sessions.manage_delObjects(session_id)\n
session = portal_sessions[session_id]\n
\n
# create shopping cart\n
if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n
web_site = context.getWebSiteValue()\n
shopping_cart = context.sale_order_module.newContent(portal_type="Sale Order", id=shopping_cart_id, temp_object=1, container=portal_sessions)\n
# Set usable security for Anonymous\n
shopping_cart.manage_role("Anonymous", ["Access contents information",\n
"Add portal content",\n
"Delete objects",\n
"Modify portal content",\n
"View"])\n
shopping_cart.setPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
session[shopping_cart_id] = shopping_cart\n
\n
## return just a part of session for shopping cart\n
shopping_cart = session[shopping_cart_id]\n
return shopping_cart\n
</string> </value>
</item>
<item>
......
......@@ -50,7 +50,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Get the shopping cart customer"""\n
<value> <string>"""\n
Get the shopping cart customer object.\n
\n
TODO:\n
- double check this method since the word "buyer"\n
has been used in other placed to name what is actually\n
the vendor, or has been used for other purpose.\n
- make sure this method really makes any sense\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
return shopping_cart.getDestinationDecisionValue()\n
</string> </value>
......
......@@ -50,7 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Get the shopping cart customer"""\n
<value> <string>"""\n
Get the shopping cart customer as a Person object. \n
\n
TODO:\n
- add some consistency checks so that if current user\n
is not the current one defined in shopping\n
cart then reset shopping cart before proceeding. This\n
could happen if a wrong sequence of logout / add to cart\n
by two people sharing the same Web browser happens.\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
result = shopping_cart.getDestinationSectionValue()\n
if result is None:\n
......
......@@ -50,7 +50,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.REQUEST.get(\'session_id\')\n
<value> <string>"""\n
Return shopping cart ID\n
"""\n
return context.REQUEST.get(\'session_id\')\n
</string> </value>
</item>
<item>
......@@ -63,7 +66,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get shopping cart id</string> </value>
<value> <string>Get shopping cart ID</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -51,10 +51,17 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return list of shopping cart items.\n
XXX : get order_line as tree not just on first level\n
Return list of shopping cart items as list representing order lines.\n
\n
TODO:\n
- rename shopping_cart_order_lines to shopping_cart_order_line_list\n
- make this method compatible with cells and trees in orders. Orders\n
are not always flat. Consider large projects or matrices in B2B sales\n
of apparel. SaleOrder_getShoppingCartItemTree would be a better\n
name probably.\n
- make sure this script is not called more than once per page\n
"""\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues()\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues(portal_type="Sale Order Line")\n
if include_shipping:\n
return shopping_cart_order_lines\n
else:\n
......
......@@ -61,7 +61,6 @@
\n
Script can optionally include currency.\n
"""\n
\n
web_site = context.getWebSiteValue()\n
total = 0.0\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
......
......@@ -186,7 +186,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n
<value> <string>"""\n
This method does a kind of ad-hoc consistency check\n
on the shopping cart based on the presence of a shipping method.\n
\n
TODO:\n
- use checkConsistency / fixConsistency framework of ERP5\n
(and extend it if needed with constraint categories)\n
"""\n
if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n
## shipping is required but not selected\n
return False\n
return True\n
......
......@@ -189,7 +189,11 @@
<value> <string encoding="cdata"><![CDATA[
\'\'\'\n
If all product have no Weight, it don\'t need to be sheep. \n
If all product have no weight, then it does not need to be shipped.\n
\n
TODO:\n
- use ERP5 constrain framework checkConsistency/fixConsistency\n
in order to be perfectly generic\n
\'\'\'\n
return False\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
......
<?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>"""\n
In some cases, a session ID already exists in the browser\n
and can lead one user to access data created by another user.\n
Roles and permission will usually prevent this and raise\n
exception. This script tries to detect such situation in\n
order to make sure such data is deleted before this happens.\n
\n
TODO\n
- add log for "should never happen case" so that we can\n
make sure this case does not happen on public site\n
anymore\n
- rename script to SaleOrder_isShoppingCartUserConsistent\n
"""\n
result = True\n
\n
# If user is anonymous and destination is not None, inconsistent\n
isAnon = context.portal_membership.isAnonymousUser()\n
if isAnon and context.getDestinationSection():\n
return False\n
\n
# If the shopping cart customer is not the current user logged in, inconsistent\n
# This should never happen\n
if not isAnon:\n
destination_section = context.getDestinationSection()\n
customer = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
if destination_section and customer is not None:\n
if destination_section != customer.getRelativeUrl():\n
return False\n
\n
return result\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>SaleOrder_isShoppingCartConsistent</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detect shared shopping cart</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,7 +50,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return len(context.SaleOrder_getShoppingCartItemList())==0\n
<value> <string>"""\n
Returns true if the shopping cart is empty\n
\n
TODO:\n
- make sure this script is not called more than once per page\n
"""\n
return len(context.SaleOrder_getShoppingCartItemList())==0\n
</string> </value>
</item>
<item>
......
......@@ -50,23 +50,30 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># check if the user is Anonymous, if yes it must be redirected to Registration Dialog\n
<value> <string>"""\n
Redirect to relevant payment mode and force if necessary user\n
to register first.\n
"""\n
# check if the user is Anonymous, if yes he/she must be redirected to Registration Dialog\n
# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
\n
if field_my_comment is not None:\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart.setComment(field_my_comment)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
field_my_comment = shopping_cart.getComment()\n
field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
\n
if isAnon:\n
# create first an account for user\n
web_site = context.getWebSiteValue()\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n
web_site.Base_redirect(\'register\', \\\n
keep_items={\'portal_status_message\': msg})\n
return\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
return web_site.Base_redirect(\'register\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'coming_from_url\': coming_from_url})\n
\n
if field_my_payment_mode is None:\n
msg = translateString("You must select a payment mode.")\n
......@@ -85,7 +92,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>field_my_comment=None, field_my_payment_mode=None, **kw</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -99,6 +106,10 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_paymentRedirect</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Redirect to registration or payment page</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -50,7 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Set connected user as shopping cart customer"""\n
<value> <string>"""\n
Set connected user as shopping cart customer\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
member = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
shopping_cart.edit(destination_section_value=member)\n
......
......@@ -65,7 +65,7 @@ if parameter_dict[\'PAYERID\'] != payer_id:\n
\n
#redirect user to the checkout section\n
website = context.getWebSiteValue() \n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\',"checkout")\n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\', \'checkout\')\n
website.Base_redirect(section_url, \\\n
keep_items={\'portal_status_message\':translateString("The payment procedure went well on Paypal."),\n
\'token\':token})\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
if order_parameter_dict is None:\n
return None\n
order_parameter_dict[\'TOKEN\'] = token\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if security_parameter_dict is None:\n
return None\n
security_parameter_dict[\'TOKEN\'] = token\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n
if response_parameter_dict is None:\n
......
......@@ -50,7 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.REQUEST.set(\'editable_mode\', 1)\n
<value> <string>"""\n
Displays the current person information (ie. the one of the customer defined in the shopping cart).\n
\n
TODO:\n
- reimplement using Person_viewAsWeb and appropriate form_view_editable template\n
- it is probably not needed to use the shopping cart to know who is the customer\n
(unless we want one use to update information of another user)\n
- consider merging this with standard user preference settings of ERP5 web\n
"""\n
context.REQUEST.set(\'editable_mode\', 1)\n
person_object = context.getWebSiteValue().SaleOrder_getShoppingCartCustomer()\n
return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n
</string> </value>
......
<?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 encoding="cdata"><![CDATA[
"""\n
This script is a sample script skeleton (part of erp5_web)\n
which can be used to create user (Person object) \n
\n
Notes:\n
- the script is normally executed by anonymous user with Manager proxy roles which \n
you have to turn on after adjusting this script to your needs.\n
- you have to decide if assignment should be opened automatically or \n
verified and opened by administrator first\n
- you need to adjust group, function and site to your needs\n
\n
TODO:\n
- change hardcoding to site properties (ex. \'client\')\n
- implement auto-login in a generic way by inspecting\n
site properties (portal cookie authentication)\n
"""\n
from Products.Formulator.Errors import ValidationError, FormValidationError\n
portal = context.getPortalObject()\n
translateString = context.Base_translateString\n
website = context.getWebSiteValue()\n
\n
# Call Base_edit\n
result, result_type = context.Base_edit(form_id, silent_mode=1, field_prefix=\'your_\')\n
\n
# Return if not appropriate\n
if result_type != \'edit\':\n
return result\n
kw, encapsulated_editor_list = result\n
\n
# Set default values\n
person_group = None\n
person_function = None\n
person_site = None\n
person_role = \'client\'\n
kw.setdefault(\'reference\', kw[\'default_email_text\'])\n
if \'password_confirm\' in kw:\n
del kw[\'password_confirm\']\n
\n
#Check that user doesn\'t already exists\n
person_list = portal.acl_users.erp5_users.getUserByLogin(kw[\'reference\'])\n
if person_list:\n
msg = translateString("This account already exists. Please provide another email address.")\n
kw[\'portal_status_message\'] = msg\n
context.REQUEST.form.update(kw)\n
return getattr(website, form_id)()\n
\n
# create Person account\n
person_module = portal.getDefaultModule(portal_type=\'Person\')\n
person = person_module.newContent(portal_type=\'Person\', **kw)\n
person.manage_setLocalRoles(kw[\'reference\'], [\'Owner\'])\n
person.validate()\n
# do not immediate reindex object\n
# this means that when creating an account the new one will *NOT*\n
# be available immediately and we should consider sending two email to user\n
# that 1) his account will be created and when created 2)-> send account info\n
person.immediateReindexObject() # hack to make it possible to log\n
person.updateLocalRolesOnSecurityGroups() # Force setting security without interaction workflow (for now) XXX\n
\n
# Create default career\n
career = person.newContent(portal_type=\'Career\',\n
id=\'default_career\',\n
group=person_group,\n
function=person_function,\n
role=person_role)\n
# Create assignment\n
assignment = person.newContent(portal_type=\'Assignment\',\n
group=person_group,\n
function=person_function,\n
role=person_role, # Required for security based on role\n
site=person_site)\n
assignment.open()\n
\n
msg = translateString("Your account was successfully created.")\n
\n
# Set owner local role for cart if needed\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart.manage_setLocalRoles(kw[\'reference\'], [\'Owner\'])\n
\n
# Redirect if needed to coming_from_url\n
coming_from_url = kw[\'coming_from_url\']\n
if coming_from_url:\n
from ZTUtils import make_query\n
parameter_string = make_query(__ac_name=kw[\'reference\'], __ac_password=kw[\'password\'],\n
portal_status_message=msg, editable_mode=0)\n
return context.REQUEST.RESPONSE.redirect(\'%s?%s\' % (coming_from_url, parameter_string))\n
\n
return website.Base_redirect(form_id, keep_items=dict(portal_status_message=msg,\n
__ac_name=kw[\'reference\'], # XXX - Make it generic\n
__ac_password=kw[\'password\'], # XXX - Make it generic\n
editable_mode=0))\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id</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>WebSite_createWebSiteAccount</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Web Site User Account (MERGE THIS)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if order_parameter_dict is None:\n
return None\n
\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n
security_parameter_dict = {\'USER\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_username\', None),\n
\'PWD\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_password\', None),\n
\'SIGNATURE\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_signature\', None),\n
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if alternative_url is not None:\n
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if alternative_url is not None:\n
return alternative_url\n
\n
test_environement = context.getLayoutProperty(\'ecommerce_test_environment_enabled\', None)\n
......
......@@ -52,6 +52,12 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
Return the current step for checkout procedure that will be displayed on Shopping Cart page.\n
\n
TODO:\n
- findout where this is used\n
- make sure that this script is either used everywhere\n
(and centralized sales workflow) or nowhere (local approach,\n
spaguettish but more consistent)\n
"""\n
web_site = context.getWebSiteValue()\n
shopping_cart = web_site.SaleOrder_getShoppingCart()\n
......
......@@ -52,9 +52,14 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
Return default currency used in Shopping Cart.\n
\n
TODO:\n
- remove hardcoding of currency_module/EUR \n
(ex. use system properties for example)\n
"""\n
web_site = context.getWebSiteValue()\n
return context.getPortalObject().restrictedTraverse(web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n
return context.getPortalObject().restrictedTraverse(\n
web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n
</string> </value>
</item>
<item>
......
......@@ -52,6 +52,9 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
Return reference of the default currency used in Shopping Cart.\n
\n
TODO:\n
- add pretty printing of currency (if it makes sense here)\n
"""\n
website = context.getWebSiteValue()\n
if website:\n
......
......@@ -51,7 +51,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Return the sort title of the default currency used in Shopping Cart.\n
Return the short title of the default currency used in Shopping Cart.\n
\n
TODO:\n
- the currency symbol and code are used inconsistently\n
take a decision of which to use where and stick to it\n
"""\n
return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getShortTitle()\n
</string> </value>
......
......@@ -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 some visible by default\n
# Some sections should be visible by default\n
cart_section.setVisible(True)\n
\n
# setup site properties\n
# Setup site properties to default values\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>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>WebSite_createPersonAccount</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Create a new account. Includes a hidden field whenever it is needed to proceed to a next step.</string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left (User Login)</string>
<string>right (User Identity)</string>
<string>center</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>your_coming_from_url</string>
</list>
</value>
</item>
<item>
<key> <string>left (User Login)</string> </key>
<value>
<list>
<string>your_reference</string>
<string>your_password</string>
<string>your_password_confirm</string>
</list>
</value>
</item>
<item>
<key> <string>right (User Identity)</string> </key>
<value>
<list>
<string>your_first_name</string>
<string>your_last_name</string>
<string>your_default_email_text</string>
<string>your_default_telephone_text</string>
<string>your_default_fax_text</string>
<string>your_default_address_street_address</string>
<string>your_default_address_city</string>
<string>your_default_address_zip_code</string>
<string>your_default_address_region</string>
<string>submit</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_viewRegistrationDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createWebSiteAccountForm</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Your New Account (MERGE)</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>name</string>
<string>title</string>
<string>default</string>
<string>css_class</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>submit</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Register New User</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_input_button_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createWebSiteAccount:action</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Register</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_city</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>City</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>items</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_region</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Country</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/portal_categories/region/getCategoryChildLogicalPathItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>whitespace_preserve</string>
<string>height</string>
<string>width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_street_address</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_text_area_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Address</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>30</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_zip_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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <int>10</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Post Code</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>required</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_email_text</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_email</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_fax_text</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>FAX</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_telephone_text</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Telephone</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_first_name</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>First name of the use wanting to register</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>15</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>First Name</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_last_name</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Last Name of the user wanting to register</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>15</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Last Name</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>required</string>
<string>external_validator</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_password</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_validatePasswordsMatch</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>external_validator</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password_confirm</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_password</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Password (confirm)</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_validatePasswordsMatch</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>display_width</string>
<string>external_validator</string>
<string>required</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_reference</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The username this person will use to log in the system. The system will check that there isn\'t another user with the same username.</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>User Login</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_isValidUserReference</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -193,7 +193,6 @@ fieldset.editable div.input {padding:0px;}\n
.main_content table tr.thead_bottom td {border: solid 1px <tal:block tal:replace="primary_color"/>;border-width: 1px 0px 1px 0px;}\n
.main_content table tr.tfoot {border:none;}\n
.main_content table caption {margin-top:10px; text-align:center; padding-bottom:10px;}\n
.main_content button.sort_button {float:left;}\n
.main_content th img {clear:none; border:none; margin-left:5px;}\n
.main_content .pageNavigation input {vertical-align:middle;}\n
.main_content table td.td_check_all {background-color:<tal:block tal:replace="body_color"/>;}\n
......@@ -204,9 +203,21 @@ fieldset.editable div.input {padding:0px;}\n
.main_content table tr.shopping_cart_end_lines td {border:none;}\n
.main_content table tr.shopping_cart_end_lines td.used {border-bottom:solid 1px #CCC;}\n
\n
\n
</tal:block>\n
.main_content button.sort_button,\n
table.listbox th button.sort-button {\n
text-decoration: underline;\n
padding: 0px;\n
border-width: 0;\n
cursor: pointer;\n
float: left;\n
background: transparent;\n
color: #505050;\n
font-size: 80% !important;\n
font-weight: bold;\n
height: 3em;\n
}\n
\n
</tal:block>
]]></unicode> </value>
</item>
......@@ -224,7 +235,7 @@ fieldset.editable div.input {padding:0px;}\n
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
<?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>"""\n
Find default image for a given resource. If no image\n
is defined on the resource itself, look in each individual\n
variation.\n
\n
TODO:\n
- make the variation support generic (remove hardcoded "variation"\n
and use another approach to select default variation based\n
for example on a default variation order or int_index)\n
- make this script cached per transaction\n
"""\n
request = context.REQUEST\n
variation = request.get(\'variation\', None)\n
if variation:\n
variation = context.getWebSiteValue().restrictedTraverse(variation)\n
image = variation.getDefaultImageValue()\n
if image is not None:\n
return image.absolute_url()\n
\n
default_image = context.getDefaultImageValue()\n
if default_image is not None:\n
return default_image.absolute_url()\n
\n
if \'variation\' in context.getVariationBaseCategoryList():\n
default_variation = context.getVariationRangeCategoryList(base_category_list=[\'variation\'])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
default_variation = default_variation[len(\'variation/\'):]\n
default_image = context.getPortalObject().restrictedTraverse(default_variation).getDefaultImageValue()\n
if default_image is not None:\n
return default_image.absolute_url()\n
\n
return None\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_getWebShopImageURL</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Return a URL for current product image</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -41,6 +41,12 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......@@ -86,6 +92,7 @@
<string>default_image</string>
<string>my_default_image_absolute_url</string>
<string>my_title</string>
<string>variation_box</string>
</list>
</value>
</item>
......@@ -138,6 +145,10 @@
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -298,16 +298,13 @@
</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.getDefaultImageValue() in (None, \'\') or here.getDefaultImageValue().getData() in (None, \'\')</string> </value>
<value> <string>python: not here.Resource_getWebShopImageURL()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -14,6 +14,7 @@
<string>default</string>
<string>description</string>
<string>enabled</string>
<string>image_display</string>
<string>title</string>
</list>
</value>
......@@ -62,7 +63,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -71,7 +74,7 @@
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -82,6 +85,10 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
......@@ -121,6 +128,10 @@
<key> <string>form_id</string> </key>
<value> <string>File_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string>small</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
......@@ -137,16 +148,26 @@
</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.Resource_getWebShopImageURL()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getDefaultImageValue() not in (None, \'\') and here.getDefaultImageValue().getData() not in (None, \'\')</string> </value>
<value> <string>python: here.Resource_getWebShopImageURL()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -261,10 +261,7 @@
</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>
......
......@@ -172,10 +172,7 @@
</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>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FormBox" module="Products.ERP5Form.FormBox"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>variation_box</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>form_invalidated</string> </key>
<value> <string>Form invalidated.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input 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>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>formbox_target_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</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> <string></string> </value>
</item>
<item>
<key> <string>description</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>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>formbox_target_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</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>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>formbox_target_id</string> </key>
<value> <string>Resource_viewVariationBox</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Variation</string> </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>nocall: here/Resource_viewVariationBox | nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -265,10 +265,7 @@
</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>
......@@ -281,10 +278,7 @@
</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>
......
......@@ -50,7 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>web_site = context.getWebSiteValue()\n
<value> <string>"""\n
TODO:\n
- it should be possible to have more than one root\n
product lines. In such case, using a predicate would\n
be way easier.... simply by checking if the root\n
predicate(s) apply\n
"""\n
web_site = context.getWebSiteValue()\n
resource = context.getResourceValue()\n
web_site_product_line = web_site.getLayoutProperty(\'ecommerce_base_product_line\')\n
portal_categories = context.getPortalObject().portal_categories\n
......
......@@ -76,7 +76,9 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_variation_title</string>
</list>
</value>
</item>
<item>
......
......@@ -355,6 +355,14 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>variation_title</string>
<string>Variation</string>
</tuple>
<tuple>
<string>getSizeTitle</string>
<string>Size</string>
</tuple>
<tuple>
<string>getTotalQuantity</string>
<string>Quantity</string>
......@@ -378,6 +386,10 @@
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -388,6 +400,12 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
......@@ -405,7 +423,12 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>variation_title</string>
<string>variation_title</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -422,6 +445,10 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
......@@ -450,6 +477,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
......@@ -519,6 +550,12 @@
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Sale Order Lines</string> </value>
......@@ -537,6 +574,14 @@
<string>title</string>
<string>SaleOrder_getResourceUrl</string>
</tuple>
<tuple>
<string>variation_title</string>
<string>Variation</string>
</tuple>
<tuple>
<string>getSizeTitle</string>
<string>Size</string>
</tuple>
<tuple>
<string>getTotalQuantity</string>
<string>SaleOrder_getResourceUrl</string>
......@@ -556,10 +601,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -65,13 +65,19 @@
<tal:block tal:repeat="order_line shopping_cart_item_list">\n
<tr tal:define="resource python: here.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n
price python: order_line.getPrice();\n
order_line_id python: order_line.getId();">\n
<td>\n
<div tal:attributes="class string: shopping_cart_renderer_title">\n
<a href="" tal:attributes="href python: \'%s/%s\' % (resource.absolute_url(), \'Resource_viewAsShop\');">\n
<span tal:replace="resource/getTitle"/> \n
<div tal:attributes="class string: shopping_cart_renderer_title"\n
tal:define="variation order_line/getVariation | string:;\n
variation_title order_line/getVariationTitle | nothing;\n
size_title order_line/getSizeTitle | nothing">\n
<a href="" tal:attributes="href python: \'%s/%s?variation=%s\' %\n
(resource.absolute_url(), \'Resource_viewAsShop\', variation);">\n
<span tal:replace="resource/getTitle"/>\n
</a>\n
<span tal:replace="variation_title" tal:condition="variation_title"/>\n
<span tal:replace="size_title" tal:condition="size_title"/>\n
</div>\n
<div class="shopping_cart_renderer_remove">\n
<a tal:attributes="href python: \'%s/SaleOrder_deleteShoppingCartItem?field_my_order_line_id=%s\' \n
......@@ -92,7 +98,7 @@
<span tal:replace="price"/> <span tal:replace="currency_code"/>\n
</td>\n
<td>\n
<span tal:replace="python: price*quantity"/> <span tal:replace="currency_code"/>\n
<span tal:replace="python: (price or 0)*(quantity or 0)"/> <span tal:replace="currency_code"/>\n
</td>\n
</tr>\n
</tal:block>\n
......@@ -172,8 +178,7 @@
</tal:block>\n
</div>\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></unicode> </value>
</item>
......
......@@ -47,20 +47,26 @@
<tr tal:repeat="order_line shopping_cart_item_list">\n
<td tal:define="resource python: web_site.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n
price resource/getPrice;\n
price order_line/getPrice;\n
currency web_site/WebSite_getShoppingCartDefaultCurrency;\n
currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n
currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();\n
variation order_line/getVariation | string:;\n
variation_title order_line/getVariationTitle | nothing;\n
size_title order_line/getSizeTitle | nothing;"\n
class="cart_top"> \n
\n
<div class="cart_left cart_item_name">\n
<span><span tal:replace="quantity"/> x </span>\n
<a class="articlelink" href="" tal:attributes="href python: \'%s/%s\' % (resource.absolute_url(), \'Resource_viewAsShop\');">\n
<a class="articlelink" href="" tal:attributes="href python: \'%s/%s?variation=%s\' % (resource.absolute_url(), \'Resource_viewAsShop\', variation);">\n
<span tal:content="resource/getTitle"/>\n
</a>\n
<br tal:condition="variation_title | size_title"/>\n
<span tal:replace="variation_title" tal:condition="variation_title"/>\n
<span tal:replace="size_title" tal:condition="size_title"/>\n
</div>\n
<div class="cart_right">\n
<span>\n
<span tal:replace="python: price * quantity"/> <span tal:replace="currency_symbol"/>\n
<span tal:replace="python: (price or 0)*(quantity or 0)"/> <span tal:replace="currency_symbol"/>\n
</span>\n
</div> \n
</td>\n
......@@ -88,15 +94,14 @@
<div class="cart_left">\n
<a class="articlelink" \n
tal:attributes="href python: \'%s/%s\' % (web_site.absolute_url(), web_site.getLayoutProperty(\'ecommerce_cart_section_id\', \'\'))">\n
<span tal:replace="python: here.Base_translateString(\'Shopping Cart\')"/>\n
<span tal:replace="python: here.Base_translateString(\'Edit / Checkout\')"/>\n
</a>\n
</div>\n
</td>\n
</tr>\n
</tal:block>\n
</tal:block>\n
</table>\n
</table>
]]></unicode> </value>
</item>
......
......@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
......@@ -57,10 +61,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
......@@ -70,6 +71,7 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
......
......@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Invalidate</string> </value>
......@@ -57,10 +61,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
......@@ -70,6 +71,7 @@
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
......
......@@ -71,6 +71,7 @@
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
......
......@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Validate</string> </value>
......@@ -57,10 +61,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
......@@ -70,6 +71,7 @@
<tuple>
<string>Assignor</string>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
......
2012-08-27 jps
Full review of the business template with addition of TODOs to each script.
2010-09-30 nicolas.dumazet
* Revert changes from 29th after adding Order abstract portal type to erp5_trade
......
To get the Anonymous navigation working is required to set some security:
currency_module - Access contents information
product_module - Access contents information
sale_order_module - Access contents information
\ No newline at end of file
To get the Anonymous navigation working, it is necessary to set some security:
currency_module - Access contents information
product_module - Access contents information
sale_order_module - Access contents information
sale_trade_condition_module - Access contents information
TODO:
- merge account registration / creation into generic ERP5
284
\ No newline at end of file
287
\ No newline at end of file
Sale Order Module | web_view
Sale Order | web_view
Web Section | ecommerce_configuration
Web Site | ecommerce_configuration
\ No newline at end of file
Currency | -validation_workflow
Currency | commerce_validation_workflow
Product | -validation_workflow
Product | commerce_validation_workflow
\ No newline at end of file
Product | commerce_validation_workflow
Sale Trade Condition | -validation_workflow
Sale Trade Condition | commerce_validation_workflow
Service | -validation_workflow
Service | commerce_validation_workflow
\ No newline at end of file
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