This tutorial will show how to assign or remove a category from a product in Magento 1. I have used the standalone script, but you can use this in any module. Assign a category to product $productId = 2000; $categoryId = 200; Mage::getSingleton(‘catalog/category_api’)->assignProduct($categoryId,$productId); Remove a category to product $productId = 2000; $categoryId = 200; […]
This tutorial will guide you through the steps to create a custom customer attribute in Magento 1. My use case was to save a mobile application token against the user for further authentication.
Have you heard about Omnichannel retailing? I am sure you have! In fact these buzzwords are the same which fall in the news again and again, but the lack of knowledge becomes the sole reason to dismiss them. Omnichannel retailing is the new customer demand of a business that is pretty much in talks these […]
How to get the Order Id from Shipping Tracking Id. This code would work only if the shipment has created.
Gone are the days when Brick and Mortar used to be the only way of doing business. Now, more than ever, an ecommerce stores has become the way to go and almost everyone can now create an online store to market and sell their products and services. Though, the real question is: How to start […]
In a previous article we have shown how to use direct MySQL raw queries in Magento 1. We have used read and write adapters to execute normal MySQL queries in Magento controllers, models and helpers. In this tutorial we are using built in Magento functions to create, read, update and delete records from database. Before […]
Today’s tutorial are showing how to create a module in Magento 2. When you work in Magento you have to create a custom module at some point. Magento 2 has been around for 2 years now. More people are attracted to Magento’s powerful features and developing more Magento websites in the eCommerce industry. Magento considered […]
A static block in phtml file of Magento, sometimes we need to do this kind of functionality. For instance whenever you want to add one banner image on right side of callout block. banner_image_block_id is the identifier you have created with static block in magento
To get the current store details you can use following code. Gets the current store’s id Gets the current store’s code Gets the current website’s id Gets the current store’sGroup id Gets the current store’s status Gets the current store’s locale Gets the current store’s home url Gets the current store’s name Gets the current […]
Getting started with Magento eCommerce platform doesn’t mean your site is safe and secure. Despite the fact that Magento is the most robust content management system for eCommerce websites, you can’t take its security lightly. You need to take serious measures to combat the security and hacking issues for your web store. In fact, the […]
The following will help you to get attribute names instead of ID numbers when handling product attributes
Getting customer details, there is handy function out there in Magento to achieve this. When working with Magento it’s very common that you need this information. So we are discussing how to get customer details in Magento. Follow the below steps Get customer Id from session in Magento Using the $customerId we can load the […]
Magento’s default contact us form page URL is a little bit awkward as its says http://yourdomain.om/contacts. We can change this easily by creating a small module.
How to get categories for a product in Magento, use the below snippet code anywhere in the magneto.
How to override Magento controller, must be a good practice whenever we want to add/update a new functionality to current Magento controller functions. Why overriding controllers? Controller is the entry point for any incoming request in Magento. To handle this Magento declares numerous functions in the Controller file mainly called actions. Suppose you want to […]
If you want to get the children categories recursively, you can use: Get all children categories given a category id in Magento. This will retrieve all sub – sub categories recursively.
Building a Magento website is easy when comparing to figure out a good Magento hosting solution for the website. There are plenty of Magento hosting recommendations in the internet, but most of them are really confusing and sometimes misleading. Usually Magento developer companies suggest for the server, depending on the load and features of the website. […]
Magento Newsletter Tutorial When running an e-commerce store it is necessary to send out promotional emails and campaigns. Apparently, Magento having built in newsletter functionality and it’s easy to use. It allows site administrators to create and send email campaigns from admin panel. Before going to Magento newsletter page, we just need to set Magento email […]
If you need to redirect to external URLs in Magento you have to use There are similar method uses in Magento to redirect to another Magento internal path. $path would be an internal module/controller/action/param1/param1value page
To do this, go to System => Configuration => Catalog => Catalog => Search Engine Optimization and set “Use categories path for product URL’s” to “no”.
This tutorial mainly demonstrates direct SQL queries in Magento. Magento data models are giving great flexibility for the data processing. We don’t need to touch the complex SQL statements because of this feature. This often gives really quick development speed and accuracy more over a bulletproof approach. But several situations it much needed to execute […]
Using caching in Magento website is an essential part of development. Magento is well known for eating up the server resources. The below code snippet helps when someone deals with heavy data in Magento website.
Products are the basic thing in the e-commerce shop and Magento has good features to create it from the backend. But certain situations we have to create it via programmatically. For example a bulk upload from a API, or another store etc. How to create Magento simple products programmatically We can use API for this, […]
Magento has a good search functionality. By default when someone searches it search through all the description and short descriptions. So sometimes at first look this results appears to be strange. We need Search by only product name in Mini Search In Magento But the reason Magento pick this up because these keywords might be present […]
Getting all sub(recursively) categories in Magento, not an easy task. I’ve seen so many of them looping through the category model and creating overhead to the server. It’s mainly because the each model creates and SQL query. Good performance Single Query Solution: Let $parentCategory be your Main Category, then this collection will load all subcategories, […]
Magento stores all the configuration values in the database, but it has a particular format to retrieve the data. Getting data from system configuration table is easy. sectionName, groupName and fieldName are present in etc/system.xml file of your module. It will automatically fetch config value of currently viewed store as you have the option to enable […]
When we need to get currency code from order object use the below code 1) currency code from order object 2) With currency symbol
When making certain changes to Magento, it is necessary to clear the cache in order to reflect the changes to reflect. There are three ways to clear the cache in Magento: Through the Magento Admin Panel website. Log in to your Admin Panel account Go to the System -> Cache Management section Click on […]
It’s quick way to convert currency from one currency to another in Magento and vice-versa. It is useful when you are using multiple currencies in a shop. From below code, you can convert from currency to another chosen currency. Changing currency from one to another
Getting the category name for the current product in Magento it’s easy to find out with below codes.