Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2174 มุมมอง

Hello all,

I need some help with a small HTML customization. 

On our website we have many product variants, and each variant has a SKU or "Internal Reference" number. I would like to display this number on the main product page, so every time someone chooses a different variant, it updates the Internal Reference number so they can specify it in an email.

I have attached a screenshot of what it looks like when you click the "add to cart" popup button on the main shop page, and I want to add/replicate the text circled in red, however I do not know what piece of the HTML creates this. 

Please let me know what the code is and where I can put it on the main product page for it to show up as seen in the second screenshot with the arrow. 


Screenshot 1: see the internal reference circled, and the HTML, which part is it?




Screenshot 2: The arrow is pointing to where I want the internal reference to show, where do I put the code to achieve that? 




Thanks!

อวตาร
ละทิ้ง
ผู้เขียน

anyone can help?

คำตอบที่ดีที่สุด

Hi,

Add the below code in the HTML/CSS Editor of the Product page as shown in the provided screenshot:
<h1 itemprop="name">
<t t-if="product_variant.default_code"><span t-esc="product_variant.default_code"/></t>
<span t-field="product.name"/>
</h1>


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

Thanks! Works as far as putting the number on the page. Do you have a way of making it change when I choose a different variant?

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ธ.ค. 24
51
2
มี.ค. 24
10147
2
มี.ค. 24
1963
1
ก.พ. 24
1660
0
มี.ค. 15
5062