Programmatically Add Grouped Product to Cart in Magento

Share
Posted on February 27th, 2012 | Posted by admin

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>;

I can’t add a product to my wishlist – Magento

Share
Posted on February 14th, 2012 | Posted by admin

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.

How to Add Custom Tabs to Magento Customer Edit page

Share
Posted on January 16th, 2012 | Posted by admin

Magento Provides the manage customers feature to list and edit the customers information.
The Customer edit page in the admin panel gives details about the customers account information,address,orders etc.

In some scenarios we may need to show our custom module contents related to the customer in a additional tab. To achieve this functionality we need to create a custom module and add our tab.

Step 1: We start with our config.xml file. In this file we are specifying an adminhtml xml layout file and a Block class for our custom module.

app/code/local/Mydons/etc/config.xml

How to add additional row limit count in magento admin grid

Share
Posted on January 16th, 2012 | Posted by admin

Magento Provides the Grid Based Layout in adminpanel pages for most of the pages like manage customers,manage products etc. The default row limit options are 20,50,100,200 etc per page. But for the stores with more than 1000 products and customers these options are not sufficient to display the records in less no. of pages.

Step 1: For this example we are going to add an additonal row limit count as 500. To do this locate the file which is reponsible for showing row count dropdown. The file is located in

app/design/adminhtml/default/default/template/widget/grid.phtml

Step 2: Around line 81 the code is located as shown below

How to add Datepicker to Magento Forms

Share
Posted on January 11th, 2012 | Posted by admin

Magento has a built in library for calendar functionalities. However the calendar library is available only on Admin pages like Customer Grid,Customer Account view page,Sales order Grid etc. We can extend the prototype Javascript library’s calendar functions to frontend.

Step 1: Edit the page.xml file in your current theme in the directory app/design/frontend/default/yourthemename/layout/page.xml Around line 65 add the below lines in between
<block type=”page/html_head” name=”head” as=”head”> </block >

Page 1 of 3123»