before=”-” – It lists as the first block
after=”-“- It lists as the last block
before=”block_name” – To load before a block
after=”block_name” – To load after a block
Monthly Archives: August 2012
Check if a string exists javascript
<script type=”text/javascript”>
if(window.location.href.indexOf(“https:”) > -1) {
alert(“its a secure URL”);
}
</script>
Replace a string javascript
<script type=”text/javascript”>
var string=”PHPCode”;
string=string.replace(“Code”,”Codez”);
alert(string);
</script>
Completely disable any caching PHP
<?php
header(“Expires: Tue, 07 Aug 2000 08:00:00 GMT”);
header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”);
header(“Cache-Control: no-store, no-cache, must-revalidate, max-age=0”);
header(“Cache-Control: post-check=0, pre-check=0”, false);
header(“Pragma: no-cache”);
?>
Linux command to list only files
ls -la |grep ^-
Linux command to list only directories
ls -la -d */
or
ls -la |grep ^d
Get user group magento
<?php
echo Mage::getSingleton(‘customer/session’)->getCustomerGroupId();
?>
Check user is logged in or not magento
<?php
if($this->helper('customer')->isLoggedIn())
echo “logged in”;
?>
Gateway error: (TESTMODE) The merchant login ID or password is invalid or the account is inactive Magento
If you are testing the authorise.net in test mode make sure that Gateway URL is
https://test.authorize.net/gateway/transact.dll
If its in live mode make sure that the details you have given are correct and the authorize.net account is active .
Check the if the products is grouped or not Magento
if(Mage::helper(‘core’)->escapeHtml($product->getTypeId())==”grouped”)
echo “Grouped Product”;