You can resize image with fixed height and variable width. Or, you can resize with fixed width and variable height. Following code shows how you do it in Magento. Fixed width of 600px
The following code gives you the current url of the page you are:- $currentUrl = $this->helper(‘core/url’)->getCurrentUrl(); // Gives the base url of your magento installation $baseUrl = Mage::getBaseUrl();
When you fetch product data, you get the price as integer. Now, you must display the price with currency suffix. You can do this with the following code:- // let $_finalPrice be the integer price fetched
Set a custom session with Variable Name ‘testing_magento’. The session value here is ‘hello’. Mage::getSingleton(‘core/session’)->setTestingMagento(‘hello’); Get session testing_magento $test = Mage::getSingleton(‘core/session’)->getTestingMagento();
You can choose the view option as grid only or list only. The default is Grid/List. You can change it to List/Grid as well. For this, you have to go to System->Configuration->Catalog->Frontend
You can add html elements dynamically with Javascript. In this article, I will show you how to do so. I have created two Javascript functions. One for creating html elements and the other for removing them. In my html elements, I have created ‘li’ and ‘strong’ elements inside ‘div’. The div id is ‘summary’. I [...]
In this article, I will be showing you how to create and read xml document with php’s DOMDocument. The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. Below is the code to create XML file. I have named the output file ‘example.xml’. For better understanding, I have [...]
I had to work on multi-dimensional array with javascript and php. I had a multi-dimensional array in php. I had to load it into javascript array and then populate the html selection list. The challenge for me was to create multi-dimensional array in javascript and populate selection list with for loop in javascript.
In this article, I will be showing you how to create and read xml document with php’s SimpleXML extension. The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators.
I used JoomlaPack for backing up my Joomla! CMS site and I cannot stop writing about it. It’s simple, easy to use, quick, efficient and moreover it’s FREE. It creates a full backup of your site in a single archive. The archive contains all the files, a sql file with database script and a restoration [...]
Twitter, Facebook and wordpress are all popular and fascinating. You publish an article in your wordpress blog. And you may want to publicize your article in twitter and facebook through status update separately. It would be very easy and time saving if I could publicize my blog article in twitter and facebook as soon as [...]
I recently chanced upon this new website rank checking tool called KPMRS that has been making waves in the online marketing community and the Google top-ranking lists alike. This nifty service allows you to check your Website Rankings for particular keywords on popular search engines such as Google, Yahoo and Bing, all at one place. Apart from [...]
I was thinking of a wordpress plugin for google adsense that would make me easy to add adsense on my sidebars and on my post. I did search for a flexible one but could not find any satisfactory result. So, thought of making one by myself. I just created a simple wp plugin named ‘Quick [...]
Problem: I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the
Remember that, Sample Data must be installed prior to the basic Magento Installation. But never mind if you forgot to install sample data before installing Magento. Here, I will show you how you can install sample data after you have installed Magento.