- Học nghệ thuật đầu tư dựa trên giá trị.
- Kinh nghiệm đầu tư thành công.

Được tạo bởi Blogger.

Thứ Năm, 23 tháng 10, 2014

Products - Thêm thông tin mã hàng SKU vào trang product trong Magento


Mở file template cho trang products tại app/design/frontend/default/your-theme/template/catalog/product/view.phtml

Ngay sau đoạn code:
<div class="product-name">
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
</div>



Thêm code sau đây:
<?php echo $this->htmlEscape($_product->getSku()) ?>

hoặc:
<?php echo nl2br($_product->getSku()) ?>

Cấu hình trong Backend
Catalog > Attributes > Manage Attributes > [...search for sku...] > Frontend Properties > Visible on Product View Page on Front-end > Yes > Save

0 nhận xét:

Đăng nhận xét