[IMP] website_sale: Add to Basket and fix suggested

bzr revid: chm@openerp.com-20130903083639-ftnd8lxhbotq7czo
This commit is contained in:
Christophe Matthieu
2013-09-03 10:36:39 +02:00
parent 8314c4ef9d
commit 2cccfcb556
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -127,7 +127,7 @@
<b><t t-esc="product.product_variant_ids[0].price" /> €</b>
</div>
<div class="mb8 mt8">
<a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success">Add to cart</a>
<a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success">Add to basket</a>
</div>
</div>
</t>
@@ -153,14 +153,14 @@
<div id="product_detail">
<t t-call="website.publish"><t t-set="object" t-value="product"/></t>
<h1 t-field="product.name"></h1>
<a t-if="len(product.product_variant_ids) &lt;= 1" t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success pull-right">Add to cart</a>
<a t-if="len(product.product_variant_ids) &lt;= 1" t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success pull-right">Add to basket</a>
<form t-if="len(product.product_variant_ids) > 1" action="./add_cart/" class="pull-right">
<label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
<input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
<t t-esc="product.variants or ''">Standard</t>
<span class="badge" t-if="product.price_extra"><t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €</span>
</label><br/>
<button class="btn btn-sm btn-success">Add to cart</button>
<button class="btn btn-sm btn-success">Add to basket</button>
</form>
<img class="media-object img-responsive" t-att-src="product.img('image_medium')"/>
<h2 t-if="editable">Description for Quotations</h2>
+2 -2
View File
@@ -34,8 +34,8 @@ class product_template(osv.osv):
_columns = {
'website_published': fields.boolean('Available in the website'),
'website_description': fields.html('Description for the website'),
'suggested_product_id': fields.many2one('product.product', 'Suggested For Product'),
'suggested_product_ids': fields.one2many('product.product', 'suggested_product_id', 'Suggested Products'),
'suggested_product_id': fields.many2one('product.template', 'Suggested For Product'),
'suggested_product_ids': fields.one2many('product.template', 'suggested_product_id', 'Suggested Products'),
}
def recommended_products(self, cr, uid, ids, context=None):