You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

70 lines
4.4 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Template for Add To Cart Button-->
<template id="website_add_multi_product_item_button"
inherit_id="website_sale.products"
name="Add Multi Item To Cart Button">
<xpath expr="//div[@id='products_grid_before']" position="inside">
<div class="accordion-item nav-item mb-3">
<h6 class="mb-3 multi_item_to_cart">
<b>Add multiple products to cart</b>
</h6>
<form>
<span
class="btn btn-primary btn-xs fa fa-shopping-cart mb-3 confirm_check">
Add
</span>
</form>
</div>
</xpath>
</template>
<!-- Template for selecting products-->
<template id="add_website_product_item"
inherit_id="website_sale.products_item"
name="Add Multi Product To Cart">
<xpath expr="//form[@action='/shop/cart/update']" method="post"
position="replace">
<form action="/shop/cart/update/product" method="get"
class="card oe_product_cart"
t-att-data-publish="product.website_published and 'on' or 'off'"
itemscope="itemscope"
itemtype="http://schema.org/Product">
<div class="card-body p-1 oe_product_image">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
<a t-att-href="product_href" class="d-block h-100" itemprop="url">
<t t-set="image_holder" t-value="product._get_image_holder()"/>
<span t-field="image_holder.image_1920"
t-options="{'widget': 'image', 'preview_image': 'image_1024' if product_image_big else 'image_256', 'itemprop': 'image'}"
class="d-flex h-100 justify-content-center align-items-center"/>
</a>
</div>
<div class="card-body p-0 o_wsale_product_information">
<div class="p-2 o_wsale_product_information_text">
<h6 class="o_wsale_products_item_title mb-1">
<a class="text-primary text-decoration-none" itemprop="name" t-att-href="product_href" t-att-content="product.name" t-field="product.name" />
<a role="button" t-if="not product.website_published" t-att-href="product_href" class="btn btn-sm btn-danger" title="This product is unpublished.">Unpublished</a>
</h6>
<div class="product_price mb-1" itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer">
<span class="h5" t-if="combination_info['price']" t-esc="combination_info['price']" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
<del t-attf-class="text-danger ml-1 h6 {{'' if combination_info['has_discounted_price'] else 'd-none'}}" style="white-space: nowrap;" t-esc="combination_info['list_price']" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}" />
<span itemprop="price" style="display:none;" t-esc="combination_info['price']" />
<span itemprop="priceCurrency" style="display:none;" t-esc="website.currency_id.name" />
</div>
</div>
<div class="o_wsale_product_btn pl-2"/>
</div>
<t t-set="bg_color" t-value="td_product['ribbon']['bg_color'] or ''"/>
<t t-set="text_color" t-value="td_product['ribbon']['text_color']"/>
<t t-set="bg_class" t-value="td_product['ribbon']['html_class']"/>
<span t-attf-class="o_ribbon #{bg_class}" t-attf-style="#{text_color and ('color: %s; ' % text_color)}#{bg_color and 'background-color:' + bg_color}" t-out="td_product['ribbon']['html'] or ''"/>
<div name="website_multi_product_add_to_cart">
<input type="checkbox" name="pdid"
class="mycheckbox"
t-att-value="product.product_variant_ids[0].id"
style="width: 25px;height: 25px;margin-right:10px;"/>
</div>
</form>
</xpath>
</template>
</odoo>