photoslurp_for_magento - Version 1.0.28

Version Notes

First stable release

Download this release

Release Info

Developer Ben Heinkel
Extension photoslurp_for_magento
Version 1.0.28
Comparing to
See all releases


Code changes from version 1.0.26 to 1.0.28

app/code/community/Photoslurp/PsWidget/Block/Widget.php CHANGED
@@ -57,12 +57,7 @@ class Photoslurp_PsWidget_Block_Widget extends Mage_Core_Block_Template{
57
  foreach($cssBlocks[0] as $cssBlock) {
58
  $cssBlock = trim($cssBlock);
59
  preg_match('/[^{}]*{/', $cssBlock, $selector);
60
- if(!preg_match('/^@/', $selector[0])) {
61
- $selectorModified = preg_replace(array('/,/', '/^/'), array(",\n#$id ", "\n#$id "), $selector[0]);
62
- $cssBlockModified = preg_replace("/$selector[0]/", $selectorModified, $cssBlock);
63
- }else{
64
- $cssBlockModified = "\n$cssBlock";
65
- }
66
  $cssModified .= $cssBlockModified;
67
  }
68
  return $cssModified;
57
  foreach($cssBlocks[0] as $cssBlock) {
58
  $cssBlock = trim($cssBlock);
59
  preg_match('/[^{}]*{/', $cssBlock, $selector);
60
+ $cssBlockModified = "\n$cssBlock";
 
 
 
 
 
61
  $cssModified .= $cssBlockModified;
62
  }
63
  return $cssModified;
app/code/community/Photoslurp/PsWidget/Model/Cron.php CHANGED
@@ -117,15 +117,32 @@ class Photoslurp_PsWidget_Model_Cron{
117
  return $stores;
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  private function addProductStoreData($collection){
121
 
122
- $stores = $this->getExportStores();
 
 
123
 
 
124
  foreach ($stores as $store){
125
  $storeId = $store->getId();
126
- $collection->joinAttribute('name_'.$storeId, 'catalog_product/name', 'entity_id', null, 'left',$storeId);
127
- $collection->joinAttribute('description_'.$storeId, 'catalog_product/description', 'entity_id', null, 'left',$storeId);
128
- $collection->joinAttribute('url_key_'.$storeId, 'catalog_product/url_key', 'entity_id', null, 'left',$storeId);
129
  }
130
  }
131
 
117
  return $stores;
118
  }
119
 
120
+ private function joinAttribute($collection, $name, $type, $storeId ){
121
+ $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', $name);
122
+ $collection->getSelect()->joinLeft(array('at_'.$name.'_'.$storeId => Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_'.$type)),
123
+ '(`at_'.$name.'_'.$storeId.'`.`entity_id` = `e`.`entity_id`) AND (`at_'.$name.'_'.$storeId.'`.`attribute_id` = '.$attributeId.') AND `at_'.$name.'_'.$storeId.'`.`store_id` = '.$storeId,
124
+ array($name.'_'.$storeId => 'IF(at_'.$name.'_'.$storeId.'.value_id > 0, at_'.$name.'_'.$storeId.'.value, at_'.$name.'_default.value)'));
125
+ }
126
+
127
+ private function joinDefaults($collection, $name, $type){
128
+ $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', $name);
129
+ $collection->getSelect()->joinLeft(array('at_'.$name.'_default' => Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_'.$type)),
130
+ '(`at_'.$name.'_default`.`entity_id` = `e`.`entity_id`) AND (`at_'.$name.'_default`.`attribute_id` = '.$attributeId.') AND `at_'.$name.'_default`.`store_id` = 0',
131
+ array('at_'.$name.'_default' => 'value'));
132
+ }
133
+
134
  private function addProductStoreData($collection){
135
 
136
+ $this->joinDefaults($collection,'name','varchar');
137
+ $this->joinDefaults($collection,'description','text');
138
+ $this->joinDefaults($collection,'url_key','varchar');
139
 
140
+ $stores = $this->getExportStores();
141
  foreach ($stores as $store){
142
  $storeId = $store->getId();
143
+ $this->joinAttribute($collection,'name','varchar',$storeId);
144
+ $this->joinAttribute($collection,'description','text',$storeId);
145
+ $this->joinAttribute($collection,'url_key','varchar',$storeId);
146
  }
147
  }
148
 
app/code/community/Photoslurp/PsWidget/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Photoslurp_PsWidget>
5
- <version>1.0.26</version>
6
  </Photoslurp_PsWidget>
7
  </modules>
8
  <default>
2
  <config>
3
  <modules>
4
  <Photoslurp_PsWidget>
5
+ <version>1.0.28</version>
6
  </Photoslurp_PsWidget>
7
  </modules>
8
  <default>
app/design/frontend/base/default/template/pswidget/widget.phtml CHANGED
@@ -151,7 +151,9 @@
151
  ?>
152
  showSubmit: <?php echo ($_show_submit)?'true':'false' ?>,
153
  submitText: '<?php echo addslashes($_submit_text) ?>',
 
154
  shopThisLookText:'<?php echo addslashes($_shop_this_look_text) ?>',
 
155
  autoscrollLimit: <?php echo $_autoscroll_limit ?>,
156
  page_limit: <?php echo $_page_limit ?>,
157
  pageType: '<?php echo $_page_type ?>',
151
  ?>
152
  showSubmit: <?php echo ($_show_submit)?'true':'false' ?>,
153
  submitText: '<?php echo addslashes($_submit_text) ?>',
154
+ <?php if($_shop_this_look_text): ?>
155
  shopThisLookText:'<?php echo addslashes($_shop_this_look_text) ?>',
156
+ <?php endif; ?>
157
  autoscrollLimit: <?php echo $_autoscroll_limit ?>,
158
  page_limit: <?php echo $_page_limit ?>,
159
  pageType: '<?php echo $_page_type ?>',
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>photoslurp_for_magento</name>
4
- <version>1.0.26</version>
5
  <stability>stable</stability>
6
  <license>OSL-v3</license>
7
  <channel>community</channel>
@@ -25,9 +25,9 @@ Learn more about Photoslurp&#x2019;s visual commerce and marketing platform at w
25
  </description>
26
  <notes>First stable release</notes>
27
  <authors><author><name>Ben Heinkel</name><user>benheinkel</user><email>ben@photoslurp.com</email></author></authors>
28
- <date>2017-04-13</date>
29
- <time>20:40:03</time>
30
- <contents><target name="magecommunity"><dir name="Photoslurp"><dir name="PsWidget"><dir name="Block"><dir name="Adminhtml"><file name="PsWidgetbackend.php" hash="b0b408f4f1073b2aed8f39df3c0d9d7c"/><dir name="Pswidget"><dir name="Edit"><file name="Form.php" hash="07056712bfb2df959976073610745765"/><dir name="Tab"><file name="Form.php" hash="8a02818e2b8e28aea613e6c3d3b650f5"/><file name="Form1.php" hash="50898da40c8a990d8a5e619d6045f220"/><file name="Form2.php" hash="1e92b67f6378787f5e0065fa59596cae"/><file name="Form3.php" hash="b6aa6d83c6fd44ff1d179b8fe5c99937"/></dir><file name="Tabs.php" hash="5dbfd05fa55c50acbe54834c26dc97b1"/></dir><file name="Edit.php" hash="b333a1cf1ca6aaac74df4ef91cd51e75"/><file name="Grid.php" hash="a6776b5283ac806f3f520307b49886ee"/></dir><file name="Pswidget.php" hash="ae5c762b95a3620c863014ead2c51fa9"/></dir><file name="Widget.php" hash="cdb9316fb49a3b386dd8653ae9bab10d"/></dir><dir name="Helper"><file name="Data.php" hash="17803c49800b8107cfe0c9dde2dad7c8"/></dir><dir name="Model"><file name="Cron.php" hash="8634109090eb32142677af5b89a64fad"/><dir name="Mysql4"><dir name="Pswidget"><file name="Collection.php" hash="ee7e2a99a9e6c38ff163878514cac4b4"/></dir><file name="Pswidget.php" hash="547b6cc9aa1172d7671c0978cc48af0d"/><dir name="Pswidgetlang"><file name="Collection.php" hash="4570b57b1392c018f3bb22747eddd026"/></dir><file name="Pswidgetlang.php" hash="d1569f8430700adbc5489a4770d81672"/></dir><file name="Pswidget.php" hash="c963bd2ffa02f7e97894e3cadc974ad5"/><file name="Pswidgetlang.php" hash="9a40bda5f3695b8725283d3095558c2e"/><dir name="Source"><file name="Export.php" hash="203d9c552e3a0e8b829d13ca83b44fa6"/><file name="Store.php" hash="1f20d8f385d0fabaca4b3af5cd3924c6"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pswidget"><file name="PswidgetController.php" hash="7f395e4e0238a72a11a107ff0433a93b"/><file name="PswidgetbackendController.php" hash="db19f4de2bba7974148df71f9461c031"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="edcf078f0341d62edb7513350fd0c9a7"/><file name="config.xml" hash="736baf1a01ca6dd59d8491f09d083d3a"/><file name="system.xml" hash="303d0134618b143e81ed8daa7171e911"/></dir><dir name="sql"><dir name="pswidget_setup"><file name="mysql4-install-1.0.0.php" hash="0a7842e9b9d63ca47b69e4fb838216f9"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="58a54f4673f2d3adaa99d257c5a12123"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="4f8d333b80208a1d2274b212d571ef13"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="27a8126cd27372a57d37342e9baff14e"/><file name="mysql4-upgrade-1.0.17-1.0.18.php" hash="adbb0ea0357d1a55d8004d18bf6b34d4"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="26da4479c7dd5c7438bb6493ed13bbc9"/><file name="mysql4-upgrade-1.0.21-1.0.22.php" hash="4eb1a7b1657bc66aeeaa447639582993"/><file name="mysql4-upgrade-1.0.23-1.0.24.php" hash="b86117d2db849466f666851bde50723c"/><file name="mysql4-upgrade-1.0.24-1.0.25.php" hash="0efc4a42362628c2f113126173bc3413"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="974aeac2421feaf1875eff5202c01f71"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="76e05edf7eef2702df21ad463983d129"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="f41bf19ff684ba4cefbba479022d82cc"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="80469dfc31ac50b80c82264e3a5b21e8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fcbd9b296b1a153c1cdbdc39cb79eeec"/></dir><dir name="template"><dir name="pswidget"><file name="pswidgetbackend.phtml" hash="384a53871152aa8495f83f940ecac9f7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fb35c29a3fa177282a438f53ad8c377d"/></dir><dir name="template"><dir name="pswidget"><file name="style.phtml" hash="7fbdab2088119db02ebaa0d36d526b14"/><file name="tracking.phtml" hash="8b7f9745b84d81336460ee286fcd7ae0"/><file name="widget.phtml" hash="a0620657a46ce19c072b0c4b5d2d06b0"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Photoslurp_PsWidget.xml" hash="d7596ef6fa89cd0424cdb8cae80a2910"/></dir></target><target name="mageweb"><dir name="js"><dir name="photoslurp"><file name="admin.js" hash="de32022ef0b9a76e3a0c76d3735f2d1c"/></dir></dir></target></contents>
31
  <compatible/>
32
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
33
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>photoslurp_for_magento</name>
4
+ <version>1.0.28</version>
5
  <stability>stable</stability>
6
  <license>OSL-v3</license>
7
  <channel>community</channel>
25
  </description>
26
  <notes>First stable release</notes>
27
  <authors><author><name>Ben Heinkel</name><user>benheinkel</user><email>ben@photoslurp.com</email></author></authors>
28
+ <date>2017-05-25</date>
29
+ <time>14:33:15</time>
30
+ <contents><target name="magecommunity"><dir name="Photoslurp"><dir name="PsWidget"><dir name="Block"><dir name="Adminhtml"><file name="PsWidgetbackend.php" hash="b0b408f4f1073b2aed8f39df3c0d9d7c"/><dir name="Pswidget"><dir name="Edit"><file name="Form.php" hash="07056712bfb2df959976073610745765"/><dir name="Tab"><file name="Form.php" hash="8a02818e2b8e28aea613e6c3d3b650f5"/><file name="Form1.php" hash="50898da40c8a990d8a5e619d6045f220"/><file name="Form2.php" hash="1e92b67f6378787f5e0065fa59596cae"/><file name="Form3.php" hash="b6aa6d83c6fd44ff1d179b8fe5c99937"/></dir><file name="Tabs.php" hash="5dbfd05fa55c50acbe54834c26dc97b1"/></dir><file name="Edit.php" hash="b333a1cf1ca6aaac74df4ef91cd51e75"/><file name="Grid.php" hash="a6776b5283ac806f3f520307b49886ee"/></dir><file name="Pswidget.php" hash="ae5c762b95a3620c863014ead2c51fa9"/></dir><file name="Widget.php" hash="1d238e44d3767ffd0343a69fd2504328"/></dir><dir name="Helper"><file name="Data.php" hash="17803c49800b8107cfe0c9dde2dad7c8"/></dir><dir name="Model"><file name="Cron.php" hash="2377e1ce55a17ba16f0f25ae1870ed2e"/><dir name="Mysql4"><dir name="Pswidget"><file name="Collection.php" hash="ee7e2a99a9e6c38ff163878514cac4b4"/></dir><file name="Pswidget.php" hash="547b6cc9aa1172d7671c0978cc48af0d"/><dir name="Pswidgetlang"><file name="Collection.php" hash="4570b57b1392c018f3bb22747eddd026"/></dir><file name="Pswidgetlang.php" hash="d1569f8430700adbc5489a4770d81672"/></dir><file name="Pswidget.php" hash="c963bd2ffa02f7e97894e3cadc974ad5"/><file name="Pswidgetlang.php" hash="9a40bda5f3695b8725283d3095558c2e"/><dir name="Source"><file name="Export.php" hash="203d9c552e3a0e8b829d13ca83b44fa6"/><file name="Store.php" hash="1f20d8f385d0fabaca4b3af5cd3924c6"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pswidget"><file name="PswidgetController.php" hash="7f395e4e0238a72a11a107ff0433a93b"/><file name="PswidgetbackendController.php" hash="db19f4de2bba7974148df71f9461c031"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="edcf078f0341d62edb7513350fd0c9a7"/><file name="config.xml" hash="c0e9e9f8a98c7b824032e7d0fd414280"/><file name="system.xml" hash="303d0134618b143e81ed8daa7171e911"/></dir><dir name="sql"><dir name="pswidget_setup"><file name="mysql4-install-1.0.0.php" hash="0a7842e9b9d63ca47b69e4fb838216f9"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="58a54f4673f2d3adaa99d257c5a12123"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="4f8d333b80208a1d2274b212d571ef13"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="27a8126cd27372a57d37342e9baff14e"/><file name="mysql4-upgrade-1.0.17-1.0.18.php" hash="adbb0ea0357d1a55d8004d18bf6b34d4"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="26da4479c7dd5c7438bb6493ed13bbc9"/><file name="mysql4-upgrade-1.0.21-1.0.22.php" hash="4eb1a7b1657bc66aeeaa447639582993"/><file name="mysql4-upgrade-1.0.23-1.0.24.php" hash="b86117d2db849466f666851bde50723c"/><file name="mysql4-upgrade-1.0.24-1.0.25.php" hash="0efc4a42362628c2f113126173bc3413"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="974aeac2421feaf1875eff5202c01f71"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="76e05edf7eef2702df21ad463983d129"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="f41bf19ff684ba4cefbba479022d82cc"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="80469dfc31ac50b80c82264e3a5b21e8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fcbd9b296b1a153c1cdbdc39cb79eeec"/></dir><dir name="template"><dir name="pswidget"><file name="pswidgetbackend.phtml" hash="384a53871152aa8495f83f940ecac9f7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fb35c29a3fa177282a438f53ad8c377d"/></dir><dir name="template"><dir name="pswidget"><file name="style.phtml" hash="7fbdab2088119db02ebaa0d36d526b14"/><file name="tracking.phtml" hash="8b7f9745b84d81336460ee286fcd7ae0"/><file name="widget.phtml" hash="ce3defebc2e354661d7913273731dcb0"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Photoslurp_PsWidget.xml" hash="d7596ef6fa89cd0424cdb8cae80a2910"/></dir></target><target name="mageweb"><dir name="js"><dir name="photoslurp"><file name="admin.js" hash="de32022ef0b9a76e3a0c76d3735f2d1c"/></dir></dir></target></contents>
31
  <compatible/>
32
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
33
  </package>