If you are trying to add a custom tab to the product add/edit page in Magento admin, then you are at the right place. Today I will tell you a damn simple method to add the custom tab to product add/edit page. We will have to add few lines to the xml layout file of your custom module. Then create a phtml file that contains the html part to be shown in the tab.
Programmatically Add Grouped Product to Cart in Magento
Adding simple products to cart through custom PHP code is pretty straight forward. You just need to call the ‘$cart->addProduct()’ function with the product_id and quantity as parameters. But if you want to add grouped products to cart through your code, you will need to perform few additional steps. The process is very easy – create an ‘$super_group’ array of the associated products with the specified quantities. Then you need to pass the array to the ‘addProduct()’ function. See the actual code below that makes it work:
<?php //Array for holding the associated products $super_group = array(); //Id of the grouped product $parentId = <grouped_product_id>;
One of our clients at the office had a store and the “wishlist” button in the product view wasn’t working.
The products he was trying to add weren’t in the root category.
You must add your products at least to the root category.
Customizing the ‘New Order Confirmation Email‘ template in Magento may be a havoc for the first time if you do not know the write way. But it is as easy as anything. Recently I needed to customize the item information in the ‘New Order Confirmation Email’. I googled a number of links but found nothing useful. Then I decided to find my own way, and after 2 hours of hard work I found a simple way. Here are the steps to customize the email template:
1. In the Magento Admin panel go to ‘System > Transactional Emails’ and click on ‘Add New Template’.
2. In the ‘Load default template’ container select ‘New Order’ in the ‘Template’ dropdown. Alse select our desired ‘Locale’.
3. Click on ‘Load Template’. It will load the Default email template to edit for you. Now you can edit the ‘Template Subject’ and ‘Template Content’ to suit your needs. See the following screenshot:
While working in Magento you may sometimes run into situations where you would like to override the functionality of the Magento core controllers. But you cannot edit the core controllers of Magento as it will hinder you from upgrading your Magento version. So we have to find a simple solution for that. Don’t worry, today we will see how to override Magento core controllers.
For this, you have to create a custom module. If you do not know how to create a custom module, then read this post.
Now suppose we want to override the checkout/cart controller. To do this, we will have to edit just two files in our custom module.
Suppose our custom module is present in the namespace ‘Company’ and our module is named as ‘Web’.