Tag Archives: Magento

10 useful Magento extensions

10 useful Magento extensions

Whether your web-shop is already generating revenue or it’s at it’s very beginning, it’s always good to enhance it where it’s needed especially if it’s for free.

Read more

20

Inchoo becomes Magento Professional Partner

Inchoo becomes Magento Professional Partner

Inchoo has officially become a Magento Professional Partner. With this step, Inchoo joins an international roster of Magento Solution Partners as the first partner in Southeastern Europe.

Read more

8

How to create Magento payment module

How to create Magento payment module

Here is small example which will explain how to create a simple Magento payment module.

Read more

42

Varien is now Magento Inc.

Varien is now Magento Inc.

While I was checking today some Linkedin profiles, I noticed the fact that some people abandoned Varien. For those of you who don’t know, this is a company that created Magento. I’ll be honest and say that I had a moment of fear since our business is closely tied to Magento success. My worries went away the same second when I clicked on varien.com link. The step is logical.
Read more

1

How to sell vuvuzelas to aliens?

How to sell vuvuzelas to aliens?

How a typical day dealing with Magento inquiries went horribly well…

Read more

3

Mysteries of Magento Encryption Key

Mysteries of Magento Encryption Key

If you ever went through Magento installation process, you know that at some point you are asked for Magento Encryption key. Magento will automatically generate one for you if you do not enter anything in this field. For first installation, this is just fine. You will see a note that Magento uses this key to encrypt passwords, credit cards and more. Is this really the case?

Read more

11

Last things first

Last things first

The items on this list are essential for any store owner to go through before launching their online store. We’ve covered some of these topics before and this post is to serve as a must-be checklist in order to ensure flawless user experience.

Read more

6

Magento 1.4.1.0 – Mini review and a “Thank you for the PayPal cleanup”

Magento 1.4.1.0 – Mini review and a “Thank you for the PayPal cleanup”

Finally Magento 1.4.1.0 has been released. Its been “forever” since we got stuck with Magento 1.4.0.1. Anyhow, its always nice to have updated, bug fixed, and a bit improved version of your software. Especially if it brings money to your table. Hope all of you site owners will enjoy this new release. Read more

31

GoNab!t – Shopping Social in Middle East

GoNab!t – Shopping Social in Middle East

“We just sold another one!”, cried Dan Stuart after 25 people ordered “AED 50 for AED 100 Worth of Authentic Lebanese Cuisine at Mashawi” deal. Only few hours later the deal is sold 66 times. GoNabit.com is a new Shopping Social site that offers users the chance to get money off a different service or product each day if enough people across that city sign up. This is the first group-buying platform in the Middle East, launched in Dubai last week and will be available in Abu Dhabi shortly afterwards. Those of you tech-geeks readers are probably guessing it right. It is powered by Magento!
Read more

4

Programatically create attribute in Magento, useful for the “on the fly” import system

Sometimes when doing an import in Magento from old shop system you are faced with lot of issues related to attributes. For instance your old shop system might have several product attributes that simply do not fit into the default Magento attributes. In such cases you need to create these attributes manually in the Magento admin, assign them to the appropriate attribute set and then construct a valid CSV file with valid column names for these new attributes.

When you are dealing with large shop systems, with several thousands of products, then actions like these need to be handled programatically. Below is a just a fraction of the code from the full import script I have been working on last few days.

private function createAttribute($code, $label, $attribute_type, $product_type)
{
	$_attribute_data = array(
		'attribute_code' => 'old_site_attribute_'.(($product_type) ? $product_type : 'joint').'_'.$code,
		'is_global' => '1',
		'frontend_input' => $attribute_type, //'boolean',
		'default_value_text' => '',
		'default_value_yesno' => '0',
		'default_value_date' => '',
		'default_value_textarea' => '',
		'is_unique' => '0',
		'is_required' => '0',
		'apply_to' => array($product_type), //array('grouped')
		'is_configurable' => '0',
		'is_searchable' => '0',
		'is_visible_in_advanced_search' => '0',
		'is_comparable' => '0',
		'is_used_for_price_rules' => '0',
		'is_wysiwyg_enabled' => '0',
		'is_html_allowed_on_front' => '1',
		'is_visible_on_front' => '0',
		'used_in_product_listing' => '0',
		'used_for_sort_by' => '0',
		'frontend_label' => array('Old Site Attribute '.(($product_type) ? $product_type : 'joint').' '.$label)
	);

	$model = Mage::getModel('catalog/resource_eav_attribute');

	if (!isset($_attribute_data['is_configurable'])) {
		$_attribute_data['is_configurable'] = 0;
	}
	if (!isset($_attribute_data['is_filterable'])) {
		$_attribute_data['is_filterable'] = 0;
	}
	if (!isset($_attribute_data['is_filterable_in_search'])) {
		$_attribute_data['is_filterable_in_search'] = 0;
	}

	if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {
		$_attribute_data['backend_type'] = $model->getBackendTypeByInput($_attribute_data['frontend_input']);
	}

	$defaultValueField = $model->getDefaultValueByInput($_attribute_data['frontend_input']);
	if ($defaultValueField) {
		$_attribute_data['default_value'] = $this->getRequest()->getParam($defaultValueField);
	}

	$model->addData($_attribute_data);

	$model->setEntityTypeId(Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId());
	$model->setIsUserDefined(1);

	try {
		$model->save();
	} catch (Exception $e) { echo '<p>Sorry, error occured while trying to save the attribute. Error: '.$e->getMessage().'</p>'; }
}

The import I was running had to deal with grouped and simple products (that go on that grouped products). Besides special attributes that only grouped products had, and some special attributes that only simple products have, system also had some “joint” attributes that both of the product types had. Examples below show how I called the above method to generate such specific or “joint” attributes.

//My "grouped product only" attribute
$this->createAttribute(strtolower("ShirtType"), "ShirtType", "select", "grouped");

//My "simple product only" attribute
$this->createAttribute(strtolower("Swatch"), "Swatch", "text", "simple");

//My "joint" attribute, the one that I had both on simple and on grouped products
$this->createAttribute(strtolower("InventoryMsg"), "InventoryMsg", "text", "");
$this->createAttribute(strtolower("Complete"), "Complete", "boolean", "");

Hope that above example help someone. Cheers.

3