Ir al contenido
Menú
Se marcó esta pregunta

Hello All,

I am using Odoo 17 Online.

I realized today that the mobile wishlist page looks terrible. I updated the HTML so that the formatting was mobile friendly. Everything looks great, but when I try to click the add to cart or remove buttons on the mobile version it says:



I've looked over the code and I don't know where it's going wrong, can someone help? Here is the code below: It's got two sections, a table section for desktop views and a mobile version.

Template ID: website_sale_wishlist.product_wishlist


Avatar
Descartar
Autor

Sorry, Odoo won't let me post the code without it displaying it, so stupid.....

<t name="Wishlist Page" t-name="website_sale_wishlist.product_wishlist">
<t t-call="website.layout">
<t t-set="additional_title">Shop Wishlist</t>
<div id="wrap" class="js_sale">
<div class="oe_structure" id="oe_structure_website_sale_wishlist_product_wishlist_1"/>
<div class="container oe_website_sale pt-3">
<section class="container wishlist-section">
<h3>My Wishlist</h3>
<div class="checkbox">
<label class="text-muted">
<input type="checkbox" id="b2b_wish" value="1" class="mr8"/>Add product to my cart but keep it in my wishlist
</label>
</div>
<!-- Existing table for desktop view -->
<table class="table table-bordered table-striped table-hover text-center mt16 table-comparator" style="table-layout:auto" id="o_comparelist_table">
<tbody>
<t t-foreach="wishes" t-as="wish">
<t t-set="combination_info" t-value="wish.product_id._get_combination_info_variant()"/>
<tr t-att-data-wish-id="wish.id" t-att-data-product-id="wish.product_id.id">
<td class="td-img align-middle">
<a t-att-href="wish.product_id.website_url">
<img t-att-src="'/web/image/product.product/%s/image_128' % (wish.product_id.id)" alt="Product image" class="img-fluid"/>
</a>
</td>
<td class="text-start align-middle">
<strong>
<a t-att-href="wish.product_id.website_url"><t t-esc="wish.product_id.display_name"/></a>
</strong>
<div class="product-internal-reference text-muted">
Model Number: <span><t t-esc="wish.product_id.default_code"/></span>
</div>
<button type="button" class="btn btn-link o_wish_rm no-decoration">
<small><i class="fa fa-trash-o"/> Remove</small>
</button>
</td>
<td class="align-middle o_wish_price" t-if="combination_info['prevent_zero_price_sale']">
<span t-field="website.prevent_zero_price_sale_text"/>
</td>
<td class="align-middle o_wish_price" t-else="">
<t t-out="combination_info['price']" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
<small t-if="combination_info['base_unit_price']" class="cart_product_base_unit_price d-block text-muted" groups="website_sale.group_show_uom_price">
<t t-call="website_sale.base_unit_price"><t t-set="product" t-value="wish.product_id"/></t>
</small>
</td>
<td class="text-center td-wish-btn align-middle">
<input name="product_id" t-att-value="wish.product_id.id" type="hidden"/>
<a t-if="combination_info['prevent_zero_price_sale']" t-att-href="website.contact_us_button_url" class="btn btn-primary btn_cta">Contact Us</a>
<button id="add_to_cart_button" t-else="" type="button" role="button" class="btn btn-secondary btn-block o_wish_add mb4">
Add <span class="d-none d-md-inline">to Cart</span>
</button>
</td>
</tr>
</t>
</tbody>
</table>

<!-- Mobile-specific layout -->
<div class="mobile-wishlist">
<t t-foreach="wishes" t-as="wish">
<t t-set="combination_info" t-value="wish.product_id._get_combination_info_variant()"/>
<div class="wishlist-card" t-att-data-wish-id="wish.id" t-att-data-product-id="wish.product_id.id">
<div class="wishlist-image">
<a t-att-href="wish.product_id.website_url">
<img t-att-src="'/web/image/product.product/%s/image_128' % (wish.product_id.id)" alt="Product image"/>
</a>
</div>
<div class="wishlist-info">
<strong>
<a t-att-href="wish.product_id.website_url"><t t-esc="wish.product_id.display_name"/></a>
</strong>
<div class="product-internal-reference text-muted">
Model Number: <span><t t-esc="wish.product_id.default_code"/></span>
</div>
<div class="align-middle o_wish_price" t-if="combination_info['prevent_zero_price_sale']">
<span t-field="website.prevent_zero_price_sale_text"/>
</div>
<div class="align-middle o_wish_price" t-else="">
<t t-out="combination_info['price']" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
<small t-if="combination_info['base_unit_price']" class="cart_product_base_unit_price d-block text-muted" groups="website_sale.group_show_uom_price">
<t t-call="website_sale.base_unit_price"><t t-set="product" t-value="wish.product_id"/></t>
</small>
</div>
<button type="button" class="btn btn-link o_wish_rm no-decoration">
<small><i class="fa fa-trash-o"/> Remove</small>
</button>
<input name="product_id" t-att-value="wish.product_id.id" type="hidden"/>
<a t-if="combination_info['prevent_zero_price_sale']" t-att-href="website.contact_us_button_url" class="btn btn-primary btn_cta">Contact Us</a>
<button id="add_to_cart_button" t-else="" type="button" role="button" class="btn btn-secondary btn-block o_wish_add mb4">
Add to Cart
</button>
</div>
</div>
</t>
</div>
</section>
</div>
</div>
</t>
</t>

Publicaciones relacionadas Respuestas Vistas Actividad
0
ago 24
988
2
jun 24
2066
1
feb 24
4888
1
feb 25
2093
0
nov 24
1200