Version Notes
Tested and bugs fixed
Download this release
Release Info
Developer | exorbyte GmbH |
Extension | Exorbyte_Commercesearch |
Version | 0.1.3 |
Comparing to | |
See all releases |
Code changes from version 0.1.2 to 0.1.3
- app/code/community/Exorbyte/Commercesearch/Block/Manualupload.php +28 -0
- app/code/community/Exorbyte/Commercesearch/Helper/exorbyte_export.php +64 -0
- app/code/community/Exorbyte/Commercesearch/etc/config.xml +1 -1
- app/code/community/Exorbyte/Commercesearch/sql/Commercesearch_setup/{mysql4-install-0.1.2.php → mysql4-install-0.1.3.php} +0 -0
- app/design/frontend/base/default/layout/commercesearch.xml +1 -1
- package.xml +3 -3
app/code/community/Exorbyte/Commercesearch/Block/Manualupload.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Exorbyte_Commercesearch_Block_Manualupload
|
3 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
|
5 |
+
$this->setElement($element);
|
6 |
+
$baseurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
7 |
+
$select = 'SELECT profile_id';
|
8 |
+
$table = 'dataflow_profile';
|
9 |
+
$where = 'name=\'exorbyte\'';
|
10 |
+
$order = '';
|
11 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
12 |
+
$result = $connection->select($select)
|
13 |
+
->from($table)
|
14 |
+
->where($where)
|
15 |
+
->order($order);
|
16 |
+
$data = $connection->fetchAll($result);
|
17 |
+
|
18 |
+
$editurl=$this->getUrl('*/system_convert_gui/edit') . 'id/'.$data[0]["profile_id"];
|
19 |
+
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
20 |
+
->setType('button')
|
21 |
+
->setClass('scalable')
|
22 |
+
->setLabel('View and run datafeed!')
|
23 |
+
//->setOnClick("window.open('".$baseurl."exorbyteexport.php','window','width=400,height=200')")
|
24 |
+
->setOnClick("window.open('".$editurl."','window','width=800,height=600')")
|
25 |
+
->toHtml();
|
26 |
+
return $html;
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Exorbyte/Commercesearch/Helper/exorbyte_export.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
define('SAVE_FEED_LOCATION','export/exorbyte.csv');
|
3 |
+
// avoid timeouts - but be aware that the memory limit can be touched
|
4 |
+
set_time_limit(0);
|
5 |
+
require_once '../../app/Mage.php';
|
6 |
+
Mage::app('default');
|
7 |
+
try{
|
8 |
+
//$handle = fopen(SAVE_FEED_LOCATION, 'w');
|
9 |
+
$heading = array('aid','brand','name','desc','price','stock','link','image','stock_description','shipping_rate','shop_cat');
|
10 |
+
$feed_line=implode("\t", $heading)."\r\n";
|
11 |
+
//fwrite($handle, $feed_line);
|
12 |
+
echo $feed_line;
|
13 |
+
|
14 |
+
//---------------------- read products
|
15 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
16 |
+
$products->addAttributeToFilter('status', 1);//enabled
|
17 |
+
$products->addAttributeToFilter('visibility', 4);//catalog, search
|
18 |
+
$products->addAttributeToSelect('*');
|
19 |
+
$prodIds=$products->getAllIds();
|
20 |
+
|
21 |
+
$product = Mage::getModel('catalog/product');
|
22 |
+
|
23 |
+
foreach($prodIds as $productId) {
|
24 |
+
$product->load($productId);
|
25 |
+
|
26 |
+
$product_data = array();
|
27 |
+
$product_data['sku']=$product->getSku();
|
28 |
+
$product_data['brand']=$product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($product);
|
29 |
+
$product_data['title']=$product->getName();
|
30 |
+
$product_data['description']=$product->getDescription();
|
31 |
+
$product_data['price']=$product->getPrice();
|
32 |
+
$product_data['availability']='yes';
|
33 |
+
$product_data['link']=str_replace("exorbyte.php","index.php",$product->getUrlPath());
|
34 |
+
$product_data['image_link']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getImage();
|
35 |
+
$product_data['stock_descrip']='';
|
36 |
+
$product_data['shipping_rate']='';
|
37 |
+
|
38 |
+
//get the product categories
|
39 |
+
foreach($product->getCategoryIds() as $_categoryId){
|
40 |
+
$category = Mage::getModel('catalog/category')->load($_categoryId);
|
41 |
+
$product_data['product_type'].=$category->getName().', ';
|
42 |
+
}
|
43 |
+
$product_data['product_type']=rtrim($product_data['product_type'],', ');
|
44 |
+
//sanitize data
|
45 |
+
foreach($product_data as $k=>$val){
|
46 |
+
$bad=array('"',"\r\n","\n","\r","\t");
|
47 |
+
$good=array(""," "," "," ","");
|
48 |
+
$product_data[$k] = '"'.str_replace($bad,$good,$val).'"';
|
49 |
+
}
|
50 |
+
|
51 |
+
$feed_line = implode("\t", $product_data)."\r\n";
|
52 |
+
//fwrite($handle, $feed_line);
|
53 |
+
//fflush($handle);
|
54 |
+
echo $feed_line;
|
55 |
+
}
|
56 |
+
|
57 |
+
//---------------------- WRITE THE FEED
|
58 |
+
//fclose($handle);
|
59 |
+
|
60 |
+
}
|
61 |
+
catch(Exception $e){
|
62 |
+
die($e->getMessage());
|
63 |
+
}
|
64 |
+
|
app/code/community/Exorbyte/Commercesearch/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Exorbyte_Commercesearch>
|
5 |
-
<version>0.1.
|
6 |
</Exorbyte_Commercesearch>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Exorbyte_Commercesearch>
|
5 |
+
<version>0.1.3</version>
|
6 |
</Exorbyte_Commercesearch>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/Exorbyte/Commercesearch/sql/Commercesearch_setup/{mysql4-install-0.1.2.php → mysql4-install-0.1.3.php}
RENAMED
File without changes
|
app/design/frontend/base/default/layout/commercesearch.xml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
<block type="core/template" name="Commercesearch" as="topSearch" template="commercesearch/commercesearch.phtml"/>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.3">
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
<block type="core/template" name="Commercesearch" as="topSearch" template="commercesearch/commercesearch.phtml"/>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Exorbyte_Commercesearch</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -11,8 +11,8 @@
|
|
11 |
<notes>Tested and bugs fixed</notes>
|
12 |
<authors><author><name>exorbyte GmbH</name><user>exorbytecs</user><email>thomas.braun@exorbyte.com</email></author></authors>
|
13 |
<date>2012-04-26</date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Exorbyte"><dir name="Commercesearch"><dir name="Block"><dir name="Adminhtml"><dir name="Commercesearch"><dir name="Edit"><file name="Form.php" hash="35f4717f4200c27536f8fbd059e3a40b"/><dir name="Tab"><file name="Form.php" hash="59d2546eb64f925520f069bafbf1818f"/></dir><file name="Tabs.php" hash="7ee7912235ad2c6f666989776ce50e4d"/></dir><file name="Edit.php" hash="2ea10acbf7aaf3cca80df730be5c3f8f"/><file name="Grid.php" hash="14ef4efc5f92259ba7a3c54f6bc404a1"/></dir><file name="Commercesearch.php" hash="f73be0b0888cda949c97794c9f27010b"/><file name="Ecs.php" hash="17b73cb4b34bf8fb8fc08da4c396fe8c"/><file name="Suggest.php" hash="a4a0174a16844ecb6627f8caaba0ecec"/></dir><dir name="Backend"><file name="Exportbutton.php" hash="89f4fc353a9cc4550fd3255ea86756c2"/></dir
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Exorbyte_Commercesearch</name>
|
4 |
+
<version>0.1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
11 |
<notes>Tested and bugs fixed</notes>
|
12 |
<authors><author><name>exorbyte GmbH</name><user>exorbytecs</user><email>thomas.braun@exorbyte.com</email></author></authors>
|
13 |
<date>2012-04-26</date>
|
14 |
+
<time>08:10:23</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Exorbyte"><dir name="Commercesearch"><dir name="Block"><dir name="Adminhtml"><dir name="Commercesearch"><dir name="Edit"><file name="Form.php" hash="35f4717f4200c27536f8fbd059e3a40b"/><dir name="Tab"><file name="Form.php" hash="59d2546eb64f925520f069bafbf1818f"/></dir><file name="Tabs.php" hash="7ee7912235ad2c6f666989776ce50e4d"/></dir><file name="Edit.php" hash="2ea10acbf7aaf3cca80df730be5c3f8f"/><file name="Grid.php" hash="14ef4efc5f92259ba7a3c54f6bc404a1"/></dir><file name="Commercesearch.php" hash="f73be0b0888cda949c97794c9f27010b"/><file name="Ecs.php" hash="17b73cb4b34bf8fb8fc08da4c396fe8c"/><file name="Suggest.php" hash="a4a0174a16844ecb6627f8caaba0ecec"/></dir><dir name="Backend"><file name="Exportbutton.php" hash="89f4fc353a9cc4550fd3255ea86756c2"/></dir><file name="Manualupload.php" hash="23aadf03cc2432c2fd2ad7a946893756"/></dir><dir name="Helper"><file name="Data.php" hash="e1fe12b764967a896bcfc7a24e78f135"/><file name="exorbyte_export.php" hash="9e356324f2a3df62f4e8faecae360ddc"/></dir><dir name="Model"><file name="Activate.php" hash="ce60deb1f93bd481999572d593a971ef"/><dir name="Backend"><file name="Design.php" hash="705615e2767736c1312856335b921c16"/><file name="Email.php" hash="c6d984d3f7064f061e4763eaad498416"/><file name="Layout.php" hash="cadb56ae0aa4d2961c5c1e9f5bfbf75b"/></dir><file name="Commercesearch.php" hash="36bcaec51d9d109f9cf4bccfbbaec369"/><file name="Connect.php" hash="2a4d7609b0a163529a0d563440b020c6"/><dir name="Mysql4"><dir name="Commercesearch"><file name="Collection.php" hash="c26a4d9be07bf37a9b4910f13f357bf2"/></dir><file name="Commercesearch.php" hash="ba4043466e98fe9ad9fd0962fcc6b9a1"/></dir><file name="Observer.php" hash="c0e5105ef0c676d75750380ff6290c45"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CommercesearchController.php" hash="6e01bf88acfffab852f693dd5dcfe7d2"/></dir><file name="IndexController.php" hash="ee10413adbd70fd8f45f91ba97332401"/></dir><dir name="etc"><file name="config.xml" hash="04a30f8387e78e41019315cf7e13be75"/><file name="system.xml" hash="16fdb62191b1569c00b146c77f7aab07"/></dir><dir name="sql"><dir name="Commercesearch_setup"><file name="mysql4-install-0.1.3.php" hash="8161903ae72c04cc86c5bea861f61fb8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Commerceseach.xml" hash=""/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="commercesearch.xml" hash="1b2801a0e9c653ccb407a6d6667e66c9"/></dir><dir name="template"><dir name="commercesearch"><file name="commercesearch.phtml" hash="27c0a26908ad4ec721d6d4474200f711"/><file name="commercesearchform.phtml" hash="0fc7b7f96bf9bfd89896bc6746a93666"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Exorbyte_Commercesearch.xml" hash="ccd16076bda5a73dabdaa48aaa591a77"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|