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