تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
283 أدوات العرض

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
أبريل 25
2020
2
يناير 25
3134
0
أكتوبر 23
1502
1
سبتمبر 22
2213
0
يونيو 16
3106