Thêm 1 position vào vị trí trong sản phẩm của virtuemart
Về vị trí của custom fields, thông thường để normal
Vào file defaul.php ở thư mục /components/com_virtuemart/views/productdetails/tmpl/
Và tìm các vị trí theo từ khóa customfields nhé
Các vị trí có sẵn là
VỊ TRÍ ONTOP
PHP:
if (!empty($this->product->customfieldsSorted['ontop'])) {
$this->position = 'ontop';
echo $this->loadTemplate('customfields');
} // Product Custom ontop end
?>
VỊ TRÍ NORMAL
PHP:
<?php
if (!empty($this->product->customfieldsSorted['normal'])) {
$this->position = 'normal';
echo $this->loadTemplate('customfields');
}
?> </span>
VỊ TRÍ ONBOT
PHP:
if (!empty($this->product->customfieldsSorted['onbot'])) {
$this->position = 'onbot';
echo $this->loadTemplate('customfields');
} // Product Custom onbot end
Vị trí thông thường nhất
<?php
$modules =& JModuleHelper::getModules('position-mh10');
foreach ($modules as $module) {
echo JModuleHelper::renderModule($module);
}
?>
HÃY VIẾT CODE THEO MẪU TRÊN VÀ ĐẶT VÀO VỊ TRÍ BẠN THÍCH, THÔNG THƯỜNG LÀ DƯỚI GIÁ SẢN PHẨM
VÀ KHI KHÁCH VÀO GIỎ HÀNG, SỐ TIỀN SẼ TỰ ĐỘNG THEO CẤU HÌNH