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

Added ad-hoc support for variations

Support variation and size categories. Generic implementation required in future.
parent 8a2ffd73
......@@ -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>
......
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