Get customer order count in Magento
Hello All, I am writing here a script snippet for getting the orders count for given customer
Hello All, I am writing here a script snippet for getting the orders count for given customer
I am explaining here the way to display the total quantities ordered in the Product view page. I have used Magento version 1.7.0.2 1) Block file Create a file app/code/local/Mage/Catalog/Block/Product/View/Quantity.php (note the codepool is ‘local’ ) Copy this code in the file and save the file. 2) View File Create a file app/code/design/frontend/default/default/template/catalog/product/view/quantity.phtml I have […]
Hello All, I am writing here the code to get various base directory paths, which might be useful. Assuming the directory is named ‘magento’ where your site is present and its the root directory of the filesystem.
Many of you might have come across the requirement, where they needed to change the order status dynamically. Difference between order state and status State is used by Magento to tell if the order is new, processing, complete, holded, closed, canceled etc.; while Statuses are the one that YOU would be defining at the back-end […]
We the Magento developers work mostly with data collections. For accessing the data we use ‘foreach’ to iterate over collection. What if we need only the first or last item from the collection, Magento gives an alternate way to do this. If you your Collection data as XML, There’s a method for that also If […]
I am writing here an important code snippet for getting the database connection details used in Magento
Hello All, I am writing here an important code snippet for getting the table prefix (if any defined) in Magento.
Many times there arise the need to attach files to the order mail. I am giving here a brief explanation for this: I have used Magento ver. 1.7.0.0 ( In previous version there was no mailer class). 1) Rewrite Sales Class Copy the file found at app\code\core\Mage\Sales\Model\Order.php to app\code\local\Mage\Sales\Model\Order.php Overwrite the `sendNewOrderEmail()’ method found. Here […]
Many times need arises to limit collection for say pagination or for any customization. I am listing here an example which shows how to limit the collection. I have used the Product Model below.
Hello All, This is kind of fun stuff. I was bored and decided to build a Pyramid Program in PHP. Above code on execution will output Enjoy 🙂