Skip to content

Commit

Permalink
version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tzyganu committed Nov 28, 2014
1 parent 4d623bf commit 796fea9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Easylife Switcher
========

Configurable products switcher v2.0.1
Configurable products switcher v2.1.0

This is a Magento extension that allows you to change the configurable products dropdowns to labels, colors or images.
It also allows you to set default configurations, keep the selected options when changing an option from above.
Expand All @@ -11,4 +11,7 @@ For a full list of features with screenshots included check the [Features list]
Please visit the [wiki](https://github.com/tzyganu/Switcher/wiki) for a full description.

Extension is compatible with CE versions 1.7 and after.
**Not tested yet for CE 1.9.1**
The CE 1.9.1 version already comes with a configurable swatches extension.
If you use this extension and disable the core configurable swatches it works without an issue.
If you have both of them enabled, this extension shamelessly hides the elements generated by the core module.
It still seams to work, but test carefully specially if you use a custom theme.
Original file line number Diff line number Diff line change
Expand Up @@ -416,27 +416,27 @@ public function getDefaultValues()
foreach ($simpleProducts as $product) {
/** @var Mage_Catalog_Model_Product $product */
if ($product->getIsSalable() || $this->getAllowNoStockSelect()) {
$default = $product;
//$default = $product;
$defaultId = $product->getId();
break;
}
}
} else {
$default = false;
}
} else {
$default = Mage::getModel('catalog/product')
->setStoreId(Mage::app()->getStore()->getId())
->load($defaultId);
}
if (!$default || !$default->getId()) {
if (!$defaultId) {
return null;
}
$defaultValues = array();
foreach ($this->getAllowAttributes() as $attribute) {
/** @var Mage_Catalog_Model_Product_Type_Configurable_Attribute $attribute */
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $productAttribute */
$productAttribute = $attribute->getProductAttribute();
$defaultValues[$productAttribute->getId()] = $default->getData($productAttribute->getAttributeCode());
$defaultValues[$productAttribute->getId()] = Mage::getResourceModel('catalog/product')
->getAttributeRawValue(
$defaultId,
$productAttribute->getAttributeCode(),
Mage::app()->getStore()->getId()
);
}
return $defaultValues;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
class Easylife_Switcher_Model_Adminhtml_Enabled_Comment
{
public function getCommentText()
{
/** @var Mage_Core_Helper_Data $helper */
$helper = Mage::helper('core');
$hasCoreSwatches = $helper->isModuleEnabled('Mage_ConfigurableSwatches');
if ($hasCoreSwatches) {
return Mage::helper('easylife_switcher')->__('Your magento instance contains the extension "Mage_ConfigurableSwatches". Enabling this might conflict in special cases with that core extension. Test before going live.');
}
return '';
}
}
2 changes: 1 addition & 1 deletion app/code/community/Easylife/Switcher/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<config>
<modules>
<Easylife_Switcher>
<version>2.0.2</version>
<version>2.1.0</version>
</Easylife_Switcher>
</modules>
<global>
Expand Down
3 changes: 3 additions & 0 deletions app/code/community/Easylife/Switcher/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>
<model>easylife_switcher/adminhtml_enabled_comment</model>
</comment>
</enabled>
<transform translate="label" module="easylife_switcher">
<label>Transformation settings</label>
Expand Down

0 comments on commit 796fea9

Please sign in to comment.