Commit 374d8e77 authored by Lucas Carvalho's avatar Lucas Carvalho

- fixed bug to proceed to payment button

- use Base_redirect instead of ERP5Site_redirect
- removed checkout web section
- fixed the visibility of some fields from SaleOrder_viewAsWeb
- added tips to shopping cart to help with the purchase procedure
- removed useless script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30684 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec8eb7d7
...@@ -237,8 +237,7 @@ else:\n ...@@ -237,8 +237,7 @@ else:\n
if field_my_shipping_method in [\'\', None] and order_line is not None:\n if field_my_shipping_method in [\'\', None] and order_line is not None:\n
shopping_cart.manage_delObjects(order_line.getId())\n shopping_cart.manage_delObjects(order_line.getId())\n
\n \n
context.SaleOrder_paymentRedirect(field_my_comment, field_my_payment_mode)\n return context.SaleOrder_paymentRedirect(field_my_comment, field_my_payment_mode)\n
return\n
]]></string> </value> ]]></string> </value>
......
...@@ -84,7 +84,6 @@ else:\n ...@@ -84,7 +84,6 @@ else:\n
\n \n
context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
keep_items={\'portal_status_message\': msg})\n keep_items={\'portal_status_message\': msg})\n
return\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -66,8 +66,8 @@ if parameter_dict[\'ACK\'] != \'Success\':\n ...@@ -66,8 +66,8 @@ if parameter_dict[\'ACK\'] != \'Success\':\n
if parameter_dict[\'PAYERID\'] != payer_id:\n if parameter_dict[\'PAYERID\'] != payer_id:\n
return "Identification failed.2 : %s" % parameter_dict[\'PAYERID\']\n return "Identification failed.2 : %s" % parameter_dict[\'PAYERID\']\n
\n \n
context.ERP5Site_redirect(\'%s/checkout\' % context.getWebSiteValue().absolute_url(), \\\n context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
keep_items={\'portal_status_message\':translateString("Your paypal account is authentificated.", mapping = dict()),\n keep_items={\'portal_status_message\':translateString("Your paypal account is authentificated.", mapping = dict()),\n
\'token\':token})\n \'token\':token})\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -53,15 +53,28 @@ ...@@ -53,15 +53,28 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>step = context.REQUEST.get(\'step\', None)\n <value> <string>""" \n
Return the current step for checkout procedure that will be displayed on Shopping Cart page.\n
"""\n
web_site = context.getWebSiteValue()\n
shopping_cart = web_site.SaleOrder_getShoppingCart()\n
empty_cart = shopping_cart.SaleOrder_isShoppingCartEmpty()\n
is_consistent = shopping_cart.SaleOrder_isConsistent()\n
is_anonymous = context.portal_membership.isAnonymousUser()\n
\n \n
if step is None:\n if empty_cart:\n
return context.SaleOrder_viewConfirmAsWeb()\n return context.Base_translateString(\'Add a product to your Shopping Cart.\')\n
\n \n
if context.request.get(\'plop\', None) is not None:\n if not is_consistent:\n
context.REQUEST.set(\'step\', 2)\n return context.Base_translateString(\'Select a Shipping Service.\')\n
person_object = context.getWebSiteValue().SaleOrder_getShoppingCartCustomer()\n \n
return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n if is_consistent and is_anonymous:\n
return context.Base_translateString(\'Please, you must login to proceed.\')\n
\n
if is_consistent and not is_anonymous:\n
return context.Base_translateString(\'Select your billing address.\')\n
\n
return\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -74,6 +87,12 @@ if context.request.get(\'plop\', None) is not None:\n ...@@ -74,6 +87,12 @@ if context.request.get(\'plop\', None) is not None:\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
...@@ -100,9 +119,11 @@ if context.request.get(\'plop\', None) is not None:\n ...@@ -100,9 +119,11 @@ if context.request.get(\'plop\', None) is not None:\n
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>None</string> <string>web_site</string>
<string>step</string> <string>shopping_cart</string>
<string>person_object</string> <string>empty_cart</string>
<string>is_consistent</string>
<string>is_anonymous</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -119,7 +140,11 @@ if context.request.get(\'plop\', None) is not None:\n ...@@ -119,7 +140,11 @@ if context.request.get(\'plop\', None) is not None:\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_checkoutProcedure</string> </value> <value> <string>WebSite_getShoppingCartCheckoutStep</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get current Shopping Cart step for checkout procedure.</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -61,19 +61,17 @@ if (context.getPortalType() != \'Web Site\'):\n ...@@ -61,19 +61,17 @@ if (context.getPortalType() != \'Web Site\'):\n
})\n })\n
\n \n
# creation the default sections\n # creation the default sections\n
object_id_list = [\'cart\', \'checkout\', \'account\', \'register\']\n object_id_list = [\'cart\', \'account\', \'register\']\n
for id in object_id_list:\n for id in object_id_list:\n
if id in context.objectIds():\n if id in context.objectIds():\n
context.manage_delObjects([id])\n context.manage_delObjects([id])\n
\n \n
cart_section = context.newContent(portal_type=\'Web Section\', title=\'Cart\', id=\'cart\')\n cart_section = context.newContent(portal_type=\'Web Section\', title=\'Cart\', id=\'cart\')\n
checkout_section = context.newContent(portal_type=\'Web Section\', title=\'Checkout\', id=\'checkout\')\n
account_section = context.newContent(portal_type=\'Web Section\', title=\'My account\', id=\'account\')\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 register_section = context.newContent(portal_type=\'Web Section\', title=\'Register\', id=\'register\')\n
\n \n
# make some visible by default\n # make some visible by default\n
cart_section.setVisible(True)\n cart_section.setVisible(True)\n
checkout_section.setVisible(True)\n
\n \n
# setup site properties\n # setup site properties\n
context.setContainerLayout(\'erp5_web_multiflex5_commerce_layout\')\n context.setContainerLayout(\'erp5_web_multiflex5_commerce_layout\')\n
...@@ -87,9 +85,6 @@ context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n ...@@ -87,9 +85,6 @@ context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n
cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n
cart_section.setProperty(\'ecommerce_default_content\', True)\n cart_section.setProperty(\'ecommerce_default_content\', True)\n
cart_section.setProperty(\'ecommerce_product_list\', False)\n cart_section.setProperty(\'ecommerce_product_list\', False)\n
checkout_section.setCustomRenderMethodId(\'SaleOrder_viewConfirmAsWeb\')\n
checkout_section.setProperty(\'ecommerce_default_content\', True)\n
checkout_section.setProperty(\'ecommerce_product_list\', False)\n
account_section.setCustomRenderMethodId(\'WebSection_viewCurrentPersonAsWeb\')\n account_section.setCustomRenderMethodId(\'WebSection_viewCurrentPersonAsWeb\')\n
account_section.setProperty(\'ecommerce_default_content\', True)\n account_section.setProperty(\'ecommerce_default_content\', True)\n
account_section.setProperty(\'ecommerce_product_list\', False)\n account_section.setProperty(\'ecommerce_product_list\', False)\n
...@@ -144,7 +139,6 @@ context.Base_redirect(\'\', keep_items={\n ...@@ -144,7 +139,6 @@ context.Base_redirect(\'\', keep_items={\n
<string>_getiter_</string> <string>_getiter_</string>
<string>id</string> <string>id</string>
<string>cart_section</string> <string>cart_section</string>
<string>checkout_section</string>
<string>account_section</string> <string>account_section</string>
<string>register_section</string> <string>register_section</string>
<string>True</string> <string>True</string>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
......
...@@ -80,7 +80,9 @@ ...@@ -80,7 +80,9 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
...@@ -88,9 +90,7 @@ ...@@ -88,9 +90,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value> <value> <string>python: not here.SaleOrder_isShoppingCartEmpty()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -163,9 +163,7 @@ ...@@ -163,9 +163,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
...@@ -308,20 +306,4 @@ ...@@ -308,20 +306,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<string>css_class</string> <string>css_class</string>
<string>default</string> <string>default</string>
<string>description</string> <string>description</string>
<string>enabled</string>
<string>hidden</string> <string>hidden</string>
<string>title</string> <string>title</string>
</list> </list>
...@@ -61,20 +62,24 @@ ...@@ -61,20 +62,24 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -85,9 +90,7 @@ ...@@ -85,9 +90,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
...@@ -116,6 +119,10 @@ ...@@ -116,6 +119,10 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The customer must be able to add a comment during the checkout procedure.</string> </value> <value> <string>The customer must be able to add a comment during the checkout procedure.</string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_comment</string> </value> <value> <string>my_comment</string> </value>
...@@ -143,22 +150,6 @@ ...@@ -143,22 +150,6 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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>python: not here.SaleOrder_isConsistent() and \'hiddenLabel\' or \'\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
...@@ -174,7 +165,7 @@ ...@@ -174,7 +165,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
...@@ -185,7 +176,7 @@ ...@@ -185,7 +176,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value> <value> <string>python: not here.SaleOrder_isShoppingCartEmpty()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<list> <list>
<string>css_class</string> <string>css_class</string>
<string>default</string> <string>default</string>
<string>enabled</string>
<string>items</string> <string>items</string>
</list> </list>
</value> </value>
...@@ -67,6 +68,12 @@ ...@@ -67,6 +68,12 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -78,7 +85,7 @@ ...@@ -78,7 +85,7 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -100,6 +107,10 @@ ...@@ -100,6 +107,10 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_payment_condition_payment_mode</string> </value> <value> <string>my_payment_condition_payment_mode</string> </value>
...@@ -141,6 +152,22 @@ ...@@ -141,6 +152,22 @@
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: not here.SaleOrder_isShoppingCartEmpty()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<tuple> <tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
......
...@@ -96,7 +96,9 @@ ...@@ -96,7 +96,9 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
...@@ -104,9 +106,7 @@ ...@@ -104,9 +106,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>image</string> </key> <key> <string>image</string> </key>
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>not: here/SaleOrder_isConsistent</string> </value> <value> <string>python: not here.SaleOrder_isShoppingCartEmpty()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -48,8 +48,10 @@ ...@@ -48,8 +48,10 @@
<tal:block tal:condition="python: shipping is None">\n <tal:block tal:condition="python: shipping is None">\n
<h3> <span tal:replace="python: here.Base_translateString(\'You have not selected shipping\')"/></h3>\n <h3> <span tal:replace="python: here.Base_translateString(\'You have not selected shipping\')"/></h3>\n
<p> \n <p> \n
<span tal:replace="python: here.Base_translateString(\'Your current cart selection requires shipping. Please select shipping from\')"/>\n <strong>\n
<a tal:attributes="href python: \'%s/cart\' % web_site.absolute_url()">here</a>.\n <span tal:replace="python: here.Base_translateString(\'Your current cart selection requires shipping. Please select shipping from\')"/>\n
<a tal:attributes="href python: \'%s/cart\' % web_site.absolute_url()">here</a>.\n
</strong>\n
</p>\n </p>\n
</tal:block>\n </tal:block>\n
\n \n
......
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
<h2>\n <h2>\n
<span tal:replace="python: here.Base_translateString(\'My shopping cart\')"/>\n <span tal:replace="python: here.Base_translateString(\'My shopping cart\')"/>\n
</h2>\n </h2>\n
<h6>\n
<span tal:replace="python: web_site.WebSite_getShoppingCartCheckoutStep()"/>\n
</h6>\n
<tal:block tal:condition = "empty_cart"> \n <tal:block tal:condition = "empty_cart"> \n
<h3><span tal:replace="python: here.Base_translateString(\'Your shopping cart is empty.\')"/></h3><br/>\n <h3><span tal:replace="python: here.Base_translateString(\'Your shopping cart is empty.\')"/></h3><br/>\n
</tal:block>\n </tal:block>\n
...@@ -116,7 +119,9 @@ ...@@ -116,7 +119,9 @@
<b><span tal:replace="python: \'%s %s\' % (shipping_obj.getPrice(), currency_code)"/></b>\n <b><span tal:replace="python: \'%s %s\' % (shipping_obj.getPrice(), currency_code)"/></b>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="python: shipping is None">\n <tal:block tal:condition="python: shipping is None">\n
<span tal:replace="python: here.Base_translateString(\'Your current cart selection requires shipping.\')"/><br/>\n <b>\n
<span tal:replace="python: here.Base_translateString(\'Your current cart selection requires shipping.\')"/><br/>\n
</b>\n
</tal:block>\n </tal:block>\n
</td>\n </td>\n
</tr>\n </tr>\n
......
246 248
\ No newline at end of file \ 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