Magento themes and extensions

How to create a new product type in Magento

Share
Posted on May 27th, 2011 | Posted by admin

Magento comes packed with several product types: simple, grouped, configurable, virtual, bundle, downloadable. Sometimes clients request can reach beyond any of these built in product types functionality. In such cases, usual way of handling things is throwing some new attributes and hooking into some events from which you can handle and “re-route” certain logic.

In some cases, the required product logic can extend to such level that you are better of with building a new product type in Magento. Why, you might ask? Becase of the more finer control you can achieve on product trough your own models than to poke around on the existing stuff.

Attached to this article is a fully working extension I wrote that creates a new product type in your Magento store. This new product type uses code name “customproduct”. Its based on the Mage_Catalog_Model_Product_Type_Abstract class, the one on which the “simple” product is build upon. Unlike “simple” product type, this “customproduct” does not have any, whatsoever, additional logic built in. This, I leave to you.

Also, extension comes with several “hooks” to certain Magento controllers actions. If you open the app/code/local/Ajzele/CustomProduct/Model/Observer.php you will see implemented several “blank” methods as hooks. Going to config.xml file of this extension will show you what these methods “observe”.

Magento: Get Bundled Items By Bundle Product

Share
Posted on May 26th, 2011 | Posted by admin

This post is just a small snippet that will help you to get all products that are used do construct any bundle product.

Of course, I’m not sure how useful can it be as is, so if you need optimized version of it, you will need to play with it for a while.

You will need some basic knowledge of PHP language in order to fix formatting issues that you may (not saying that you will) encounter due strange behavior of code display plugin in wordpress.

I tried to find it on google few days ago and I had no luck, so if anybody has better solution, please comment.

Here we go:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
< ?php
$bundled_product = new Mage_Catalog_Model_Product();
$bundled_product->load(YOUR_BUNDLED_PRODUCT_ID);
$selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
$bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
);
$bundled_items = array();
foreach($selectionCollection as $option)
{
$bundled_items[] = $option->product_id;
}
print_r($bundled_items);
?>

Source: http://inchoo.net/ecommerce/magento/magento-get-bundled-items-by-bundle-product/

Programatically add bundle product to cart in Magento

Share
Posted on May 26th, 2011 | Posted by admin

Sometimes, clients requirements exceed the defaults built into the Magento. Recently we came across a task that among other things required manipulation of bundle products in Magento. In order to help my coworker Tomas I wrote this little code snippet that

Is Magento right for me?

Share
Posted on May 25th, 2011 | Posted by admin

Choosing a platform on which to build your business is by no means an easy task. One must as itself, how much money, personal time and effort is he willing to put into it. There are numerous free and open source solutions that promise an easy ride. Since I’m in business of PHP development, here are few platforms worth mentioning X-Cart, osCommerce, PrestaShop, Oxid, Magento, etc.

By now, everyone in open source eCommerce shop business has probably stumbled upon Magento. This is most likely the youngest (latest), most robust platform out there at the moment. It’s built on the back of the powerful and robust Zend Framework.

Using Magento’s Import/Export Profiles

Share
Posted on May 25th, 2011 | Posted by admin

lthough it is fairly simple to do, many Magento users offer encounter difficulties when attempting to use the import functionality built in to Magento. We see a fair number of inquiries about this here at the Magento Enterprise Support Desk, so we’ve decided to write a little tutorial to help you better understand and use Magento’s Import Profile.

First, let’s take a look at how to create an import file, which will include all the data we want to bring into Magento. To get the correct fields and values, we recommend exporting a product, i.e. a simple product or configurable product, through the Admin. This is done through ‘System -> Import/Export -> Profiles’.

Page 31 of 47« First...1020«2930313233»40...Last »