Version Notes
Added
reprice to any price field
Download this release
Release Info
Developer | Magento Core Team |
Extension | Wisepricer_Syncer |
Version | 1.1.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.1.4.4 to 1.1.4.5
- app/code/local/Wisepricer/Syncer/Model/Source/Boolean.php +117 -0
- app/code/local/Wisepricer/Syncer/controllers/ProductsController.php +6 -0
- app/code/local/Wisepricer/Syncer/etc/config.xml +2 -1
- app/code/local/Wisepricer/Syncer/sql/syncer_setup/mysql4-upgrade-1.1.4.4-1.1.4.5.php +28 -0
- package.xml +3 -3
app/code/local/Wisepricer/Syncer/Model/Source/Boolean.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Wisepricer_Syncer_Model_Source_Boolean extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Retrieve all options array
|
8 |
+
*
|
9 |
+
* @return array
|
10 |
+
*/
|
11 |
+
public function getAllOptions()
|
12 |
+
{
|
13 |
+
if (is_null($this->_options)) {
|
14 |
+
$this->_options = array(
|
15 |
+
array(
|
16 |
+
'label' => Mage::helper('eav')->__('No'),
|
17 |
+
'value' => 1
|
18 |
+
),
|
19 |
+
array(
|
20 |
+
'label' => Mage::helper('eav')->__('Yes'),
|
21 |
+
'value' => 0
|
22 |
+
),
|
23 |
+
);
|
24 |
+
}
|
25 |
+
return $this->_options;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Retrieve option array
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
+
public function getOptionArray()
|
34 |
+
{
|
35 |
+
$_options = array();
|
36 |
+
foreach ($this->getAllOptions() as $option) {
|
37 |
+
$_options[$option['value']] = $option['label'];
|
38 |
+
}
|
39 |
+
return $_options;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get a text for option value
|
44 |
+
*
|
45 |
+
* @param string|integer $value
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getOptionText($value)
|
49 |
+
{
|
50 |
+
$options = $this->getAllOptions();
|
51 |
+
foreach ($options as $option) {
|
52 |
+
if ($option['value'] == $value) {
|
53 |
+
return $option['label'];
|
54 |
+
}
|
55 |
+
}
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Retrieve flat column definition
|
61 |
+
*
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public function getFlatColums()
|
65 |
+
{
|
66 |
+
$attributeCode = $this->getAttribute()->getAttributeCode();
|
67 |
+
$column = array(
|
68 |
+
'unsigned' => false,
|
69 |
+
'default' => null,
|
70 |
+
'extra' => null
|
71 |
+
);
|
72 |
+
|
73 |
+
if (Mage::helper('core')->useDbCompatibleMode()) {
|
74 |
+
$column['type'] = 'tinyint(1)';
|
75 |
+
$column['is_null'] = true;
|
76 |
+
} else {
|
77 |
+
$column['type'] = Varien_Db_Ddl_Table::TYPE_SMALLINT;
|
78 |
+
$column['length'] = 1;
|
79 |
+
$column['nullable'] = true;
|
80 |
+
$column['comment'] = $attributeCode . ' column';
|
81 |
+
}
|
82 |
+
|
83 |
+
return array($attributeCode => $column);
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Retrieve Indexes(s) for Flat
|
88 |
+
*
|
89 |
+
* @return array
|
90 |
+
*/
|
91 |
+
public function getFlatIndexes()
|
92 |
+
{
|
93 |
+
$indexes = array();
|
94 |
+
|
95 |
+
$index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode());
|
96 |
+
$indexes[$index] = array(
|
97 |
+
'type' => 'index',
|
98 |
+
'fields' => array($this->getAttribute()->getAttributeCode())
|
99 |
+
);
|
100 |
+
|
101 |
+
return $indexes;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Retrieve Select For Flat Attribute update
|
106 |
+
*
|
107 |
+
* @param int $store
|
108 |
+
* @return Varien_Db_Select|null
|
109 |
+
*/
|
110 |
+
public function getFlatUpdateSelect($store)
|
111 |
+
{
|
112 |
+
return Mage::getResourceModel('eav/entity_attribute')
|
113 |
+
->getFlatUpdateSelect($this->getAttribute(), $store);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
?>
|
app/code/local/Wisepricer/Syncer/controllers/ProductsController.php
CHANGED
@@ -74,6 +74,7 @@ class Wisepricer_Syncer_ProductsController extends Wisepricer_Syncer_BaseControl
|
|
74 |
|
75 |
}
|
76 |
$collection->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
|
|
|
77 |
$collection->addAttributeToFilter('type_id', array('eq' => 'simple'));
|
78 |
|
79 |
if($licenseData->getWebsite()!=0){
|
@@ -92,6 +93,11 @@ class Wisepricer_Syncer_ProductsController extends Wisepricer_Syncer_BaseControl
|
|
92 |
|
93 |
|
94 |
foreach ($collection as $product) {
|
|
|
|
|
|
|
|
|
|
|
95 |
$productCollData=$product->getData();
|
96 |
$productModel=Mage::getModel('catalog/product')->load($productCollData['entity_id']);
|
97 |
|
74 |
|
75 |
}
|
76 |
$collection->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
|
77 |
+
$collection->addAttributeToSelect('import_to_wisepricer');
|
78 |
$collection->addAttributeToFilter('type_id', array('eq' => 'simple'));
|
79 |
|
80 |
if($licenseData->getWebsite()!=0){
|
93 |
|
94 |
|
95 |
foreach ($collection as $product) {
|
96 |
+
|
97 |
+
if($product->getimport_to_wisepricer()==1){
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
$productCollData=$product->getData();
|
102 |
$productModel=Mage::getModel('catalog/product')->load($productCollData['entity_id']);
|
103 |
|
app/code/local/Wisepricer/Syncer/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Wisepricer_Syncer>
|
5 |
-
<version>1.1.4.
|
6 |
<url>http://www.wisepricer.com/index.php</url>
|
7 |
<modulename>Wisepricer Syncer</modulename>
|
8 |
</Wisepricer_Syncer>
|
@@ -55,6 +55,7 @@
|
|
55 |
<syncer_setup>
|
56 |
<setup>
|
57 |
<module>Wisepricer_Syncer</module>
|
|
|
58 |
</setup>
|
59 |
<connection>
|
60 |
<use>core_setup</use>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Wisepricer_Syncer>
|
5 |
+
<version>1.1.4.5</version>
|
6 |
<url>http://www.wisepricer.com/index.php</url>
|
7 |
<modulename>Wisepricer Syncer</modulename>
|
8 |
</Wisepricer_Syncer>
|
55 |
<syncer_setup>
|
56 |
<setup>
|
57 |
<module>Wisepricer_Syncer</module>
|
58 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
59 |
</setup>
|
60 |
<connection>
|
61 |
<use>core_setup</use>
|
app/code/local/Wisepricer/Syncer/sql/syncer_setup/mysql4-upgrade-1.1.4.4-1.1.4.5.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->addAttribute('catalog_product', 'import_to_wisepricer', array(
|
8 |
+
'type' => 'int',
|
9 |
+
'backend' => '',
|
10 |
+
'frontend' => '',
|
11 |
+
'label' => 'Import to WisePricer',
|
12 |
+
'input' => 'select',
|
13 |
+
'class' => '',
|
14 |
+
'source' => 'wisepricer_syncer/source_boolean',
|
15 |
+
'global' => 0,
|
16 |
+
'visible' => 1,
|
17 |
+
'required' => 0,
|
18 |
+
'user_defined' => 0,
|
19 |
+
'default' => 0,
|
20 |
+
'searchable' => 0,
|
21 |
+
'filterable' => 0,
|
22 |
+
'comparable' => 0,
|
23 |
+
'visible_on_front' => 0,
|
24 |
+
'unique' => 0,
|
25 |
+
'position' => 1,
|
26 |
+
));
|
27 |
+
|
28 |
+
$installer->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wisepricer_Syncer</name>
|
4 |
-
<version>1.1.4.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
@@ -12,8 +12,8 @@
|
|
12 |
reprice to any price field</notes>
|
13 |
<authors><author><name>Moshe</name><user>auto-converted</user><email>moshe@wisepricer.com</email></author></authors>
|
14 |
<date>2013-04-11</date>
|
15 |
-
<time>
|
16 |
-
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="wisepricer"><file name="bullet-green.png" hash="78d917a9d9aea11366bada6e0ae53931"/><file name="validation_advice_bg.gif" hash="ffdad80de989e3b04a977be3778c4347"/><file name="wp-alert-icon.png" hash="0dbbadfbbe2329098d03f8351aa2eaf2"/><file name="wp-logo.png" hash="48db98cdfc570336c942271352f31094"/><file name="wp-save-btn.png" hash="6d8e02c7f5e54dcc705e6436f126c66d"/></dir></dir><dir name="wisepricer"><file name="chosen-sprite.png" hash="8e70d120437ffc6a1bf7cebeca292d5c"/><file name="chosen.css" hash="bcd3f3e697219898e26631ccf29d97ba"/><file name="chosen.proto.js" hash="8259b22f4f337ba9ab63506b5ee4a52f"/><file name="myprototype.js" hash="2325b8b147c5dfaa8531c9d8bafd3648"/><file name="prototype17.js" hash="2325b8b147c5dfaa8531c9d8bafd3648"/><file name="wisepricer.css" hash="bd4dc50e10de4b41ae1c0ab18b2045ad"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="syncer.xml" hash="a9d0f0b5af6b7bc28fb3c3b897c1773c"/></dir><dir name="template"><dir name="wisepricer"><file name="mapping.phtml" hash="021a17507985d01b681792f26311bca4"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wisepricer_Syncer.xml" hash="838dc229469d27db4c96a49591b12f55"/></dir></target><target name="magelocal"><dir name="Wisepricer"><dir name="Syncer"><dir name="Block"><dir name="Adminhtml"><file name="Mapping.php" hash="612d45b21f0650d119801cda480cc8d7"/><file name="Register.php" hash="ed2ffde3237ecba2dbdd6002b5077af3"/></dir></dir><dir name="controllers"><file name="BaseController.php" hash="def65eee1964d7c0667e8cb32375e74c"/><file name="ProductsController.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wisepricer_Syncer</name>
|
4 |
+
<version>1.1.4.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
12 |
reprice to any price field</notes>
|
13 |
<authors><author><name>Moshe</name><user>auto-converted</user><email>moshe@wisepricer.com</email></author></authors>
|
14 |
<date>2013-04-11</date>
|
15 |
+
<time>15:13:49</time>
|
16 |
+
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="wisepricer"><file name="bullet-green.png" hash="78d917a9d9aea11366bada6e0ae53931"/><file name="validation_advice_bg.gif" hash="ffdad80de989e3b04a977be3778c4347"/><file name="wp-alert-icon.png" hash="0dbbadfbbe2329098d03f8351aa2eaf2"/><file name="wp-logo.png" hash="48db98cdfc570336c942271352f31094"/><file name="wp-save-btn.png" hash="6d8e02c7f5e54dcc705e6436f126c66d"/></dir></dir><dir name="wisepricer"><file name="chosen-sprite.png" hash="8e70d120437ffc6a1bf7cebeca292d5c"/><file name="chosen.css" hash="bcd3f3e697219898e26631ccf29d97ba"/><file name="chosen.proto.js" hash="8259b22f4f337ba9ab63506b5ee4a52f"/><file name="myprototype.js" hash="2325b8b147c5dfaa8531c9d8bafd3648"/><file name="prototype17.js" hash="2325b8b147c5dfaa8531c9d8bafd3648"/><file name="wisepricer.css" hash="bd4dc50e10de4b41ae1c0ab18b2045ad"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="syncer.xml" hash="a9d0f0b5af6b7bc28fb3c3b897c1773c"/></dir><dir name="template"><dir name="wisepricer"><file name="mapping.phtml" hash="021a17507985d01b681792f26311bca4"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wisepricer_Syncer.xml" hash="838dc229469d27db4c96a49591b12f55"/></dir></target><target name="magelocal"><dir name="Wisepricer"><dir name="Syncer"><dir name="Block"><dir name="Adminhtml"><file name="Mapping.php" hash="612d45b21f0650d119801cda480cc8d7"/><file name="Register.php" hash="ed2ffde3237ecba2dbdd6002b5077af3"/></dir></dir><dir name="controllers"><file name="BaseController.php" hash="def65eee1964d7c0667e8cb32375e74c"/><file name="ProductsController.php" hash="97fc2612a3a6830eeaf6ef8b3dc0a857"/><file name="SalesController.php" hash="eb9e9d553da503e43632bd5b1451b9be"/><dir name="Adminhtml"><file name="SyncerController.php" hash="22cb1bbb7498960cd518b4b860b185d9"/></dir></dir><dir name="etc"><file name="config.xml" hash="1cdaf61b4db270740c91fa15b33f7004"/></dir><dir name="Helper"><file name="Data.php" hash="025b73c04ab0ca01d2e7c75aaad7fea6"/></dir><dir name="lib"><dir name="phpseclib"><dir name="Crypt"><file name="AES.php" hash="dd67dd1dbc7706e6c740e8430054d5e0"/><file name="DES.php" hash="47ac443f1edd2833cdc2f4eb80aa9a71"/><file name="Hash.php" hash="9be22f6426f2176caebb34a6cd2cb579"/><file name="Random.php" hash="5befc55c3423792c0cd50bc6d4f527b1"/><file name="RC4.php" hash="c6ec724c3a5d807d5ea4645518c37d29"/><file name="Rijndael.php" hash="7a92c95c750dd9ec1b8ce92915b4aa35"/><file name="RSA.php" hash="9bd5734f28d149d183c603643f6dbbb4"/><file name="TripleDES.php" hash="07c384b505d52802803313126e9e3836"/></dir><dir name="Math"><file name="BigInteger.php" hash="61aa9373ea606c928187d168159ac3f8"/></dir><dir name="Net"><file name="SFTP.php" hash="029f797c16ddd23b1d65636a72141115"/><file name="SSH1.php" hash="818d83815fe9bb5741594226bbdad975"/><file name="SSH2.php" hash="db5145effae044c7a1f6e7d778b566f5"/></dir><dir name="PHP"><dir name="Compat"><dir name="Function"><file name="array_fill.php" hash="840a674cac272c5588fa59f9421ed9a3"/><file name="bcpowmod.php" hash="4cb8fab0ee419f4b5a626980bbf04938"/><file name="str_split.php" hash="85cb5961afa62dde933190ee851a6d9a"/></dir></dir></dir></dir></dir><dir name="Model"><file name="Config.php" hash="d669c3dc977ddf71a58c90fa8df3180c"/><file name="Mapping.php" hash="d924ae8bcf54a3ca1224e8680d847fee"/><file name="Observer.php" hash="6d7216c55bb46f202a33f61bcad556d6"/><file name="Reprice.php" hash="ba6050d59ab31cb19e7ffa01e2f58321"/><dir name="Adminhtml"><file name="Attributes.php" hash="cadf0b88a3878ae0ec847b3c116cda43"/></dir><dir name="Mysql4"><file name="Config.php" hash="61b7eb73489844aa0ee041c216bab2db"/><file name="Mapping.php" hash="d97574adda931ce798964c67041f6af5"/><dir name="Config"><file name="Collection.php" hash="c7c7b6844e3ff8893163c392f4132f30"/></dir><dir name="Mapping"><file name="Collection.php" hash="c0f15143db582e070cfb83de92c57d09"/></dir></dir><dir name="Source"><file name="Boolean.php" hash="dbb3f3187972a1a918eec16345de987a"/></dir></dir><dir name="sql"><dir name="syncer_setup"><file name="mysql4-install-1.1.3.8.php" hash="f149922af5a6e5be8a474b4cc68d415f"/><file name="mysql4-upgrade-1.1.3.8-1.1.3.9.php" hash="8d7bcdc6fb908a4906f3af7dfcb28ab8"/><file name="mysql4-upgrade-1.1.3.9-1.1.4.1.php" hash="99396eeee161d50822de7be3aa76cbec"/><file name="mysql4-upgrade-1.1.4.1-1.1.4.2.php" hash="f7d4c87537d4cd570f358bebad578056"/><file name="mysql4-upgrade-1.1.4.4-1.1.4.5.php" hash="6685c36c866b2b7ee9970d5f688ed251"/></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|