- 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

Code - Model class trong Magento


$headBlock->setTitle($title);
$product = $this->getProduct();
            $title = $product->getMetaTitle();
$currentCategory = Mage::registry('current_category');
setDescription(Mage::helper('core/string')

// if this is a product view page
            if (Mage::registry('product')) {
//Vòng loop foreach================
<?php foreach ($_filters as $_filter): ?>
    for every Item
<?php endforeach; ?>

<?php $subs = $obj->getCurrentCategory()->getAllChildren(true); ?> //getting ids of subcategories of current category

$_regularPrice = $product->getPrice();
        $_finalPrice = $product->getFinalPrice();

Mage::app()
Mage::helper('tax')
Mage::helper('core')

$collection = Mage::getModel('catalog/product')->getCollection(); 
$collection->addAttributeToSelect('brand');
$collection->addAttributeToFilter();

$this->getSkinUrl('images/header/az_marker100.jpg')) will output:
http://yourwebsite.com/skin/frontend/default/MG03C20024/images/header/az_marker100.jpg


0 nhận xét:

Đăng nhận xét