Version Notes
v1.3.3 - This version is to support the v1.2.0 community package.
v1.3.4 - this version adds swatch functionality
v1.3.5 - update to documentation
v1.3.6 - updated module dependencies
Download this release
Release Info
Developer | Michael Oxley |
Extension | AdvertiseColors |
Version | 1.3.7 |
Comparing to | |
See all releases |
Code changes from version 1.3.6 to 1.3.7
- Adverti.se Module Docs/Advertise Colors.html +4 -4
- app/code/community/Advertise/Importer/etc/config.xml +1 -1
- app/code/community/Advertise/Importer/sql/importer_setup/upgrade-2.0.1-2.0.2.php +98 -0
- app/design/frontend/base/default/template/importer/configurable.phtml +3 -3
- app/etc/modules/Advertise_Importer.xml +2 -2
- package.xml +4 -4
Adverti.se Module Docs/Advertise Colors.html
CHANGED
@@ -47,14 +47,14 @@
|
|
47 |
color they are selecting with our drop-down.<br />
|
48 |
<br />
|
49 |
When installed the Adverti.se Colors module adds a new configurable attribute
|
50 |
-
<span class="code filename">
|
51 |
-
configurable on the <span class="code filename">
|
52 |
attribute the Adverti.se Colors drop-down will be used for product option selection
|
53 |
in the product pages of your store. <br />
|
54 |
<br />
|
55 |
On most installations the Adverti.se Colors drop-down will
|
56 |
automatically appear for any configurable products selectable on the
|
57 |
-
<span class="code filename">
|
58 |
current theme overrides the default Magento handling of configurable products
|
59 |
you may need to make a simple edit to one theme file for the Colors drop-down to work.<br />
|
60 |
<br />
|
@@ -230,7 +230,7 @@
|
|
230 |
<p>The color names shown here are the 'Admin' labels; frontend color labels for the
|
231 |
colors that you use can be set in your Magento Admin panel here:<br />
|
232 |
<br />
|
233 |
-
<span class="filepath">Catalog → Attributes → Manage Attributes →
|
234 |
<br />
|
235 |
</p>
|
236 |
<hr />
|
47 |
color they are selecting with our drop-down.<br />
|
48 |
<br />
|
49 |
When installed the Adverti.se Colors module adds a new configurable attribute
|
50 |
+
<span class="code filename">advertise_swatch_colors</span>. When products are made
|
51 |
+
configurable on the <span class="code filename">advertise_swatch_colors</span>
|
52 |
attribute the Adverti.se Colors drop-down will be used for product option selection
|
53 |
in the product pages of your store. <br />
|
54 |
<br />
|
55 |
On most installations the Adverti.se Colors drop-down will
|
56 |
automatically appear for any configurable products selectable on the
|
57 |
+
<span class="code filename">advertise_swatch_colors</span> attribute. However, if your
|
58 |
current theme overrides the default Magento handling of configurable products
|
59 |
you may need to make a simple edit to one theme file for the Colors drop-down to work.<br />
|
60 |
<br />
|
230 |
<p>The color names shown here are the 'Admin' labels; frontend color labels for the
|
231 |
colors that you use can be set in your Magento Admin panel here:<br />
|
232 |
<br />
|
233 |
+
<span class="filepath">Catalog → Attributes → Manage Attributes → advertise_swatch_colors → Manage Label / Options</span><br />
|
234 |
<br />
|
235 |
</p>
|
236 |
<hr />
|
app/code/community/Advertise/Importer/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Advertise_Importer>
|
5 |
-
<version>2.0.
|
6 |
</Advertise_Importer>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Advertise_Importer>
|
5 |
+
<version>2.0.2</version>
|
6 |
</Advertise_Importer>
|
7 |
</modules>
|
8 |
|
app/code/community/Advertise/Importer/sql/importer_setup/upgrade-2.0.1-2.0.2.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Update to version 2.0.2
|
4 |
+
*
|
5 |
+
* @package Advertise_Importer
|
6 |
+
*/
|
7 |
+
|
8 |
+
$updater = $this;
|
9 |
+
$updater->startSetup();
|
10 |
+
|
11 |
+
// First rename advertise_colors as advertise_swatch_colors
|
12 |
+
$updater->updateAttribute('catalog_product', 'advertise_colors', array('attribute_code' => 'advertise_swatch_colors', 'frontend_label' => 'Adverti.se Swatch Color'));
|
13 |
+
|
14 |
+
// Then add new advertise_auto_colors
|
15 |
+
$updater->addAttribute('catalog_product', 'advertise_auto_colors', array(
|
16 |
+
'group' => 'General',
|
17 |
+
'label' => 'Adverti.se Auto Color',
|
18 |
+
'type' => 'varchar',
|
19 |
+
'input' => 'select',
|
20 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
21 |
+
'apply_to' => 'simple,configurable',
|
22 |
+
'visible' => true,
|
23 |
+
'visible_on_front' => true,
|
24 |
+
'required' => false,
|
25 |
+
'user_defined' => true,
|
26 |
+
'searchable' => true,
|
27 |
+
'visible_in_advanced_search' => true,
|
28 |
+
'filterable' => false,
|
29 |
+
'comparable' => false,
|
30 |
+
'used_in_product_listing' => true,
|
31 |
+
'option' => array (
|
32 |
+
'value' => array(
|
33 |
+
'option01' => array('Black', 'Black'),
|
34 |
+
'option02' => array('Gray_Dark', 'Dark Gray'),
|
35 |
+
'option03' => array('Gray', 'Gray'),
|
36 |
+
'option04' => array('Gray_Light', 'Light Gray'),
|
37 |
+
'option05' => array('White', 'White'),
|
38 |
+
'option06' => array('Cream', 'Cream'),
|
39 |
+
'option07' => array('Yellow_Light', 'Light Yellow'),
|
40 |
+
'option08' => array('Yellow', 'Yellow'),
|
41 |
+
'option09' => array('Yellow_Dark', 'Dark Yellow'),
|
42 |
+
'option10' => array('Orange', 'Orange'),
|
43 |
+
'option11' => array('Orange_Dark', 'Dark Orange'),
|
44 |
+
'option12' => array('Red_Bright', 'Bright Red'),
|
45 |
+
'option13' => array('Red', 'Red'),
|
46 |
+
'option14' => array('Red_Dark', 'Dark Red'),
|
47 |
+
'option15' => array('Brown', 'Brown'),
|
48 |
+
'option16' => array('Brown_Light', 'Light Brown'),
|
49 |
+
'option17' => array('Beige', 'Beige'),
|
50 |
+
'option18' => array('Pink_Light', 'Light Pink'),
|
51 |
+
'option19' => array('Pink', 'Pink'),
|
52 |
+
'option20' => array('Pink_Dark', 'Dark Pink'),
|
53 |
+
'option21' => array('Pink_Bright', 'Bright Pink'),
|
54 |
+
'option22' => array('Purple_Dark', 'Dark Purple'),
|
55 |
+
'option23' => array('Purple', 'Purple'),
|
56 |
+
'option24' => array('Purple_Light', 'Light Purple'),
|
57 |
+
'option25' => array('Blue_Light', 'Light Blue'),
|
58 |
+
'option26' => array('Blue', 'Blue'),
|
59 |
+
'option27' => array('Blue_Dark', 'Dark Blue'),
|
60 |
+
'option28' => array('Teal', 'Teal'),
|
61 |
+
'option29' => array('Turquoise', 'Turquoise'),
|
62 |
+
'option30' => array('Green_Light', 'Light Green'),
|
63 |
+
'option31' => array('Green', 'Green'),
|
64 |
+
'option32' => array('Green_Dark', 'Dark Green'),
|
65 |
+
'option33' => array('Olive', 'Olive'),
|
66 |
+
)
|
67 |
+
),
|
68 |
+
));
|
69 |
+
|
70 |
+
// Set sort order for colors using a direct SQL queries... there must be a better way but damned if I can find it!
|
71 |
+
// Use gaps of 2 in the ordering to allow possible addition of other colors in future.
|
72 |
+
try {
|
73 |
+
$resource = Mage::getSingleton('core/resource');
|
74 |
+
$writeConnection = $resource->getConnection('core_write');
|
75 |
+
$readConnection = $resource->getConnection('core_read');
|
76 |
+
$query = "SELECT attribute_id FROM " . $resource->getTableName('eav_attribute') . " WHERE attribute_code = 'advertise_colors'";
|
77 |
+
$results = $readConnection->fetchAll($query);
|
78 |
+
$attId = $results[0]['attribute_id'];
|
79 |
+
$allColorsInOrder = "Black,Gray_Dark,Gray,Gray_Light,White,Cream,Yellow_Light,Yellow,Yellow_Dark,Orange,Orange_Dark,Red_Bright,Red,Red_Dark,Brown,Brown_Light,Beige,Pink_Light,Pink,Pink_Dark,Pink_Bright,Purple_Dark,Purple,Purple_Light,Blue_Light,Blue,Blue_Dark,Teal,Turquoise,Green_Light,Green,Green_Dark,Olive";
|
80 |
+
$allColorsArray = explode(',',$allColorsInOrder);
|
81 |
+
$nextPosition = 2;
|
82 |
+
foreach ($allColorsArray as $nextColor) {
|
83 |
+
$query = "SELECT DISTINCT option_id FROM " . $resource->getTableName('eav_attribute_option_value') .
|
84 |
+
" WHERE option_id IN (SELECT option_id FROM " . $resource->getTableName('eav_attribute_option') .
|
85 |
+
" WHERE attribute_id = " . $attId . ") AND value = '" . $nextColor . "'";
|
86 |
+
$results = $readConnection->fetchAll($query);
|
87 |
+
foreach($results as $nextVal) {
|
88 |
+
$query = "UPDATE " . $resource->getTableName('eav_attribute_option') . " SET sort_order = " . $nextPosition . " WHERE option_id = " . $nextVal['option_id'];
|
89 |
+
$writeConnection->query($query);
|
90 |
+
}
|
91 |
+
$nextPosition += 2;
|
92 |
+
}
|
93 |
+
} catch (Exception $e) {
|
94 |
+
Mage::log("Could not set sort_order for advertise_auto_colors because: " . $e->getMessage());
|
95 |
+
Mage :: logException($e);
|
96 |
+
}
|
97 |
+
$updater->endSetup();
|
98 |
+
?>
|
app/design/frontend/base/default/template/importer/configurable.phtml
CHANGED
@@ -23,12 +23,12 @@ $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
|
|
23 |
<dl>
|
24 |
<?php foreach($_attributes as $_attribute): ?>
|
25 |
<?php /* -+-+-+-+-+-+-+- Start of Adverti.se Color Drop-Down code -+-+-+-+-+-+-+- */ ?>
|
26 |
-
<?php if (strcmp($_attribute->getProductAttribute()->getAttributeCode(), '
|
27 |
// It is the Adverti.se Colors attribute so add our code to page
|
28 |
$productAttributeOptions = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
|
29 |
$availableColors = "\"";
|
30 |
foreach ($productAttributeOptions as $productAttribute) {
|
31 |
-
if (strcmp($productAttribute['attribute_code'], '
|
32 |
foreach ($productAttribute['values'] as $prodattribute) {
|
33 |
$sql = "SELECT value FROM eav_attribute_option_value WHERE option_id = '".$prodattribute['value_index']."' AND store_id = 0";
|
34 |
$data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
@@ -84,7 +84,7 @@ $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
|
|
84 |
|
85 |
<?php /* Below here is the default Magento code for configurable product.
|
86 |
* If copying this to your theme's configurable.phtml file the existing code should
|
87 |
-
* go here in the 'else' clause, so that any attributes other than
|
88 |
* are rendered according to your theme's default selector.
|
89 |
*/ ?>
|
90 |
<dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
|
23 |
<dl>
|
24 |
<?php foreach($_attributes as $_attribute): ?>
|
25 |
<?php /* -+-+-+-+-+-+-+- Start of Adverti.se Color Drop-Down code -+-+-+-+-+-+-+- */ ?>
|
26 |
+
<?php if (strcmp($_attribute->getProductAttribute()->getAttributeCode(), 'advertise_swatch_colors') == 0) :
|
27 |
// It is the Adverti.se Colors attribute so add our code to page
|
28 |
$productAttributeOptions = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
|
29 |
$availableColors = "\"";
|
30 |
foreach ($productAttributeOptions as $productAttribute) {
|
31 |
+
if (strcmp($productAttribute['attribute_code'], 'advertise_swatch_colors') == 0) {
|
32 |
foreach ($productAttribute['values'] as $prodattribute) {
|
33 |
$sql = "SELECT value FROM eav_attribute_option_value WHERE option_id = '".$prodattribute['value_index']."' AND store_id = 0";
|
34 |
$data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
84 |
|
85 |
<?php /* Below here is the default Magento code for configurable product.
|
86 |
* If copying this to your theme's configurable.phtml file the existing code should
|
87 |
+
* go here in the 'else' clause, so that any attributes other than advertise_swatch_colors
|
88 |
* are rendered according to your theme's default selector.
|
89 |
*/ ?>
|
90 |
<dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
|
app/etc/modules/Advertise_Importer.xml
CHANGED
@@ -11,8 +11,8 @@
|
|
11 |
<Advertise_Importer>
|
12 |
<active>true</active>
|
13 |
<codePool>community</codePool>
|
14 |
-
<!-- Adverti.se Colors module version = 1.3.
|
15 |
<version>2.0.2</version>
|
16 |
</Advertise_Importer>
|
17 |
</modules>
|
18 |
-
</config>
|
11 |
<Advertise_Importer>
|
12 |
<active>true</active>
|
13 |
<codePool>community</codePool>
|
14 |
+
<!-- Adverti.se Colors module version = 1.3.5 -->
|
15 |
<version>2.0.2</version>
|
16 |
</Advertise_Importer>
|
17 |
</modules>
|
18 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AdvertiseColors</name>
|
4 |
-
<version>1.3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
@@ -16,9 +16,9 @@ v1.3.5 - update to documentation
|
|
16 |

|
17 |
v1.3.6 - updated module dependencies</notes>
|
18 |
<authors><author><name>Michael Oxley</name><user>advertise</user><email>mike@adverti.se</email></author></authors>
|
19 |
-
<date>2013-03
|
20 |
-
<time>
|
21 |
-
<contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Advertise_Importer.xml" hash="
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php><package><name>AdvertiseCommunity</name><channel>community</channel><min>1.3.0</min><max>1.3.9</max></package></required></dependencies>
|
24 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AdvertiseColors</name>
|
4 |
+
<version>1.3.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
16 |

|
17 |
v1.3.6 - updated module dependencies</notes>
|
18 |
<authors><author><name>Michael Oxley</name><user>advertise</user><email>mike@adverti.se</email></author></authors>
|
19 |
+
<date>2013-05-03</date>
|
20 |
+
<time>13:14:59</time>
|
21 |
+
<contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Advertise_Importer.xml" hash="a0f814eb1c8d01c6b01d5624dc802e09"/></dir></dir><dir name="code"><dir name="community"><dir name="Advertise"><dir name="Importer"><dir name="Block"><dir name="Adminhtml"><dir name="Importer"><file name="Grid.php" hash="a68e394bd6635b7c062b6ca37a9913f2"/></dir><file name="Importermanager.php" hash="f5e7126123e5fec8d3651d97c4b60c19"/><dir name="Job"><file name="Grid.php" hash="dd97b1687524b94c298b44cf5f20cac2"/></dir><file name="Job.php" hash="591c8639dc38ecac1e6befe0f1c8dc3e"/><file name="Queue.php" hash="0e3637fef81851e1366b24b1d723152e"/></dir><file name="Index.php" hash="a83b5e7dcef58fd936d9fee675db25e8"/></dir><dir name="Helper"><file name="Data.php" hash="9a0f7f9c257408301c622796dd192119"/></dir><dir name="Model"><file name="Adapter.php" hash="4e96aa1c3dc9ab776372402a403e1786"/><file name="Config.php" hash="b08acd56cb90c922ad9c956fd864adca"/><file name="Feed.php" hash="4c5075cb32782933e1ee762c7f9615dc"/><file name="Import.php" hash="5f3d0b0a371bfba589a03c68ad6e354d"/><file name="Importer.php" hash="14f412d67c9c98d83a2e90a096ee19e8"/><file name="Job.php" hash="6a1d0f5f94212f437d26033c0ebd0a55"/><dir name="Mysql4"><dir name="Import"><file name="Collection.php" hash="44a0cbfec2ef7c26853fff9d14032401"/></dir><file name="Import.php" hash="d79959ab2a67602b7b8d2e81f7020285"/><dir name="Job"><file name="Collection.php" hash="574bcbc3a72eb06a5a63319658484dd5"/></dir><file name="Job.php" hash="935203cd519d8822266ac178bbf74ce1"/></dir><file name="Scheduler.php" hash="a9ce4a121c81a7861ebd0f9a4d8b5c56"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ImportermanagerController.php" hash="6a8105e0bf15384f77d6079ebf4f6229"/><file name="JobController.php" hash="6c04ba54f03c3f01328a37eb55010032"/><file name="QueueController.php" hash="6e441e2f64d7369784d73952da228de7"/></dir><file name="IndexController.php" hash="27249891af9527898e5319f48cab7b80"/></dir><dir name="etc"><file name="adminhtml.xml" hash="27de6cabdddece88a7e038d292142d08"/><file name="config.xml" hash="f171660f5b83e1912b7b4066290378d8"/><file name="system.xml" hash="5a822c56bba93c44ba84028da8f23f55"/></dir><dir name="sql"><dir name="importer_setup"><file name="mysql4-install-0.1.0.php" hash="c24a2ac39aea1e7cc0bf0112e1cf75c4"/><file name="mysql4-install-0.1.1.php" hash="a6bbb0a0a58a0199f1591722984b0519"/><file name="mysql4-install-2.0.0.php" hash="a6bbb0a0a58a0199f1591722984b0519"/><file name="upgrade-0.1.0-0.1.1.php" hash="daf24b0aa31f4431a28f3c7f13354089"/><file name="upgrade-0.1.1-2.0.0.php" hash="254c5e34ceeb62fd4d7229df7f8c5811"/><file name="upgrade-2.0.0-2.0.1.php" hash="b302070c0da3a05ddd30d4d8c49dd08c"/><file name="upgrade-2.0.1-2.0.2.php" hash="1bbfffb11fb54f2afbe033288d23e7c4"/></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="fr_FR"><file name="Advertise_Importer.csv" hash="4d6250249f1dda84d2a1625d1ff6c783"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="settings.xml" hash="38c3341d4c4fb32dc50c33ff9d97e7d5"/><file name="importer.xml" hash="43692d3c7ba4585455a240ad0f32ac67"/></dir><dir name="template"><dir name="importer"><file name="importermanager.phtml" hash="c070c0c337ad8e158d4f3ca1f8f3f22c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="importer.xml" hash="004f983e76c37407dec7ec2ca8e19fbd"/></dir><dir name="template"><dir name="importer"><file name="index.phtml" hash="978e8c3a1315f29bdca94c0f2cd7e1c4"/><file name="configurable.phtml" hash="49ecd0067b5adc60d9f8ab78bbc2d426"/></dir></dir></dir></dir></dir></dir></dir><dir name="Adverti.se Module Docs"><dir name="resources"><file name="advertise-colors-dropdown.png" hash="88456b9c85c96ca51f9248de0b010433"/></dir><file name="Advertise Colors.html" hash="fbd800411cae577f6f5edcca403c09da"/></dir></target></contents>
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php><package><name>AdvertiseCommunity</name><channel>community</channel><min>1.3.0</min><max>1.3.9</max></package></required></dependencies>
|
24 |
</package>
|