Tag Archives: PHP
Modify site url magento
How to change currency magento
Install new theme magento
“new-theme ” is the theme name .
app/design/frontend/new-package/new-theme
skin/frontend/new-package/new-theme
NOTE : FYI , By default “base” is the package name and “default” is the theme name as far as the design
part is concerned .
In case of css and images , magento use files from the package “default” also .
2) Move the folders “app” and “skin” of the new theme to the root of your magento installation so that these
files will get merged with the existing magento folders “app” and “skin”.
make sure that the folders are moved .
3) Then after logged into the admin panel , go to system -> configuration and click on the option (sidebar
menu) “Design” under the main category “general” .
Fill the fields and under the tabs “Package” and “Theme” and save the data .Have a look at the below
given image .
Remove admin menu wordpress
function hide_menu() {
global $menu;
$restricted = array(__(‘Dashboard’), __(‘Posts’), __(‘Media’), __(‘Plugins’));
end ($menu);
while (prev($menu)){
$value = explode(‘ ‘,$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){unset($menu[key($menu)]);}
}
}
add_action(‘admin_menu’, ‘hide_menu’);
?>
Edit “Send Emails To ” email on contact us page – Magento
Number of lines in a text file – PHP
<?php
$fp = “test.txt”;
$number = count(file($fp));
echo ” $number lines “;
?>
Remove characters except letters and numbers from a string – PHP
<?php
$var = “!P$%H^P&”;
$var1 = ereg_replace(“[^A-Za-z0-9]”, “”, $var);
echo $var1;
?>
PHP script’s memory usage
<?php
echo “Before the loop – “.memory_get_usage() . “<br >”;
for($i=0;$i<=100;$i++) { //echo $i;}
echo “n After the loop – “.memory_get_usage() . “n”;
?>
Check whether a module is installed – Magento
$modules = Mage::getConfig()->getNode(‘modules’)->children();
$modulesArray = (array)$modules;
if(isset($modulesArray[‘Mage_Blogl’])) {
echo “Blog module exists.”;
}
?>