Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Delivery costs on shopping cart

By
Laura
on 4/20/16, 8:04 AM 385 views

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). -->
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="{ "widget": "monetary", "display_currency": "website.pricelist_id.currency_id" }"/>

                    </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="{ "widget": "monetary", "display_currency": "website.pricelist_id.currency_id" }"/>

                            </label>

                        </t>

                    </li>

                </ul>

            </div>

        </div>

    </xpath>

</data>


Regards 

0
Laura
On 4/25/16, 2:28 AM

Link of image:  https://www.odoo.com/web/content/2273149?download=true 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/20/16, 8:04 AM
Seen: 385 times
Last updated: 4/25/16, 2:28 AM