Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
280 Представления

A block with the product name, price, and the “add to cart” button is displayed to the right of the product photo and duplicated below the photo again. I cannot remove this block through the visual editor. How can I remove it?

Аватар
Отменить
Лучший ответ

Hii,


Option 1:

Reset the QWeb Template to Default (Directly in Odoo UI)

Go to Odoo backend
→ Activate Developer Mode
(Settings > Activate Developer Mode)

Navigate to
Website > Configuration > Templates

Search for the template
In the search bar, type:

website_sale.products_item

  1. Open the template
  2. If the template shows a "Custom" label in the top-right:
    • Click on "Restore to Default" (top-right corner button)
    • Confirm
  3. Refresh your website
    The duplicate block should now be gone.


Option 2

Custom override to remove duplicate block

Create a new XML file in your custom module (e.g. views/fix_product_template.xml) and add this:

<odoo>

  <template id="fix_website_sale_products_item" inherit_id="website_sale.products_item">

    <!-- Remove duplicated block below image -->

    <xpath expr="//div[contains(@class, 'product_price')]" position="after">

      <xpath expr="//div[contains(@class, 'oe_product_cart')]" position="replace"/>

    </xpath>

  </template>

</odoo>

Add it to your __manifest__.py:

'data': [

    'views/fix_product_template.xml',

],

​Then:

  • Upgrade your module
  • Refresh the website
  • Clear browser cache (or hard refresh)

i hope it will work

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
апр. 25
2018
2
янв. 25
3131
0
окт. 23
1501
1
сент. 22
2212
0
июн. 16
3106