Community mailing list archives

community@mail.odoo.com

Delivery costs on shopping cart

by
Laura
- 04/20/2016 06:29:29

Hi!!

Is it possible change or duplicate the delivery costs on payment to shopping cart?

I show you an image of example (made it on Photoshop). --> Attachment

The code of each part is:

- Delivery (without tax) - (website_sale_delivery.cart_delivery):

<data name="Delivery Costs" inherit_id="website_sale.total">
<xpath expr="//tr[@id='order_total_taxes']" position="after">
<tr class="text-muted" id="order_delivery">
<td>
<abbr title="Shipping">Envío sin IVA:</abbr>
</td>
<td class="text-right">
<span t-field="website_sale_order.amount_delivery" t-field-options="{ &quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;website.pricelist_id.currency_id&quot; }"/>
</td>
</tr>
</xpath>
</data>

- Country + State/Province (website_sale.checkout):

<form action="/shop/confirm_order" method="post">
<div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-lg-6">
<label class="control-label" for="country_id">Country *</label>
<select name="country_id" class="form-control">
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')">
<t t-esc="country.name"/>
</option>
</t>
</select>
</div>
<div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''} col-lg-6">
<label class="control-label" for="state_id" style="font-weight: normal">
<strong>State / Province *</strong>
</label>
<select name="state_id" class="form-control">
<option value="">select...</option>
<t t-foreach="states or []" t-as="state">
<option t-att-value="state.id" style="display:none;" t-att-data-country_id="state.country_id.id" t-att-selected="state.id == checkout.get('state_id')">
<t t-esc="state.name"/>
</option>
</t>
</select>
</div>
</form>

- Choose your delivery method (website_sale_delivery.payment_delivery):

<data name="Delivery Costs" inherit_id="website_sale.payment">
<xpath expr="//div[@id='payment_method']" position="before">
<div t-if="deliveries" class="row" id="delivery_carrier">
<div class="col-lg-5 col-sm-6">
<h4>Choose your Delivery Method</h4>
<ul class="list-unstyled">
<li t-foreach="deliveries" t-as="delivery">
<t t-if="delivery.available">
<label>
<input t-att-value="delivery.id" type="radio" name="delivery_type" t-att-checked="order.carrier_id and order.carrier_id.id == delivery.id and 'checked' or False"/>
<span t-field="delivery.name"/>
<span class="badge" t-field="delivery.price" t-field-options="{ &quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;website.pricelist_id.currency_id&quot; }"/>
</label>
</t>
</li>
</ul>
</div>
</div>
</xpath>
</data>


Regards <3