跳至內容
選單
此問題已被標幟
1 回覆
300 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
4月 25
2029
2
1月 25
3145
0
10月 23
1509
1
9月 22
2223
0
6月 16
3108