{{block type=”core/template” name=”list-categories” template=”catalog/category/newPage.phtml”}}
Tag Archives: PHP
Site URL Magento
IN PHTML PAGE
==============
SECURE SKIN URL -<?php echo $this->getSkinUrl(‘images/ sampleimage.gif’, array(‘_secure’=>true)) ?>
CRRENT URL – Mage::helper(‘core/url’)->getCurrentUrl();
HOME URL – Mage::helper(‘core/url’)->getHomeUrl();
MEDIA URL – Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
SKIN URL – Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
STORE URL – Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
JS URL – Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
NON SECURE SKIN URL – <?php echo $this->getSkinUrl(‘images/sampleimage.jpg’) ?>
IN STATIC BLOCK
================
BASE URL -{{base url=’yourstore/mypage.html’}}
MEDIA URL – {{media url=’/sampleimage.jpg’}}
SKIN URL – {{skin url=’images/sampleimage.jpg ‘}}
STORE URL – {{store url=’mypage.html’}}
magento include static block in phtml
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘block_id’)->toHtml() ?>
Add Static Block To Static Block Magento
{{block type=”cms/block” block_id=”block-id”}}
Add Static Block to CMS Page Magento
{{block type=”cms/block” block_id=”block-id”}}
Magento Custom Query Modify Category Page Layout
Run the below given script . It will set the value “’three_columns’” to the field “Page Layout” of all categories .
$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$updateQry = “UPDATE catalog_category_entity_varchar SET value=’three_columns’ WHERE attribute_id=’61’ “;
$write->query($updateQry);
Magento Custom Query Insert Data
$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$insertQry = “INSERT INTO customer_entity_int (entity_type_id, attribute_id) VALUES(1, 224)”;
$write->query($insertQry);
Magento Custom Query Update Data
$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$updateQry = “UPDATE catalog_category_entity_varchar SET value=’three_columns’ WHERE attribute_id=’61’ “;
$write->query($updateQry);
Magento Custom Query Select Data
$read = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);;
$selectQry = “SELECT * FROM catalog_category_entity”;
$write->query($selectQry);
How to write a Custom SQL Query Magento
To select the data
$read = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);;
$selectQry = “SELECT * FROM catalog_category_entity”;
$write->query($selectQry);
To add/modify data
$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$updateQry = “UPDATE catalog_category_entity_varchar SET value=’three_columns’ WHERE attribute_id=’61’ “;
$write->query($updateQry);