Tag Archives: product
12

Getting selected simple product id in configurable product on client side.

Getting selected simple product id in configurable product on client side.

If you need to get id of selected simple product in configurable product on client side you can do it in many different ways.

Here is simple function how to achieve that with no code modification, new templates or even modules.
Just one Javascript file and layout update.

Read more

0

Multiple configurable products with options on one page in Magento

Multiple configurable products with options on one page in Magento

Displaying configurable products with options on one page can be problem because Javascript in Magento is setup to work only with one configurable product.
You can write your own Javascript or U can reuse Magento code.
Read more

12

Display HTML code (block) of product options in Magento

Display HTML code (block) of product options in Magento

This simple helper will help you to display html code of your product options. It works with simple, virtual and configurable products. I believe you can use the same approach for other product types as well.

Getting HTML code for options of configurable products its little different from simple and virtual (well they are more or less same).

Update: for all types in configurable product.

Read more

1

Enhanced Catalog Product Grid – Custom Attribute Filter

Enhanced Catalog Product Grid – Custom Attribute Filter

Sometimes one needs to have additional filtering criteria inside of a catalog’s product grid. Here is an extension that adds custom product attribute to search filter. You can choose to use any product attribute and it will be shown in the product grid.

Read more

19

How to make configurable options autoselected on Product view page

How to make configurable options autoselected on Product view page

If you ever tried to do anything with Magento configurable products view page, most likely you needed changes in  /js/varien/product.js in case you wanted to manipulate dropdowns.

This will be one of the ways to do it. Read more

3

Importance of product presentation

Importance of product presentation

We all now that image is everything, especially when you’re selling the product online. There are some obvious facts that need to be taken into concern. This post will include some (IMHO) valuable reminders and a checklist for the shop owners willing to reevaluate their product presentation.
Read more

1

How to create a new product type in Magento

How to create a new product type in Magento

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. Read more

26

Magento: How to import additional images for products

Magento: How to import additional images for products

We did a migration from CRE LOADED (osCommerce clone) to Magento and we had to import all products with additional images. Every products had from 4 to 6 images which was a problem because Magento doesn’t have built-in ability to upload multiple images for products.

Read more

6

Adding simple Tweet this for Magento products

Adding simple Tweet this for Magento products

There are few different ways one can achieve this kind of functionality. Normally in Magento you would do it like a real, “independent”, module (extension) thus loosing at least two ours to make a few lines of code work. Read more

10

Programatically (manually) creating simple Magento product

Here is a working sample of code for programatically (manually) creating simple Magento product from within your custom code.

<?php

//$product = Mage::getModel('catalog/product');
$product = new Mage_Catalog_Model_Product();

// Build the product
$product->setSku('some-sku-value-here');
$product->setAttributeSetId('some_int_value_of_some_attribute');
$product->setTypeId('simple');
$product->setName('Some cool product name');
$product->setCategoryIds(array(7)); # some cat id's, my is 7
$product->setWebsiteIDs(array(1)); # Website id, my is 1 (default frontend)
$product->setDescription('Full description here');
$product->setShortDescription('Short description here');
$product->setPrice(39.99); # Set some price    

# Custom created and assigned attributes
$product->setHeight('my_custom_attribute1_val');
$product->setWidth('my_custom_attribute2_val');
$product->setDepth('my_custom_attribute3_val');
$product->setType('my_custom_attribute4_val');

//Default Magento attribute
$product->setWeight(4.0000);

$product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
$product->setStatus(1);
$product->setTaxClassId(0); # My default tax class
$product->setStockData(array(
    'is_in_stock' => 1,
	'qty' => 99999
));

$product->setCreatedAt(strtotime('now'));

try {
	$product->save();
}
catch (Exception $ex) {
	//Handle the error
}

?>

Although the process seems pretty straight forward, keep an eye on setStockData method. I was getting some foreign key constraint errors when trying to create instance of stock item then save it into the product object. The above code should handle it quite nicely. Tested on latest Magento version, which is 1.3.2.3 as of time of this writing.

7
12