Version Notes
In case of bugs\errors while dowmloading, please report them to marina@bintime.com
Download this release
Release Info
Developer | Magento Core Team |
Extension | MagentoConnector |
Version | 3.0.0 |
Comparing to | |
See all releases |
Version 3.0.0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Catalog/Image.php +44 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Getdata.php +189 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Getdata.php~ +183 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Image.php +33 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Category.php +19 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Product.php +34 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Search.php +15 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Import.php +300 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Import.php~ +298 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Observer.php +295 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Attributes.php +21 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/LanguageList.xml +399 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Locales.php +45 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Subscription.php +18 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/controllers/ImageController.php +16 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/controllers/ProductController.php +44 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/config.xml +133 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/config.xml~ +133 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/system.xml +79 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/system.xml~ +79 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/sql/icecatimport_setup/mysql4-install-0.1.0.php +23 -0
- app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/sql/icecatimport_setup/mysql4-upgrade-0.1.0-0.1.1.php +12 -0
- app/code/local/Bintime/MageConnector-3.0.0/en_US/Bintime_Icecatimport.csv +20 -0
- app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/css/view_table.css +48 -0
- app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/js/product_view.js +19 -0
- app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/layout/icecatimport.xml +77 -0
- app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/template/icecatimport/media.phtml +89 -0
- app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/template/icecatimport/view.phtml +324 -0
- app/code/local/Bintime/MageConnector-3.0.0/modules/Bintime_Icecatimport.xml +9 -0
- package.xml +38 -0
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Catalog/Image.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Overloaded catalog helper to substitute magento images
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Helper_Catalog_Image extends Mage_Catalog_Helper_Image
|
8 |
+
{
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Overriden method provides product with images from icecatimport data table
|
12 |
+
* @param $product Mage_Catalog_Model_Product
|
13 |
+
* @param $attributeName string
|
14 |
+
* @param $imageFile string
|
15 |
+
*/
|
16 |
+
public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
|
17 |
+
{
|
18 |
+
if ($attributeName == 'image' && $imageFile == null ) {
|
19 |
+
$icecatHelper = Mage::helper('icecatimport/getdata')->getProductDescription($product);
|
20 |
+
if (!$icecatHelper->hasError()){
|
21 |
+
$imageFile = $icecatHelper->getLowPicUrl();
|
22 |
+
|
23 |
+
}
|
24 |
+
}
|
25 |
+
if ($attributeName == 'small_image' && $imageFile == null) {
|
26 |
+
$imageFile = Mage::helper('icecatimport/image')->getImage($product);
|
27 |
+
}
|
28 |
+
|
29 |
+
return parent::init($product, $attributeName, $imageFile);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Return icecat image URL if set
|
34 |
+
*/
|
35 |
+
public function __toString()
|
36 |
+
{
|
37 |
+
$url = parent::__toString();
|
38 |
+
if ( $this->getImageFile() && strpos( $this->getImageFile(), 'icecat.biz') && strpos($url, 'placeholder') ) {
|
39 |
+
$url = $this->getImageFile();
|
40 |
+
}
|
41 |
+
return $url;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Getdata.php
ADDED
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Class achieves icecat description from Model by recieved SKU and manufacturer
|
5 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Bintime_Icecatimport_Helper_Getdata extends Mage_Core_Helper_Abstract
|
9 |
+
{
|
10 |
+
private $iceCatModel;
|
11 |
+
private $error;
|
12 |
+
private $systemError;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Gets product Data and delegates it to Model
|
16 |
+
* @param Mage_Catalog_Model_Product $_product
|
17 |
+
* @return Bintime_Icecatimport_Helper_Getdata
|
18 |
+
*/
|
19 |
+
|
20 |
+
protected function getEntityTypeId()
|
21 |
+
{
|
22 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
23 |
+
$query = $connection->select()->from('eav_entity_type','entity_type_id')->where('entity_type_code = ?', 'catalog_product')->limit(1);
|
24 |
+
$this->entityTypeId = $connection->fetchOne($query);
|
25 |
+
return $this->entityTypeId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getProductDescription($_product){
|
29 |
+
$entityId = $_product->getEntityId();
|
30 |
+
$entity_type_id = $this->getEntityTypeId();
|
31 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
32 |
+
$query = $connection->select()->from('eav_attribute','attribute_id')->where('attribute_code = ?','mpn')->where('entity_type_id = ?', $entity_type_id);
|
33 |
+
$attribute_id = $connection->fetchOne($query);
|
34 |
+
$query = $connection->select()->from('catalog_product_entity_varchar','value')->where('entity_id = ?', $entityId)->where('attribute_id = ?', $attribute_id);
|
35 |
+
$mpn = $connection->fetchOne($query);
|
36 |
+
|
37 |
+
$manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
38 |
+
if (Mage::getStoreConfig('icecat_root/icecat/manufacturer') == 'manufacturer'){
|
39 |
+
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
|
40 |
+
->setEntityTypeFilter($_product->getResource()->getTypeId())
|
41 |
+
->addFieldToFilter('attribute_code', 'manufacturer');
|
42 |
+
$attribute = $attributes->getFirstItem()->setEntity($_product->getResource());
|
43 |
+
$manufacturer = $attribute->getSource()->getOptionText($manufacturerId);
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
$manufacturer = $manufacturerId;
|
47 |
+
}
|
48 |
+
$locale = Mage::getStoreConfig('icecat_root/icecat/language');
|
49 |
+
|
50 |
+
if ($locale == '0'){
|
51 |
+
$systemLocale = explode("_", Mage::app()->getLocale()->getLocaleCode());
|
52 |
+
$locale = $systemLocale[0];
|
53 |
+
}
|
54 |
+
$userLogin = Mage::getStoreConfig('icecat_root/icecat/login');
|
55 |
+
$userPass = Mage::getStoreConfig('icecat_root/icecat/password');
|
56 |
+
|
57 |
+
$this->iceCatModel = Mage::getSingleton('icecatimport/import');
|
58 |
+
|
59 |
+
if (!$this->iceCatModel->getProductDescription($mpn, $manufacturer, $locale, $userLogin, $userPass, $entityId)){
|
60 |
+
$this->error = $this->iceCatModel->getErrorMessage();
|
61 |
+
$this->systemError = $this->iceCatModel->getSystemError();
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
return $this;
|
66 |
+
}
|
67 |
+
/**
|
68 |
+
* returns true if error during data fetch occured else false
|
69 |
+
*/
|
70 |
+
public function hasError(){
|
71 |
+
if ($this->error || $this->systemError){
|
72 |
+
return true;
|
73 |
+
}
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* return error message
|
79 |
+
*/
|
80 |
+
public function getError(){
|
81 |
+
//show icecat error on product page return $this->error;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* return system error
|
86 |
+
*/
|
87 |
+
public function hasSystemError(){
|
88 |
+
if ($this->systemError){
|
89 |
+
return $this->systemError;
|
90 |
+
}
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getProductDescriptionList(){
|
95 |
+
return $this->iceCatModel->getProductDescriptionList();
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getShortProductDescription(){
|
99 |
+
return $this->iceCatModel->getShortProductDescription();
|
100 |
+
}
|
101 |
+
|
102 |
+
public function getLowPicUrl(){
|
103 |
+
return $this->iceCatModel->getLowPicUrl();
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getGalleryPhotos(){
|
107 |
+
return $this->iceCatModel->getGalleryPhotos();
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getProductName(){
|
111 |
+
return $this->iceCatModel->getProductName();
|
112 |
+
}
|
113 |
+
public function getVendor(){
|
114 |
+
return $this->iceCatModel->getVendor();
|
115 |
+
}
|
116 |
+
|
117 |
+
public function getFullProductDescription(){
|
118 |
+
return $this->iceCatModel->getFullProductDescription();
|
119 |
+
}
|
120 |
+
|
121 |
+
public function getMPN(){
|
122 |
+
return $this->iceCatModel->getMPN();
|
123 |
+
}
|
124 |
+
public function getEAN(){
|
125 |
+
return $this->iceCatModel->getEAN();
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Form related products list according to store products
|
130 |
+
*/
|
131 |
+
public function getRelatedProducts(){
|
132 |
+
$relatedProducts =$this->iceCatModel->getRelatedProducts();
|
133 |
+
if (empty($relatedProducts)){
|
134 |
+
return array();
|
135 |
+
}
|
136 |
+
$sku = Mage::getStoreConfig('icecat_root/icecat/sku_field');
|
137 |
+
$collection = Mage::getModel('catalog/product')->getCollection();
|
138 |
+
|
139 |
+
$filterArray = array();
|
140 |
+
foreach($relatedProducts as $mpn => $valueArray){
|
141 |
+
array_push($filterArray, array('attribute'=>$sku,'eq'=>$mpn));
|
142 |
+
}
|
143 |
+
$collection->addFieldToFilter($filterArray);
|
144 |
+
|
145 |
+
$collection->addAttributeToSelect($sku);
|
146 |
+
$collection->addAttributeToSelect('category_ids');
|
147 |
+
|
148 |
+
$relatedProductsList = array();
|
149 |
+
foreach ($collection as $product) {
|
150 |
+
$categoryIds = $product->getCategoryIds();
|
151 |
+
if(!empty($categoryIds)){
|
152 |
+
if (is_array($categoryIds)){
|
153 |
+
$catogoriesArray = $categoryIds;
|
154 |
+
}
|
155 |
+
if (is_string($categoryIds)){
|
156 |
+
$catogoriesArray = explode(",",$product->getCategoryIds());
|
157 |
+
}
|
158 |
+
foreach($catogoriesArray as $categoryId){
|
159 |
+
if (!array_key_exists($product->getData($sku), $relatedProducts)){
|
160 |
+
continue;
|
161 |
+
}
|
162 |
+
$relatedProductInfo = $relatedProducts[$product->getData($sku)];
|
163 |
+
$relatedProductInfo['mpn'] = $product->getData($sku);
|
164 |
+
$relatedProductInfo['url'] = preg_replace( '/\/\d+\/$/',"/".$categoryId."/",$product->getProductUrl());;
|
165 |
+
if (!array_key_exists($categoryId, $relatedProductsList)){
|
166 |
+
$relatedProductsList[$categoryId]= array();
|
167 |
+
}
|
168 |
+
|
169 |
+
array_push($relatedProductsList[$categoryId], $relatedProductInfo);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
else {
|
173 |
+
if (!array_key_exists($product->getData($sku), $relatedProducts)){
|
174 |
+
continue;
|
175 |
+
}
|
176 |
+
$relatedProductInfo = $relatedProducts[$product->getData($sku)];
|
177 |
+
$relatedProductInfo['mpn'] = $product->getData($sku);
|
178 |
+
$relatedProductInfo['url'] = preg_replace( '/category\/\d+\/$/','',$product->getProductUrl());;
|
179 |
+
if (!array_key_exists('a', $relatedProductsList)){
|
180 |
+
$relatedProductsList['a']= array();
|
181 |
+
}
|
182 |
+
|
183 |
+
array_push($relatedProductsList['a'], $relatedProductInfo);
|
184 |
+
}
|
185 |
+
}
|
186 |
+
return $relatedProductsList;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Getdata.php~
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Class achieves icecat description from Model by recieved SKU and manufacturer
|
5 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Bintime_Icecatimport_Helper_Getdata extends Mage_Core_Helper_Abstract
|
9 |
+
{
|
10 |
+
private $iceCatModel;
|
11 |
+
private $error;
|
12 |
+
private $systemError;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Gets product Data and delegates it to Model
|
16 |
+
* @param Mage_Catalog_Model_Product $_product
|
17 |
+
* @return Bintime_Icecatimport_Helper_Getdata
|
18 |
+
*/
|
19 |
+
|
20 |
+
protected function getEntityTypeId()
|
21 |
+
{
|
22 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
23 |
+
$query = $connection->select()->from('eav_entity_type','entity_type_id')->where('entity_type_code = ?', 'catalog_product')->limit(1);
|
24 |
+
$this->entityTypeId = $connection->fetchOne($query);
|
25 |
+
return $this->entityTypeId;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getProductDescription($_product){
|
29 |
+
$entityId = $_product->getEntityId();
|
30 |
+
$sku = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/sku_field'));
|
31 |
+
$manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
32 |
+
if (Mage::getStoreConfig('icecat_root/icecat/manufacturer') == 'manufacturer'){
|
33 |
+
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
|
34 |
+
->setEntityTypeFilter($_product->getResource()->getTypeId())
|
35 |
+
->addFieldToFilter('attribute_code', 'manufacturer');
|
36 |
+
$attribute = $attributes->getFirstItem()->setEntity($_product->getResource());
|
37 |
+
$manufacturer = $attribute->getSource()->getOptionText($manufacturerId);
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$manufacturer = $manufacturerId;
|
41 |
+
}
|
42 |
+
$locale = Mage::getStoreConfig('icecat_root/icecat/language');
|
43 |
+
|
44 |
+
if ($locale == '0'){
|
45 |
+
$systemLocale = explode("_", Mage::app()->getLocale()->getLocaleCode());
|
46 |
+
$locale = $systemLocale[0];
|
47 |
+
}
|
48 |
+
$userLogin = Mage::getStoreConfig('icecat_root/icecat/login');
|
49 |
+
$userPass = Mage::getStoreConfig('icecat_root/icecat/password');
|
50 |
+
|
51 |
+
$this->iceCatModel = Mage::getSingleton('icecatimport/import');
|
52 |
+
|
53 |
+
if (!$this->iceCatModel->getProductDescription($sku, $manufacturer, $locale, $userLogin, $userPass, $entityId)){
|
54 |
+
$this->error = $this->iceCatModel->getErrorMessage();
|
55 |
+
$this->systemError = $this->iceCatModel->getSystemError();
|
56 |
+
return $this;
|
57 |
+
}
|
58 |
+
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
/**
|
62 |
+
* returns true if error during data fetch occured else false
|
63 |
+
*/
|
64 |
+
public function hasError(){
|
65 |
+
if ($this->error || $this->systemError){
|
66 |
+
return true;
|
67 |
+
}
|
68 |
+
return false;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* return error message
|
73 |
+
*/
|
74 |
+
public function getError(){
|
75 |
+
//show icecat error on product page return $this->error;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* return system error
|
80 |
+
*/
|
81 |
+
public function hasSystemError(){
|
82 |
+
if ($this->systemError){
|
83 |
+
return $this->systemError;
|
84 |
+
}
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getProductDescriptionList(){
|
89 |
+
return $this->iceCatModel->getProductDescriptionList();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getShortProductDescription(){
|
93 |
+
return $this->iceCatModel->getShortProductDescription();
|
94 |
+
}
|
95 |
+
|
96 |
+
public function getLowPicUrl(){
|
97 |
+
return $this->iceCatModel->getLowPicUrl();
|
98 |
+
}
|
99 |
+
|
100 |
+
public function getGalleryPhotos(){
|
101 |
+
return $this->iceCatModel->getGalleryPhotos();
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getProductName(){
|
105 |
+
return $this->iceCatModel->getProductName();
|
106 |
+
}
|
107 |
+
public function getVendor(){
|
108 |
+
return $this->iceCatModel->getVendor();
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getFullProductDescription(){
|
112 |
+
return $this->iceCatModel->getFullProductDescription();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function getMPN(){
|
116 |
+
return $this->iceCatModel->getMPN();
|
117 |
+
}
|
118 |
+
public function getEAN(){
|
119 |
+
return $this->iceCatModel->getEAN();
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Form related products list according to store products
|
124 |
+
*/
|
125 |
+
public function getRelatedProducts(){
|
126 |
+
$relatedProducts =$this->iceCatModel->getRelatedProducts();
|
127 |
+
if (empty($relatedProducts)){
|
128 |
+
return array();
|
129 |
+
}
|
130 |
+
$sku = Mage::getStoreConfig('icecat_root/icecat/sku_field');
|
131 |
+
$collection = Mage::getModel('catalog/product')->getCollection();
|
132 |
+
|
133 |
+
$filterArray = array();
|
134 |
+
foreach($relatedProducts as $mpn => $valueArray){
|
135 |
+
array_push($filterArray, array('attribute'=>$sku,'eq'=>$mpn));
|
136 |
+
}
|
137 |
+
$collection->addFieldToFilter($filterArray);
|
138 |
+
|
139 |
+
$collection->addAttributeToSelect($sku);
|
140 |
+
$collection->addAttributeToSelect('category_ids');
|
141 |
+
|
142 |
+
$relatedProductsList = array();
|
143 |
+
foreach ($collection as $product) {
|
144 |
+
$categoryIds = $product->getCategoryIds();
|
145 |
+
if(!empty($categoryIds)){
|
146 |
+
if (is_array($categoryIds)){
|
147 |
+
$catogoriesArray = $categoryIds;
|
148 |
+
}
|
149 |
+
if (is_string($categoryIds)){
|
150 |
+
$catogoriesArray = explode(",",$product->getCategoryIds());
|
151 |
+
}
|
152 |
+
foreach($catogoriesArray as $categoryId){
|
153 |
+
if (!array_key_exists($product->getData($sku), $relatedProducts)){
|
154 |
+
continue;
|
155 |
+
}
|
156 |
+
$relatedProductInfo = $relatedProducts[$product->getData($sku)];
|
157 |
+
$relatedProductInfo['mpn'] = $product->getData($sku);
|
158 |
+
$relatedProductInfo['url'] = preg_replace( '/\/\d+\/$/',"/".$categoryId."/",$product->getProductUrl());;
|
159 |
+
if (!array_key_exists($categoryId, $relatedProductsList)){
|
160 |
+
$relatedProductsList[$categoryId]= array();
|
161 |
+
}
|
162 |
+
|
163 |
+
array_push($relatedProductsList[$categoryId], $relatedProductInfo);
|
164 |
+
}
|
165 |
+
}
|
166 |
+
else {
|
167 |
+
if (!array_key_exists($product->getData($sku), $relatedProducts)){
|
168 |
+
continue;
|
169 |
+
}
|
170 |
+
$relatedProductInfo = $relatedProducts[$product->getData($sku)];
|
171 |
+
$relatedProductInfo['mpn'] = $product->getData($sku);
|
172 |
+
$relatedProductInfo['url'] = preg_replace( '/category\/\d+\/$/','',$product->getProductUrl());;
|
173 |
+
if (!array_key_exists('a', $relatedProductsList)){
|
174 |
+
$relatedProductsList['a']= array();
|
175 |
+
}
|
176 |
+
|
177 |
+
array_push($relatedProductsList['a'], $relatedProductInfo);
|
178 |
+
}
|
179 |
+
}
|
180 |
+
return $relatedProductsList;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Helper/Image.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class retrieves images from icecatimport data table
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Helper_Image extends Mage_Core_Helper_Abstract
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Fetch Image URL from DB
|
11 |
+
* @param Mage_Catalog_Model_Product $_product
|
12 |
+
* @return string image URL
|
13 |
+
*/
|
14 |
+
public function getImage($_product){
|
15 |
+
$sku = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/sku_field'));
|
16 |
+
|
17 |
+
$manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
18 |
+
if (Mage::getStoreConfig('icecat_root/icecat/manufacturer') == 'manufacturer'){
|
19 |
+
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
|
20 |
+
->setEntityTypeFilter($_product->getResource()->getTypeId())
|
21 |
+
->addFieldToFilter('attribute_code', 'manufacturer');
|
22 |
+
$attribute = $attributes->getFirstItem()->setEntity($_product->getResource());
|
23 |
+
$manufacturer = $attribute->getSource()->getOptionText($manufacturerId);
|
24 |
+
}
|
25 |
+
else {
|
26 |
+
$manufacturer = $manufacturerId;
|
27 |
+
}
|
28 |
+
$this->observer = Mage::getSingleton('icecatimport/observer');
|
29 |
+
$url = $this->observer->getImageURL($sku, $manufacturer);
|
30 |
+
return $url;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Category.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* class overrides category getProductCollection function to provide products with needed attributes
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_Catalog_Category extends Mage_Catalog_Model_Category
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* add product manufacturer attribute to category collection
|
11 |
+
*/
|
12 |
+
public function getProductCollection()
|
13 |
+
{
|
14 |
+
$collection = parent::getProductCollection();
|
15 |
+
$collection->addAttributeToSelect(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
16 |
+
return $collection;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Product.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class overrides base Product Model to provide products icecat data
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_Catalog_Product extends Mage_Catalog_Model_Product
|
8 |
+
{
|
9 |
+
public function getName()
|
10 |
+
{
|
11 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
12 |
+
$manufacturerId = $this->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
13 |
+
if (Mage::getStoreConfig('icecat_root/icecat/manufacturer') == 'manufacturer'){
|
14 |
+
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
|
15 |
+
->setEntityTypeFilter($this->getResource()->getTypeId())
|
16 |
+
->addFieldToFilter('attribute_code', 'manufacturer');
|
17 |
+
$attribute = $attributes->getFirstItem()->setEntity($this->getResource());
|
18 |
+
$manufacturer = $attribute->getSource()->getOptionText($manufacturerId);
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
$manufacturer = $manufacturerId;
|
22 |
+
}
|
23 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('icecatimport/data');
|
24 |
+
$mappingTable = Mage::getSingleton('core/resource')->getTableName('icecatimport/supplier_mapping');
|
25 |
+
$selectCondition = $connection->select()->
|
26 |
+
from(array('connector' => $tableName), new Zend_Db_Expr('connector.prod_name'))
|
27 |
+
->joinInner(array('supplier' => $mappingTable), "connector.supplier_id = supplier.supplier_id AND supplier.supplier_symbol = {$connection->quote($manufacturer)}")
|
28 |
+
->where('connector.prod_id = ? ', $this->getSku());
|
29 |
+
$icecatName = $connection->fetchOne($selectCondition);
|
30 |
+
|
31 |
+
return $icecatName ? $icecatName : $this->getData('name');
|
32 |
+
}
|
33 |
+
}
|
34 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Catalog/Search.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* class overrides search getProductCollection function to provide products with needed attributes
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_Catalog_Search extends Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
8 |
+
{
|
9 |
+
public function _beforeLoad()
|
10 |
+
{
|
11 |
+
$this->addAttributeToSelect(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));
|
12 |
+
return parent::_beforeLoad();
|
13 |
+
}
|
14 |
+
}
|
15 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Import.php
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class performs Curl request to ICEcat and fetches xml data with product description
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
|
8 |
+
|
9 |
+
private $productDescriptionList = array();
|
10 |
+
private $productDescription;
|
11 |
+
private $fullProductDescription;
|
12 |
+
private $lowPicUrl;
|
13 |
+
private $highPicUrl;
|
14 |
+
private $errorMessage;
|
15 |
+
private $galleryPhotos = array();
|
16 |
+
private $productName;
|
17 |
+
private $relatedProducts = array();
|
18 |
+
private $errorSystemMessage; //depricated
|
19 |
+
private $_cacheKey = 'bintime_icecatimport_';
|
20 |
+
|
21 |
+
protected function _construct()
|
22 |
+
{
|
23 |
+
$this->_init('icecatimport/import');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Perform Curl request with corresponding param check and error processing
|
28 |
+
* @param int $productId
|
29 |
+
* @param string $vendorName
|
30 |
+
* @param string $locale
|
31 |
+
* @param string $userName
|
32 |
+
* @param string $userPass
|
33 |
+
*/
|
34 |
+
public function getProductDescription($productId, $vendorName, $locale, $userName, $userPass, $entityId){
|
35 |
+
if (null === $this->simpleDoc) {
|
36 |
+
if (!$cacheDataXml = Mage::app()->getCache()->load($this->_cacheKey . $entityId)) {
|
37 |
+
$dataUrl = 'http://data.icecat.biz/xml_s3/xml_server3.cgi';
|
38 |
+
if (empty($productId)) {
|
39 |
+
$this->errorMessage = 'Given product has no MPN (SKU)';
|
40 |
+
return false;
|
41 |
+
}
|
42 |
+
if (empty($vendorName)){
|
43 |
+
$this->errorMessage = "Given product has no manufacturer specified.";
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
if (empty($locale)) {
|
47 |
+
$this->errorMessage = "Please specify product description locale";
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
if ( empty($userName)) {
|
51 |
+
$this->errorMessage = "No ICEcat login provided";
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
if (empty($userPass)){
|
55 |
+
$this->errorMessage = "No ICEcat password provided";
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
$getParamsArray = array("prod_id" => $productId,
|
60 |
+
"lang" =>$locale,
|
61 |
+
"vendor" => $vendorName,
|
62 |
+
"output" =>'productxml'
|
63 |
+
);
|
64 |
+
Varien_Profiler::start('Bintime FILE DOWNLOAD:');
|
65 |
+
try{
|
66 |
+
$webClient = new Zend_Http_Client();
|
67 |
+
$webClient->setUri($dataUrl);
|
68 |
+
$webClient->setMethod(Zend_Http_Client::GET);
|
69 |
+
$webClient->setHeaders('Content-Type: text/xml; charset=UTF-8');
|
70 |
+
$webClient->setParameterGet($getParamsArray);
|
71 |
+
$webClient->setAuth($userName, $userPass, Zend_Http_CLient::AUTH_BASIC);
|
72 |
+
$response = $webClient->request();
|
73 |
+
if ($response->isError()){
|
74 |
+
$this->errorMessage = 'Response Status: '.$response->getStatus()." Response Message: ".$response->getMessage();
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
catch (Exception $e) {
|
79 |
+
$this->errorMessage = "Warning: cannot connect to ICEcat. {$e->getMessage()}";
|
80 |
+
return false;
|
81 |
+
}
|
82 |
+
Varien_Profiler::stop('Bintime FILE DOWNLOAD:');
|
83 |
+
$resultString = $response->getBody();
|
84 |
+
Mage::app()->getCache()->save($resultString, $this->_cacheKey . $entityId);
|
85 |
+
} else {
|
86 |
+
$resultString = $cacheDataXml;
|
87 |
+
}
|
88 |
+
if(!$this->parseXml($resultString)){
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
|
92 |
+
if ($this->checkIcecatResponse($productId, $vendorName)){
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
$this->loadProductDescriptionList();
|
97 |
+
$this->loadOtherProductParams();
|
98 |
+
$this->loadGalleryPhotos();
|
99 |
+
Varien_Profiler::start('Bintime FILE RELATED');
|
100 |
+
$this->loadRelatedProducts();
|
101 |
+
Varien_Profiler::stop('Bintime FILE RELATED');
|
102 |
+
}
|
103 |
+
return true;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getSystemError(){
|
107 |
+
return $this->errorSystemMessage;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getProductName(){
|
111 |
+
return $this->productName;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getGalleryPhotos(){
|
115 |
+
return $this->galleryPhotos;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* load Gallery array from XML
|
120 |
+
*/
|
121 |
+
private function loadGalleryPhotos(){
|
122 |
+
$galleryPhotos = $this->simpleDoc->Product->ProductGallery->ProductPicture;
|
123 |
+
if (!count($galleryPhotos)){
|
124 |
+
return false;
|
125 |
+
}
|
126 |
+
foreach($galleryPhotos as $photo){
|
127 |
+
if($photo["Size"] > 0){//if
|
128 |
+
$picHeight = (int)$photo["PicHeight"];
|
129 |
+
$picWidth = (int)$photo["PicWidth"];
|
130 |
+
$thumbUrl = (string)$photo["ThumbPic"];
|
131 |
+
$picUrl = (string)$photo["Pic"];
|
132 |
+
|
133 |
+
array_push($this->galleryPhotos, array(
|
134 |
+
'height' => $picHeight,
|
135 |
+
'width' => $picWidth,
|
136 |
+
'thumb' => $thumbUrl,
|
137 |
+
'pic' => $picUrl
|
138 |
+
));
|
139 |
+
}//endif
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getErrorMessage(){
|
144 |
+
return $this->errorMessage;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Checks response XML for error messages
|
149 |
+
* @param int $productId
|
150 |
+
* @param string $vendorName
|
151 |
+
*/
|
152 |
+
private function checkIcecatResponse($productId, $vendorName){
|
153 |
+
$errorMessage = $this->simpleDoc->Product['ErrorMessage'];
|
154 |
+
if ($errorMessage != ''){
|
155 |
+
if (preg_match('/^No xml data/', $errorMessage)){
|
156 |
+
$this->errorSystemMessage = $errorMessage;
|
157 |
+
return true;
|
158 |
+
}
|
159 |
+
if (preg_match('/^The specified vendor does not exist$/', $errorMessage)) {
|
160 |
+
$this->errorSystemMessage = $errorMessage;
|
161 |
+
return true;
|
162 |
+
}
|
163 |
+
$this->errorMessage = "Ice Cat Error: ".$errorMessage;
|
164 |
+
return true;
|
165 |
+
}
|
166 |
+
return false;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function getProductDescriptionList(){
|
170 |
+
return $this->productDescriptionList;
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
public function getShortProductDescription(){
|
175 |
+
return $this->productDescription;
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getFullProductDescription(){
|
179 |
+
return $this->fullProductDescription;
|
180 |
+
}
|
181 |
+
|
182 |
+
public function getLowPicUrl(){
|
183 |
+
return $this->highPicUrl;
|
184 |
+
}
|
185 |
+
|
186 |
+
public function getRelatedProducts(){
|
187 |
+
return $this->relatedProducts;
|
188 |
+
}
|
189 |
+
|
190 |
+
public function getVendor(){
|
191 |
+
return $this->vendor;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function getMPN(){
|
195 |
+
return $this->productId;
|
196 |
+
}
|
197 |
+
|
198 |
+
public function getEAN(){
|
199 |
+
return $this->EAN;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Form related products Array
|
204 |
+
*/
|
205 |
+
private function loadRelatedProducts(){
|
206 |
+
$relatedProductsArray = $this->simpleDoc->Product->ProductRelated;
|
207 |
+
if(count($relatedProductsArray)){
|
208 |
+
foreach($relatedProductsArray as $product){
|
209 |
+
$productArray = array();
|
210 |
+
$productNS = $product->Product;
|
211 |
+
$productArray['name'] = (string)$productNS['Name'];
|
212 |
+
$productArray['thumb'] = (string)$productNS['ThumbPic'];
|
213 |
+
$mpn = (string)$productNS['Prod_id'];
|
214 |
+
$productSupplier = $productNS->Supplier;
|
215 |
+
$productSupplierId = (int)$productSupplier['ID'];
|
216 |
+
$productArray['supplier_thumb'] = 'http://images2.icecat.biz/thumbs/SUP'.$productSupplierId.'.jpg';
|
217 |
+
$productArray['supplier_name'] = (string)$productSupplier['Name'];
|
218 |
+
|
219 |
+
$this->relatedProducts[$mpn] = $productArray;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Form product feature Arrray
|
226 |
+
*/
|
227 |
+
private function loadProductDescriptionList(){
|
228 |
+
$descriptionArray = array();
|
229 |
+
|
230 |
+
$specGroups = $this->simpleDoc->Product->CategoryFeatureGroup;
|
231 |
+
$specFeatures = $this->simpleDoc->Product->ProductFeature;
|
232 |
+
foreach($specFeatures as $feature){
|
233 |
+
$id = (int)$feature['CategoryFeatureGroup_ID'];
|
234 |
+
$featureText = (string)$feature["Presentation_Value"];
|
235 |
+
$featureName = (string)$feature->Feature->Name["Value"];
|
236 |
+
foreach($specGroups as $group){
|
237 |
+
$groupId = (int)$group["ID"];
|
238 |
+
if ($groupId == $id){
|
239 |
+
$groupName = (string) $group->FeatureGroup->Name["Value"];
|
240 |
+
$rating = (int)$group['No'];
|
241 |
+
$descriptionArray[$rating][$groupName][$featureName] = $featureText;
|
242 |
+
break;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
krsort($descriptionArray);
|
247 |
+
$this->productDescriptionList = $descriptionArray;
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Form Array of non feature-value product params
|
252 |
+
*/
|
253 |
+
private function loadOtherProductParams(){
|
254 |
+
$this->productDescription = (string) $this->simpleDoc->Product->ProductDescription['ShortDesc'];
|
255 |
+
$this->fullProductDescription = (string)$this->simpleDoc->Product->ProductDescription['LongDesc'];
|
256 |
+
$productTag = $this->simpleDoc->Product;
|
257 |
+
$this->lowPicUrl = (string)$productTag["LowPic"];
|
258 |
+
$this->highPicUrl = (string)$productTag["HighPic"];
|
259 |
+
$this->productName = (string)$productTag["Name"];
|
260 |
+
$this->productId = (string)$productTag['Prod_id'];
|
261 |
+
$this->vendor = (string)$productTag->Supplier['Name'];
|
262 |
+
$prodEAN = $productTag->EANCode;
|
263 |
+
$EANstr='';
|
264 |
+
$EANarr=null;
|
265 |
+
$j = 0;//counter
|
266 |
+
foreach($prodEAN as $ellEAN){
|
267 |
+
$EANarr[]=$ellEAN['EAN'];$j++;
|
268 |
+
}
|
269 |
+
$i = 0;
|
270 |
+
for($i=0;$i<$j;$i++){
|
271 |
+
$g = $i%2;
|
272 |
+
|
273 |
+
if($g == '0'){if($j == 1){$str .= $EANarr[$i].'<br>';} else {$str .= $EANarr[$i].', ';}
|
274 |
+
}
|
275 |
+
else {if($i != $j-1){$str .= $EANarr[$i].', <br>';}else {$str .= $EANarr[$i].' <br>';}}
|
276 |
+
|
277 |
+
}
|
278 |
+
$this->EAN = $str;
|
279 |
+
//$EANstr=implode(",",$EANarr);
|
280 |
+
//$this->EAN = (string)$EANstr;//$productTag->EANCode['EAN'];
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* parse response XML: to SimpleXml
|
285 |
+
* @param string $stringXml
|
286 |
+
*/
|
287 |
+
private function parseXml($stringXml){
|
288 |
+
libxml_use_internal_errors(true);
|
289 |
+
$this->simpleDoc = simplexml_load_string($stringXml);
|
290 |
+
if ($this->simpleDoc){
|
291 |
+
return true;
|
292 |
+
}
|
293 |
+
$this->simpleDoc = simplexml_load_string(utf8_encode($stringXml));
|
294 |
+
if ($this->simpleDoc){
|
295 |
+
return true;
|
296 |
+
}
|
297 |
+
return false;
|
298 |
+
}
|
299 |
+
}
|
300 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Import.php~
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class performs Curl request to ICEcat and fetches xml data with product description
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_Import extends Mage_Core_Model_Abstract {
|
8 |
+
|
9 |
+
private $productDescriptionList = array();
|
10 |
+
private $productDescription;
|
11 |
+
private $fullProductDescription;
|
12 |
+
private $lowPicUrl;
|
13 |
+
private $highPicUrl;
|
14 |
+
private $errorMessage;
|
15 |
+
private $galleryPhotos = array();
|
16 |
+
private $productName;
|
17 |
+
private $relatedProducts = array();
|
18 |
+
private $errorSystemMessage; //depricated
|
19 |
+
private $_cacheKey = 'bintime_icecatimport_';
|
20 |
+
|
21 |
+
protected function _construct()
|
22 |
+
{
|
23 |
+
$this->_init('icecatimport/import');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Perform Curl request with corresponding param check and error processing
|
28 |
+
* @param int $productId
|
29 |
+
* @param string $vendorName
|
30 |
+
* @param string $locale
|
31 |
+
* @param string $userName
|
32 |
+
* @param string $userPass
|
33 |
+
*/
|
34 |
+
public function getProductDescription($productId, $vendorName, $locale, $userName, $userPass, $entityId){
|
35 |
+
if (null === $this->simpleDoc) {
|
36 |
+
if (!$cacheDataXml = Mage::app()->getCache()->load($this->_cacheKey . $entityId)) {
|
37 |
+
$dataUrl = 'http://data.icecat.biz/xml_s3/xml_server3.cgi';
|
38 |
+
if (empty($productId)) {
|
39 |
+
$this->errorMessage = 'Given product has no MPN (SKU)';
|
40 |
+
return false;
|
41 |
+
}
|
42 |
+
if (empty($vendorName)){
|
43 |
+
$this->errorMessage = "Given product has no manufacturer specified.";
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
if (empty($locale)) {
|
47 |
+
$this->errorMessage = "Please specify product description locale";
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
if ( empty($userName)) {
|
51 |
+
$this->errorMessage = "No ICEcat login provided";
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
if (empty($userPass)){
|
55 |
+
$this->errorMessage = "No ICEcat password provided";
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
$getParamsArray = array("prod_id" => $productId,
|
60 |
+
"lang" =>$locale,
|
61 |
+
"vendor" => $vendorName,
|
62 |
+
"output" =>'productxml'
|
63 |
+
);
|
64 |
+
Varien_Profiler::start('Bintime FILE DOWNLOAD:');
|
65 |
+
try{
|
66 |
+
$webClient = new Zend_Http_Client();
|
67 |
+
$webClient->setUri($dataUrl);
|
68 |
+
$webClient->setMethod(Zend_Http_Client::GET);
|
69 |
+
$webClient->setHeaders('Content-Type: text/xml; charset=UTF-8');
|
70 |
+
$webClient->setParameterGet($getParamsArray);
|
71 |
+
$webClient->setAuth($userName, $userPass, Zend_Http_CLient::AUTH_BASIC);
|
72 |
+
$response = $webClient->request();
|
73 |
+
if ($response->isError()){
|
74 |
+
$this->errorMessage = 'Response Status: '.$response->getStatus()." Response Message: ".$response->getMessage();
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
catch (Exception $e) {
|
79 |
+
$this->errorMessage = "Warning: cannot connect to ICEcat. {$e->getMessage()}";
|
80 |
+
return false;
|
81 |
+
}
|
82 |
+
Varien_Profiler::stop('Bintime FILE DOWNLOAD:');
|
83 |
+
$resultString = $response->getBody();
|
84 |
+
Mage::app()->getCache()->save($resultString, $this->_cacheKey . $entityId);
|
85 |
+
} else {
|
86 |
+
$resultString = $cacheDataXml;
|
87 |
+
}
|
88 |
+
if(!$this->parseXml($resultString)){
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
|
92 |
+
if ($this->checkIcecatResponse($productId, $vendorName)){
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
$this->loadProductDescriptionList();
|
97 |
+
$this->loadOtherProductParams();
|
98 |
+
$this->loadGalleryPhotos();
|
99 |
+
Varien_Profiler::start('Bintime FILE RELATED');
|
100 |
+
$this->loadRelatedProducts();
|
101 |
+
Varien_Profiler::stop('Bintime FILE RELATED');
|
102 |
+
}
|
103 |
+
return true;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getSystemError(){
|
107 |
+
return $this->errorSystemMessage;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getProductName(){
|
111 |
+
return $this->productName;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getGalleryPhotos(){
|
115 |
+
return $this->galleryPhotos;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* load Gallery array from XML
|
120 |
+
*/
|
121 |
+
private function loadGalleryPhotos(){
|
122 |
+
$galleryPhotos = $this->simpleDoc->Product->ProductGallery->ProductPicture;
|
123 |
+
if (!count($galleryPhotos)){
|
124 |
+
return false;
|
125 |
+
}
|
126 |
+
foreach($galleryPhotos as $photo){
|
127 |
+
if($photo["Size"] > 0){//if
|
128 |
+
$picHeight = (int)$photo["PicHeight"];
|
129 |
+
$picWidth = (int)$photo["PicWidth"];
|
130 |
+
$thumbUrl = (string)$photo["ThumbPic"];
|
131 |
+
$picUrl = (string)$photo["Pic"];
|
132 |
+
|
133 |
+
array_push($this->galleryPhotos, array(
|
134 |
+
'height' => $picHeight,
|
135 |
+
'width' => $picWidth,
|
136 |
+
'thumb' => $thumbUrl,
|
137 |
+
'pic' => $picUrl
|
138 |
+
));
|
139 |
+
}//endif
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getErrorMessage(){
|
144 |
+
return $this->errorMessage;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Checks response XML for error messages
|
149 |
+
* @param int $productId
|
150 |
+
* @param string $vendorName
|
151 |
+
*/
|
152 |
+
private function checkIcecatResponse($productId, $vendorName){
|
153 |
+
$errorMessage = $this->simpleDoc->Product['ErrorMessage'];
|
154 |
+
if ($errorMessage != ''){
|
155 |
+
if (preg_match('/^No xml data/', $errorMessage)){
|
156 |
+
$this->errorSystemMessage = $errorMessage;
|
157 |
+
return true;
|
158 |
+
}
|
159 |
+
if (preg_match('/^The specified vendor does not exist$/', $errorMessage)) {
|
160 |
+
$this->errorSystemMessage = $errorMessage;
|
161 |
+
return true;
|
162 |
+
}
|
163 |
+
$this->errorMessage = "Ice Cat Error: ".$errorMessage;
|
164 |
+
return true;
|
165 |
+
}
|
166 |
+
return false;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function getProductDescriptionList(){
|
170 |
+
return $this->productDescriptionList;
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
public function getShortProductDescription(){
|
175 |
+
return $this->productDescription;
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getFullProductDescription(){
|
179 |
+
return $this->fullProductDescription;
|
180 |
+
}
|
181 |
+
|
182 |
+
public function getLowPicUrl(){
|
183 |
+
return $this->highPicUrl;
|
184 |
+
}
|
185 |
+
|
186 |
+
public function getRelatedProducts(){
|
187 |
+
return $this->relatedProducts;
|
188 |
+
}
|
189 |
+
|
190 |
+
public function getVendor(){
|
191 |
+
return $this->vendor;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function getMPN(){
|
195 |
+
return $this->productId;
|
196 |
+
}
|
197 |
+
|
198 |
+
public function getEAN(){
|
199 |
+
return $this->EAN;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Form related products Array
|
204 |
+
*/
|
205 |
+
private function loadRelatedProducts(){
|
206 |
+
$relatedProductsArray = $this->simpleDoc->Product->ProductRelated;
|
207 |
+
if(count($relatedProductsArray)){
|
208 |
+
foreach($relatedProductsArray as $product){
|
209 |
+
$productArray = array();
|
210 |
+
$productNS = $product->Product;
|
211 |
+
$productArray['name'] = (string)$productNS['Name'];
|
212 |
+
$productArray['thumb'] = (string)$productNS['ThumbPic'];
|
213 |
+
$mpn = (string)$productNS['Prod_id'];
|
214 |
+
$productSupplier = $productNS->Supplier;
|
215 |
+
$productSupplierId = (int)$productSupplier['ID'];
|
216 |
+
$productArray['supplier_thumb'] = 'http://images2.icecat.biz/thumbs/SUP'.$productSupplierId.'.jpg';
|
217 |
+
$productArray['supplier_name'] = (string)$productSupplier['Name'];
|
218 |
+
|
219 |
+
$this->relatedProducts[$mpn] = $productArray;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Form product feature Arrray
|
226 |
+
*/
|
227 |
+
private function loadProductDescriptionList(){
|
228 |
+
$descriptionArray = array();
|
229 |
+
|
230 |
+
$specGroups = $this->simpleDoc->Product->CategoryFeatureGroup;
|
231 |
+
$specFeatures = $this->simpleDoc->Product->ProductFeature;
|
232 |
+
foreach($specFeatures as $feature){
|
233 |
+
$id = (int)$feature['CategoryFeatureGroup_ID'];
|
234 |
+
$featureText = (string)$feature["Presentation_Value"];
|
235 |
+
$featureName = (string)$feature->Feature->Name["Value"];
|
236 |
+
foreach($specGroups as $group){
|
237 |
+
$groupId = (int)$group["ID"];
|
238 |
+
if ($groupId == $id){
|
239 |
+
$groupName = (string) $group->FeatureGroup->Name["Value"];
|
240 |
+
$rating = (int)$group['No'];
|
241 |
+
$descriptionArray[$rating][$groupName][$featureName] = $featureText;
|
242 |
+
break;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
krsort($descriptionArray);
|
247 |
+
$this->productDescriptionList = $descriptionArray;
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Form Array of non feature-value product params
|
252 |
+
*/
|
253 |
+
private function loadOtherProductParams(){
|
254 |
+
$this->productDescription = (string) $this->simpleDoc->Product->ProductDescription['ShortDesc'];
|
255 |
+
$this->fullProductDescription = (string)$this->simpleDoc->Product->ProductDescription['LongDesc'];
|
256 |
+
$productTag = $this->simpleDoc->Product;
|
257 |
+
$this->lowPicUrl = (string)$productTag["LowPic"];
|
258 |
+
$this->highPicUrl = (string)$productTag["HighPic"];
|
259 |
+
$this->productName = (string)$productTag["Name"];
|
260 |
+
$this->productId = (string)$productTag['Prod_id'];
|
261 |
+
$this->vendor = (string)$productTag->Supplier['Name'];
|
262 |
+
$prodEAN = $productTag->EANCode;
|
263 |
+
$EANstr='';
|
264 |
+
$EANarr=null;
|
265 |
+
$j = 0;//counter
|
266 |
+
foreach($prodEAN as $ellEAN){
|
267 |
+
$EANarr[]=$ellEAN['EAN'];$j++;
|
268 |
+
}
|
269 |
+
$i = 0;
|
270 |
+
for($i=0;$i<$j;$i++){
|
271 |
+
$g = $i%2;
|
272 |
+
if($g == '0'){if($j == 1){$str .= $EANarr[$i].'<br>';} else {$str .= $EANarr[$i].', ';}
|
273 |
+
}
|
274 |
+
else {if($i != $j-1){$str .= $EANarr[$i].', <br>';}else {$str .= $EANarr[$i].' <br>';}}
|
275 |
+
}
|
276 |
+
$this->EAN = $str;
|
277 |
+
//$EANstr=implode(",",$EANarr);
|
278 |
+
//$this->EAN = (string)$EANstr;//$productTag->EANCode['EAN'];
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* parse response XML: to SimpleXml
|
283 |
+
* @param string $stringXml
|
284 |
+
*/
|
285 |
+
private function parseXml($stringXml){
|
286 |
+
libxml_use_internal_errors(true);
|
287 |
+
$this->simpleDoc = simplexml_load_string($stringXml);
|
288 |
+
if ($this->simpleDoc){
|
289 |
+
return true;
|
290 |
+
}
|
291 |
+
$this->simpleDoc = simplexml_load_string(utf8_encode($stringXml));
|
292 |
+
if ($this->simpleDoc){
|
293 |
+
return true;
|
294 |
+
}
|
295 |
+
return false;
|
296 |
+
}
|
297 |
+
}
|
298 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/Observer.php
ADDED
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class provides category page with images, cron processing
|
4 |
+
*
|
5 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Bintime_Icecatimport_Model_Observer
|
9 |
+
{
|
10 |
+
private $errorMessage;
|
11 |
+
private $connection;
|
12 |
+
|
13 |
+
private $freeExportURLs = 'http://data.icecat.biz/export/freeurls/export_urls_rich.txt.gz';
|
14 |
+
private $fullExportURLs = 'http://data.icecat.biz/export/export_urls_rich.txt.gz';
|
15 |
+
protected $_supplierMappingUrl = 'http://data.icecat.biz/export/freeurls/supplier_mapping.xml';
|
16 |
+
protected $_connectorDir = '/bintime/icecatimport/';
|
17 |
+
protected $_productFile;
|
18 |
+
protected $_supplierFile;
|
19 |
+
|
20 |
+
protected function _construct()
|
21 |
+
{
|
22 |
+
$this->_init('icecatimport/observer');
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* root method for uploading images to DB
|
27 |
+
*/
|
28 |
+
public function load(){
|
29 |
+
|
30 |
+
$loadUrl = $this->getLoadURL();
|
31 |
+
ini_set('max_execution_time', 0);
|
32 |
+
|
33 |
+
try {
|
34 |
+
$this->_productFile = $this->_prepareFile(basename($loadUrl));
|
35 |
+
$this->_supplierFile = $this->_prepareFile(basename($this->_supplierMappingUrl));
|
36 |
+
echo "Data file downloading started <br>";
|
37 |
+
|
38 |
+
$this->downloadFile($this->_productFile, $loadUrl);
|
39 |
+
echo "Start of supplier mapping file download<br>";
|
40 |
+
$this->downloadFile($this->_supplierFile, $this->_supplierMappingUrl);
|
41 |
+
$this->XMLfile = Mage::getBaseDir('var') . $this->_connectorDir . basename($loadUrl, ".gz");
|
42 |
+
echo "Start Unzipping Data File<br>";
|
43 |
+
$this->unzipFile();
|
44 |
+
echo "Start File Processing<br>";
|
45 |
+
|
46 |
+
$this->_loadSupplierListToDb();
|
47 |
+
$this->loadFileToDb();
|
48 |
+
|
49 |
+
echo "File Processed Succesfully<br>";
|
50 |
+
} catch( Exception $e) {
|
51 |
+
echo $e->getMessage();
|
52 |
+
Mage::log($e->getMessage());
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* parse given XML to SIMPLE XML
|
58 |
+
* @param string $stringXml
|
59 |
+
*/
|
60 |
+
protected function _parseXml($stringXml){
|
61 |
+
libxml_use_internal_errors(true);
|
62 |
+
$simpleDoc = simplexml_load_string($stringXml);
|
63 |
+
if ($simpleDoc){
|
64 |
+
return $simpleDoc;
|
65 |
+
}
|
66 |
+
$simpleDoc = simplexml_load_string(utf8_encode($stringXml));
|
67 |
+
if ($simpleDoc){
|
68 |
+
return $simpleDoc;
|
69 |
+
}
|
70 |
+
return false;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Upload supplier mapping list to Database
|
75 |
+
*/
|
76 |
+
protected function _loadSupplierListToDb()
|
77 |
+
{
|
78 |
+
$connection = $this->getDbConnection();
|
79 |
+
$mappingTable = Mage::getSingleton('core/resource')->getTableName('icecatimport/supplier_mapping');
|
80 |
+
try {
|
81 |
+
$connection->beginTransaction();
|
82 |
+
$xmlString = file_get_contents($this->_supplierFile);
|
83 |
+
$xmlDoc = $this->_parseXml($xmlString);
|
84 |
+
if ($xmlDoc) {
|
85 |
+
$connection->query("DROP TABLE IF EXISTS `".$mappingTable."_temp`");
|
86 |
+
$connection->query("
|
87 |
+
CREATE TABLE `".$mappingTable."_temp` (
|
88 |
+
`supplier_id` int(11) NOT NULL,
|
89 |
+
`supplier_symbol` varchar(255) DEFAULT NULL,
|
90 |
+
KEY `supplier_id` (`supplier_id`)
|
91 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
92 |
+
");
|
93 |
+
|
94 |
+
$supplierList = $xmlDoc->SupplierMappings->SupplierMapping;
|
95 |
+
foreach ($supplierList as $supplier) {
|
96 |
+
$supplierSymbolList = $supplier->Symbol;
|
97 |
+
$supplierId = $supplier['supplier_id'];
|
98 |
+
foreach($supplierSymbolList as $symbol) {
|
99 |
+
$symbolName = (string)$symbol;
|
100 |
+
$connection->insert($mappingTable."_temp", array('supplier_id' => $supplierId, 'supplier_symbol' => $symbolName));
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
$connection->query("DROP TABLE IF EXISTS `".$mappingTable."_old`");
|
105 |
+
$connection->query("rename table `".$mappingTable."` to `".$mappingTable."_old`, `".$mappingTable."_temp` to ".$mappingTable);
|
106 |
+
|
107 |
+
$connection->commit();
|
108 |
+
} else {
|
109 |
+
throw new Exception('Unable to process supplier file');
|
110 |
+
}
|
111 |
+
} catch (Exception $e) {
|
112 |
+
$connection->rollBack();
|
113 |
+
throw new Exception("Icecat Import Terminated: {$e->getMessage()}");
|
114 |
+
}
|
115 |
+
}
|
116 |
+
/**
|
117 |
+
* retrieve URL of data file that corresponds ICEcat account
|
118 |
+
*/
|
119 |
+
private function getLoadURL(){
|
120 |
+
$subscripionLevel = Mage::getStoreConfig('icecat_root/icecat/icecat_type');
|
121 |
+
if ($subscripionLevel === 'full'){
|
122 |
+
return $this->fullExportURLs;
|
123 |
+
}
|
124 |
+
else {
|
125 |
+
return $this->freeExportURLs;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* return error messages
|
131 |
+
*/
|
132 |
+
public function getErrorMessage(){
|
133 |
+
return $this->errorMessage;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* getImage URL from DB
|
138 |
+
* @param string $productSku
|
139 |
+
* @param string $productManufacturer
|
140 |
+
*/
|
141 |
+
public function getImageURL($productSku, $productManufacturer){
|
142 |
+
$connection = $this->getDbConnection();
|
143 |
+
try {
|
144 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('icecatimport/data');
|
145 |
+
$mappingTable = Mage::getSingleton('core/resource')->getTableName('icecatimport/supplier_mapping');
|
146 |
+
|
147 |
+
$selectCondition = $connection->select()
|
148 |
+
->from(array('connector' => $tableName), new Zend_Db_Expr('connector.prod_img'))
|
149 |
+
->joinInner(array('supplier' => $mappingTable), "connector.supplier_id = supplier.supplier_id AND supplier.supplier_symbol = {$this->connection->quote($productManufacturer)}")
|
150 |
+
->where('connector.prod_id = ? ', $productSku);
|
151 |
+
$imageURL = $connection->fetchOne($selectCondition);
|
152 |
+
if (empty($imageURL)){
|
153 |
+
$this->errorMessage = "Given product id is not present in database";
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
return $imageURL;
|
157 |
+
} catch (Exception $e) {
|
158 |
+
$this->errorMessage = "DB ERROR: {$e->getMessage()}";
|
159 |
+
return false;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Singletong for DB connection
|
165 |
+
*/
|
166 |
+
private function getDbConnection(){
|
167 |
+
if ($this->connection){
|
168 |
+
return $this->connection;
|
169 |
+
}
|
170 |
+
$this->connection = Mage::getSingleton('core/resource')->getConnection('core_read');
|
171 |
+
return $this->connection;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Upload Data file to DP
|
176 |
+
*/
|
177 |
+
private function loadFileToDb(){
|
178 |
+
$connection = $this->getDbConnection();
|
179 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName('icecatimport/data');
|
180 |
+
try {
|
181 |
+
$connection->beginTransaction();
|
182 |
+
$fileHandler = fopen($this->XMLfile, "r");
|
183 |
+
if ($fileHandler) {
|
184 |
+
$connection->query("DROP TABLE IF EXISTS `".$tableName."_temp`");
|
185 |
+
$connection->query("
|
186 |
+
CREATE TABLE `".$tableName."_temp` (
|
187 |
+
`prod_id` varchar(255) NOT NULL,
|
188 |
+
`supplier_id` int(11) DEFAULT NULL,
|
189 |
+
`prod_name` varchar(255) DEFAULT NULL,
|
190 |
+
`prod_img` varchar(255) DEFAULT NULL,
|
191 |
+
KEY `PRODUCT_MPN` (`prod_id`),
|
192 |
+
KEY `supplier_id` (`supplier_id`)
|
193 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
194 |
+
");
|
195 |
+
while (!feof($fileHandler)) {
|
196 |
+
$row = fgets($fileHandler);
|
197 |
+
$oneLine = explode("\t", $row);
|
198 |
+
if ($oneLine[0]!= 'product_id' && $oneLine[0]!= ''){
|
199 |
+
try{
|
200 |
+
$connection->insert($tableName."_temp", array('prod_id' => $oneLine[1], 'prod_img' => $oneLine[6], 'prod_name' => $oneLine[12], 'supplier_id' => $oneLine[13]));
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
catch(Exception $e){
|
205 |
+
Mage::log("connector issue: {$e->getMessage()}");
|
206 |
+
}
|
207 |
+
|
208 |
+
}
|
209 |
+
}
|
210 |
+
$connection->query("DROP TABLE IF EXISTS `".$tableName."_old`");
|
211 |
+
$connection->query("rename table `".$tableName."` to `".$tableName."_old`, `".$tableName."_temp` to ".$tableName);
|
212 |
+
|
213 |
+
|
214 |
+
$connection->commit();
|
215 |
+
fclose($fileHandler);
|
216 |
+
}
|
217 |
+
} catch (Exception $e) {
|
218 |
+
$connection->rollBack();
|
219 |
+
throw new Exception("Icecat Import Terminated: {$e->getMessage()}");
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* unzip Uploaded file
|
225 |
+
*/
|
226 |
+
private function unzipFile(){
|
227 |
+
$gz = gzopen ( $this->_productFile, 'rb' );
|
228 |
+
|
229 |
+
if (file_exists($this->XMLfile)){
|
230 |
+
unlink($this->XMLfile);
|
231 |
+
}
|
232 |
+
|
233 |
+
$fileToWrite = @fopen($this->XMLfile, 'w+');
|
234 |
+
|
235 |
+
if (!$fileToWrite){
|
236 |
+
$this->errorMessage = 'Unable to open output txt file. Please remove all *.txt files from '.
|
237 |
+
Mage::getBaseDir('var'). $this->_connectorDir .'folder';
|
238 |
+
return false;
|
239 |
+
}
|
240 |
+
while (!gzeof($gz)) {
|
241 |
+
$buffer = gzgets($gz, 100000);
|
242 |
+
fputs($fileToWrite, $buffer) ;
|
243 |
+
}
|
244 |
+
gzclose ($gz);
|
245 |
+
fclose($fileToWrite);
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Process downloading files
|
250 |
+
* @param string $destinationFile
|
251 |
+
* @param string $loadUrl
|
252 |
+
*/
|
253 |
+
private function downloadFile($destinationFile, $loadUrl){
|
254 |
+
$userName = Mage::getStoreConfig('icecat_root/icecat/login');
|
255 |
+
$userPass = Mage::getStoreConfig('icecat_root/icecat/password');
|
256 |
+
$fileToWrite = @fopen($destinationFile, 'w+');
|
257 |
+
|
258 |
+
try{
|
259 |
+
$webClient = new Zend_Http_Client();
|
260 |
+
$webClient->setUri($loadUrl);
|
261 |
+
$webClient->setMethod(Zend_Http_Client::GET);
|
262 |
+
$webClient->setHeaders('Content-Type: text/xml; charset=UTF-8');
|
263 |
+
$webClient->setAuth($userName, $userPass, Zend_Http_CLient::AUTH_BASIC);
|
264 |
+
$response = $webClient->request();
|
265 |
+
if ($response->isError()){
|
266 |
+
throw new Exception('<br>ERROR Occured.<br>Response Status: '.$response->getStatus()."<br>Response Message: ".$response->getMessage());
|
267 |
+
}
|
268 |
+
}
|
269 |
+
catch (Exception $e) {
|
270 |
+
throw new Exception("Warning: cannot connect to ICEcat. {$e->getMessage()}");
|
271 |
+
}
|
272 |
+
$resultString = $response->getBody();
|
273 |
+
fwrite($fileToWrite, $resultString);
|
274 |
+
fclose($fileToWrite);
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Prepares file and folder for futur download
|
279 |
+
* @param string $fileName
|
280 |
+
*/
|
281 |
+
protected function _prepareFile($fileName){
|
282 |
+
$varDir = Mage::getBaseDir('var') . $this->_connectorDir;
|
283 |
+
$filePath = $varDir . $fileName;
|
284 |
+
if (!is_dir($varDir)){
|
285 |
+
mkdir($varDir, 0777, true);
|
286 |
+
}
|
287 |
+
|
288 |
+
if (file_exists($filePath)){
|
289 |
+
unlink($filePath);
|
290 |
+
}
|
291 |
+
|
292 |
+
return $filePath;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Attributes.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Provides product Attributes for BO menu
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_System_Config_Attributes
|
8 |
+
{
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
$attributesArray = Mage::getResourceModel('eav/entity_attribute_collection')
|
12 |
+
->setAttributeSetFilter(Mage::getResourceSingleton('catalog/product')->getEntityType()->getDefaultAttributeSetId());
|
13 |
+
$outputAttributeArray = array();
|
14 |
+
foreach($attributesArray as $attribute){
|
15 |
+
$outputAttributeArray[$attribute['attribute_code']]=$attribute['attribute_code'];
|
16 |
+
}
|
17 |
+
ksort($outputAttributeArray);
|
18 |
+
return $outputAttributeArray;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/LanguageList.xml
ADDED
@@ -0,0 +1,399 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!DOCTYPE ICECAT-interface SYSTEM "http://data.icecat.biz/dtd/ICECAT-interface_response.dtd">
|
3 |
+
<!-- source: ICEcat.biz 2009 -->
|
4 |
+
<ICECAT-interface>
|
5 |
+
<Response ID="50564949" Status="1" Date="Thu Oct 22 04:26:04 2009" Request_ID="1256178364">
|
6 |
+
<LanguageList>
|
7 |
+
<Language Code="portuguese" ID="11" ShortCode="PT" Sid="6184">
|
8 |
+
<Name ID="40191" Value="Portuguese-Portuguese" langid="1"/>
|
9 |
+
<Name ID="40192" Value="Portuguese-Portuguese" langid="2"/>
|
10 |
+
<Name ID="40193" Value="Portuguese-Portuguese" langid="3"/>
|
11 |
+
<Name ID="40194" Value="Portuguese-Portuguese" langid="4"/>
|
12 |
+
<Name ID="40195" Value="Portuguese-Portuguese" langid="5"/>
|
13 |
+
<Name ID="40196" Value="Portuguese-Portuguese" langid="6"/>
|
14 |
+
<Name ID="198032" Value="Португальский-португальский" langid="8"/>
|
15 |
+
<Name ID="50889" Value="" langid="12"/>
|
16 |
+
<Name ID="205069" Value="Португальcька-Португалія" langid="25"/>
|
17 |
+
</Language>
|
18 |
+
<Language Code="bulgarian" ID="21" ShortCode="BG" Sid="9218">
|
19 |
+
<Name ID="147616" Value="Bulgarian" langid="1"/>
|
20 |
+
<Name ID="198042" Value="Болгарский" langid="8"/>
|
21 |
+
<Name ID="205079" Value="Болгарська" langid="25"/>
|
22 |
+
</Language>
|
23 |
+
<Language Code="danish" ID="7" ShortCode="DK" Sid="6058">
|
24 |
+
<Name ID="39312" Value="Danish" langid="1"/>
|
25 |
+
<Name ID="39313" Value="Danish" langid="2"/>
|
26 |
+
<Name ID="39314" Value="Danish" langid="3"/>
|
27 |
+
<Name ID="39315" Value="Danish" langid="4"/>
|
28 |
+
<Name ID="39316" Value="Danish" langid="5"/>
|
29 |
+
<Name ID="39317" Value="Danish" langid="6"/>
|
30 |
+
<Name ID="39318" Value="Danish" langid="7"/>
|
31 |
+
<Name ID="198028" Value="Датский" langid="8"/>
|
32 |
+
<Name ID="40294" Value="Danish" langid="9"/>
|
33 |
+
<Name ID="40295" Value="Danish" langid="10"/>
|
34 |
+
<Name ID="40296" Value="Danish" langid="11"/>
|
35 |
+
<Name ID="40297" Value="Danish" langid="12"/>
|
36 |
+
<Name ID="40298" Value="Danish" langid="13"/>
|
37 |
+
<Name ID="40299" Value="Danish" langid="14"/>
|
38 |
+
<Name ID="40300" Value="Danish" langid="15"/>
|
39 |
+
<Name ID="40301" Value="Danish" langid="16"/>
|
40 |
+
<Name ID="40302" Value="Danish" langid="17"/>
|
41 |
+
<Name ID="205065" Value="Датська" langid="25"/>
|
42 |
+
</Language>
|
43 |
+
<Language Code="japanese" ID="26" ShortCode="JA" Sid="9635">
|
44 |
+
<Name ID="224188" Value="Japanese" langid="1"/>
|
45 |
+
<Name ID="224189" Value="Japanese" langid="2"/>
|
46 |
+
<Name ID="224190" Value="Japanese" langid="3"/>
|
47 |
+
<Name ID="224191" Value="Japanese" langid="4"/>
|
48 |
+
<Name ID="224192" Value="Japanese" langid="5"/>
|
49 |
+
<Name ID="224193" Value="Japanese" langid="6"/>
|
50 |
+
<Name ID="224194" Value="Японский" langid="8"/>
|
51 |
+
<Name ID="224195" Value="Японська" langid="25"/>
|
52 |
+
<Name ID="224196" Value="Japanese" langid="26"/>
|
53 |
+
</Language>
|
54 |
+
<Language Code="finnish" ID="17" ShortCode="FI" Sid="6190">
|
55 |
+
<Name ID="40227" Value="Finnish" langid="1"/>
|
56 |
+
<Name ID="40228" Value="Finnish" langid="2"/>
|
57 |
+
<Name ID="40229" Value="Finnish" langid="3"/>
|
58 |
+
<Name ID="40230" Value="Finnish" langid="4"/>
|
59 |
+
<Name ID="40231" Value="Finnish" langid="5"/>
|
60 |
+
<Name ID="40232" Value="Finnish" langid="6"/>
|
61 |
+
<Name ID="198038" Value="Финский" langid="8"/>
|
62 |
+
<Name ID="50895" Value="" langid="12"/>
|
63 |
+
<Name ID="205075" Value="Фінська" langid="25"/>
|
64 |
+
</Language>
|
65 |
+
<Language Code="dutch" ID="2" ShortCode="NL" Sid="3">
|
66 |
+
<Name ID="3" Value="Dutch" langid="1"/>
|
67 |
+
<Name ID="4" Value="Dutch" langid="2"/>
|
68 |
+
<Name ID="6074" Value="Dutch" langid="3"/>
|
69 |
+
<Name ID="14099" Value="Dutch" langid="4"/>
|
70 |
+
<Name ID="18231" Value="Dutch" langid="5"/>
|
71 |
+
<Name ID="22363" Value="Dutch" langid="6"/>
|
72 |
+
<Name ID="34054" Value="Hollandsk" langid="7"/>
|
73 |
+
<Name ID="198023" Value="Голландский" langid="8"/>
|
74 |
+
<Name ID="40244" Value="Dutch" langid="9"/>
|
75 |
+
<Name ID="40245" Value="Dutch" langid="10"/>
|
76 |
+
<Name ID="40246" Value="Dutch" langid="11"/>
|
77 |
+
<Name ID="40247" Value="Dutch" langid="12"/>
|
78 |
+
<Name ID="40248" Value="Dutch" langid="13"/>
|
79 |
+
<Name ID="40249" Value="Dutch" langid="14"/>
|
80 |
+
<Name ID="40250" Value="Dutch" langid="15"/>
|
81 |
+
<Name ID="40251" Value="Dutch" langid="16"/>
|
82 |
+
<Name ID="40252" Value="Dutch" langid="17"/>
|
83 |
+
<Name ID="205060" Value="Голландська" langid="25"/>
|
84 |
+
</Language>
|
85 |
+
<Language Code="georgian" ID="22" ShortCode="KA" Sid="9271">
|
86 |
+
<Name ID="154954" Value="Georgian" langid="1"/>
|
87 |
+
<Name ID="198043" Value="Грузинский" langid="8"/>
|
88 |
+
<Name ID="205080" Value="Грузинська" langid="25"/>
|
89 |
+
</Language>
|
90 |
+
<Language Code="english" ID="1" ShortCode="EN" Sid="2">
|
91 |
+
<Name ID="1" Value="English" langid="1"/>
|
92 |
+
<Name ID="2" Value="English" langid="2"/>
|
93 |
+
<Name ID="6073" Value="English" langid="3"/>
|
94 |
+
<Name ID="14098" Value="English" langid="4"/>
|
95 |
+
<Name ID="18230" Value="English" langid="5"/>
|
96 |
+
<Name ID="22362" Value="English" langid="6"/>
|
97 |
+
<Name ID="34053" Value="Engelsk" langid="7"/>
|
98 |
+
<Name ID="198022" Value="Английский" langid="8"/>
|
99 |
+
<Name ID="40234" Value="English" langid="9"/>
|
100 |
+
<Name ID="40235" Value="English" langid="10"/>
|
101 |
+
<Name ID="40236" Value="English" langid="11"/>
|
102 |
+
<Name ID="40237" Value="English" langid="12"/>
|
103 |
+
<Name ID="40238" Value="English" langid="13"/>
|
104 |
+
<Name ID="40239" Value="English" langid="14"/>
|
105 |
+
<Name ID="40240" Value="English" langid="15"/>
|
106 |
+
<Name ID="40241" Value="English" langid="16"/>
|
107 |
+
<Name ID="40242" Value="English" langid="17"/>
|
108 |
+
<Name ID="205059" Value="Англійська" langid="25"/>
|
109 |
+
</Language>
|
110 |
+
<Language Code="greek" ID="18" ShortCode="EL" Sid="8587">
|
111 |
+
<Name ID="113508" Value="Greek" langid="1"/>
|
112 |
+
<Name ID="113509" Value="Greek" langid="2"/>
|
113 |
+
<Name ID="113510" Value="Greek" langid="3"/>
|
114 |
+
<Name ID="113511" Value="Greek" langid="4"/>
|
115 |
+
<Name ID="113512" Value="Greek" langid="5"/>
|
116 |
+
<Name ID="113513" Value="Greek" langid="6"/>
|
117 |
+
<Name ID="198039" Value="Греческий" langid="8"/>
|
118 |
+
<Name ID="205076" Value="Грецька" langid="25"/>
|
119 |
+
</Language>
|
120 |
+
<Language Code="romanian" ID="23" ShortCode="RO" Sid="9390">
|
121 |
+
<Name ID="169100" Value="Romanian" langid="1"/>
|
122 |
+
<Name ID="169101" Value="Romanian" langid="2"/>
|
123 |
+
<Name ID="169102" Value="Romanian" langid="3"/>
|
124 |
+
<Name ID="169103" Value="Romanian" langid="4"/>
|
125 |
+
<Name ID="169104" Value="Romanian" langid="5"/>
|
126 |
+
<Name ID="169105" Value="Romanian" langid="6"/>
|
127 |
+
<Name ID="198044" Value="Румынский" langid="8"/>
|
128 |
+
<Name ID="205081" Value="Румунська" langid="25"/>
|
129 |
+
</Language>
|
130 |
+
<Language Code="hungarian" ID="16" ShortCode="HU" Sid="6189">
|
131 |
+
<Name ID="40221" Value="Hungarian" langid="1"/>
|
132 |
+
<Name ID="40222" Value="Hungarian" langid="2"/>
|
133 |
+
<Name ID="40223" Value="Hungarian" langid="3"/>
|
134 |
+
<Name ID="40224" Value="Hungarian" langid="4"/>
|
135 |
+
<Name ID="40225" Value="Hungarian" langid="5"/>
|
136 |
+
<Name ID="40226" Value="Hungarian" langid="6"/>
|
137 |
+
<Name ID="198037" Value="Венгерский" langid="8"/>
|
138 |
+
<Name ID="50894" Value="" langid="12"/>
|
139 |
+
<Name ID="205074" Value="Угорська" langid="25"/>
|
140 |
+
</Language>
|
141 |
+
<Language Code="swedish" ID="13" ShortCode="SE" Sid="6186">
|
142 |
+
<Name ID="40203" Value="Swedish" langid="1"/>
|
143 |
+
<Name ID="40204" Value="Swedish" langid="2"/>
|
144 |
+
<Name ID="40205" Value="Swedish" langid="3"/>
|
145 |
+
<Name ID="40206" Value="Swedish" langid="4"/>
|
146 |
+
<Name ID="40207" Value="Swedish" langid="5"/>
|
147 |
+
<Name ID="40208" Value="Swedish" langid="6"/>
|
148 |
+
<Name ID="198034" Value="Шведский" langid="8"/>
|
149 |
+
<Name ID="50891" Value="" langid="12"/>
|
150 |
+
<Name ID="205071" Value="Швецька" langid="25"/>
|
151 |
+
</Language>
|
152 |
+
<Language Code="croatian" ID="29" ShortCode="HR" Sid="10132">
|
153 |
+
<Name ID="270273" Value="Croatian" langid="1"/>
|
154 |
+
<Name ID="270274" Value="Croatian" langid="2"/>
|
155 |
+
<Name ID="270275" Value="Croatian" langid="3"/>
|
156 |
+
<Name ID="270276" Value="Croatian" langid="4"/>
|
157 |
+
<Name ID="270277" Value="Croatian" langid="5"/>
|
158 |
+
<Name ID="270278" Value="Croatian" langid="6"/>
|
159 |
+
<Name ID="270280" Value="Hrvatski" langid="29"/>
|
160 |
+
</Language>
|
161 |
+
<Language Code="catalan" ID="27" ShortCode="CA" Sid="9662">
|
162 |
+
<Name ID="231955" Value="Catalan" langid="1"/>
|
163 |
+
<Name ID="231956" Value="Catalan" langid="2"/>
|
164 |
+
<Name ID="231957" Value="Catalan" langid="3"/>
|
165 |
+
<Name ID="231958" Value="Catalan" langid="4"/>
|
166 |
+
<Name ID="231959" Value="Catalan" langid="5"/>
|
167 |
+
<Name ID="231960" Value="Catalan" langid="6"/>
|
168 |
+
<Name ID="231962" Value="Каталанский" langid="8"/>
|
169 |
+
<Name ID="231963" Value="Каталанська" langid="25"/>
|
170 |
+
<Name ID="231961" Value="Català" langid="27"/>
|
171 |
+
</Language>
|
172 |
+
<Language Code="ukrainian" ID="25" ShortCode="UK" Sid="9577">
|
173 |
+
<Name ID="198046" Value="Ukrainian" langid="1"/>
|
174 |
+
<Name ID="198047" Value="Ukrainian" langid="2"/>
|
175 |
+
<Name ID="198048" Value="Ukrainian" langid="3"/>
|
176 |
+
<Name ID="198049" Value="Ukrainian" langid="4"/>
|
177 |
+
<Name ID="198050" Value="Ukrainian" langid="5"/>
|
178 |
+
<Name ID="198051" Value="Ukrainian" langid="6"/>
|
179 |
+
<Name ID="198052" Value="Украинский" langid="8"/>
|
180 |
+
<Name ID="198053" Value="Українська" langid="25"/>
|
181 |
+
</Language>
|
182 |
+
<Language Code="spanish" ID="6" ShortCode="ES" Sid="4797">
|
183 |
+
<Name ID="14094" Value="Spanish" langid="1"/>
|
184 |
+
<Name ID="14095" Value="Spanish" langid="2"/>
|
185 |
+
<Name ID="14096" Value="Spanish" langid="3"/>
|
186 |
+
<Name ID="18228" Value="Spanish" langid="4"/>
|
187 |
+
<Name ID="106485" Value="Processo di simulazione dell'alba (intensità 0)" langid="5"/>
|
188 |
+
<Name ID="26492" Value="Spanish" langid="6"/>
|
189 |
+
<Name ID="38094" Value="Spansk" langid="7"/>
|
190 |
+
<Name ID="198027" Value="Испанский" langid="8"/>
|
191 |
+
<Name ID="40284" Value="Spanish" langid="9"/>
|
192 |
+
<Name ID="40285" Value="Spanish" langid="10"/>
|
193 |
+
<Name ID="40286" Value="Spanish" langid="11"/>
|
194 |
+
<Name ID="40287" Value="Spanish" langid="12"/>
|
195 |
+
<Name ID="40288" Value="Spanish" langid="13"/>
|
196 |
+
<Name ID="40289" Value="Spanish" langid="14"/>
|
197 |
+
<Name ID="40290" Value="Spanish" langid="15"/>
|
198 |
+
<Name ID="40291" Value="Spanish" langid="16"/>
|
199 |
+
<Name ID="40292" Value="Spanish" langid="17"/>
|
200 |
+
<Name ID="205064" Value="Іспанська" langid="25"/>
|
201 |
+
</Language>
|
202 |
+
<Language Code="argentinian-spanish" ID="28" ShortCode="AR" Sid="9835">
|
203 |
+
<Name ID="244259" Value="Argentinian-Spanish" langid="1"/>
|
204 |
+
<Name ID="244260" Value="Argentinian-Spanish" langid="2"/>
|
205 |
+
<Name ID="244261" Value="Argentinian-Spanish" langid="3"/>
|
206 |
+
<Name ID="244262" Value="Argentinian-Spanish" langid="4"/>
|
207 |
+
<Name ID="244263" Value="Argentinian-Spanish" langid="5"/>
|
208 |
+
<Name ID="244264" Value="Argentinian-Spanish" langid="6"/>
|
209 |
+
<Name ID="244265" Value="Argentinian-Spanish" langid="7"/>
|
210 |
+
<Name ID="244266" Value="Argentinian-Spanish" langid="8"/>
|
211 |
+
<Name ID="244267" Value="Argentinian-Spanish" langid="9"/>
|
212 |
+
<Name ID="244268" Value="Argentinian-Spanish" langid="10"/>
|
213 |
+
<Name ID="244269" Value="Argentinian-Spanish" langid="11"/>
|
214 |
+
<Name ID="244270" Value="Argentinian-Spanish" langid="12"/>
|
215 |
+
<Name ID="244271" Value="Argentinian-Spanish" langid="13"/>
|
216 |
+
<Name ID="244272" Value="Argentinian-Spanish" langid="14"/>
|
217 |
+
<Name ID="244273" Value="Argentinian-Spanish" langid="15"/>
|
218 |
+
<Name ID="244274" Value="Argentinian-Spanish" langid="16"/>
|
219 |
+
<Name ID="244275" Value="Argentinian-Spanish" langid="17"/>
|
220 |
+
<Name ID="244276" Value="Argentinian-Spanish" langid="18"/>
|
221 |
+
<Name ID="244277" Value="Argentinian-Spanish" langid="19"/>
|
222 |
+
<Name ID="244278" Value="Argentinian-Spanish" langid="20"/>
|
223 |
+
<Name ID="244279" Value="Argentinian-Spanish" langid="21"/>
|
224 |
+
<Name ID="244280" Value="Argentinian-Spanish" langid="22"/>
|
225 |
+
<Name ID="244281" Value="Argentinian-Spanish" langid="23"/>
|
226 |
+
<Name ID="244282" Value="Argentinian-Spanish" langid="24"/>
|
227 |
+
<Name ID="244283" Value="Argentinian-Spanish" langid="25"/>
|
228 |
+
<Name ID="244284" Value="Argentinian-Spanish" langid="26"/>
|
229 |
+
<Name ID="244285" Value="Argentinian-Spanish" langid="27"/>
|
230 |
+
<Name ID="244286" Value="Argentinian-Spanish" langid="28"/>
|
231 |
+
</Language>
|
232 |
+
<Language Code="french" ID="3" ShortCode="FR" Sid="3036">
|
233 |
+
<Name ID="6071" Value="French" langid="1"/>
|
234 |
+
<Name ID="6072" Value="French" langid="2"/>
|
235 |
+
<Name ID="8815" Value="French" langid="3"/>
|
236 |
+
<Name ID="16579" Value="French" langid="4"/>
|
237 |
+
<Name ID="103145" Value="Rapporto di compressione" langid="5"/>
|
238 |
+
<Name ID="24843" Value="French" langid="6"/>
|
239 |
+
<Name ID="36551" Value="Fransk" langid="7"/>
|
240 |
+
<Name ID="198024" Value="Французский" langid="8"/>
|
241 |
+
<Name ID="40254" Value="French" langid="9"/>
|
242 |
+
<Name ID="40255" Value="French" langid="10"/>
|
243 |
+
<Name ID="40256" Value="French" langid="11"/>
|
244 |
+
<Name ID="40257" Value="French" langid="12"/>
|
245 |
+
<Name ID="40258" Value="French" langid="13"/>
|
246 |
+
<Name ID="40259" Value="French" langid="14"/>
|
247 |
+
<Name ID="40260" Value="French" langid="15"/>
|
248 |
+
<Name ID="40261" Value="French" langid="16"/>
|
249 |
+
<Name ID="40262" Value="French" langid="17"/>
|
250 |
+
<Name ID="205061" Value="Французька" langid="25"/>
|
251 |
+
</Language>
|
252 |
+
<Language Code="us english" ID="9" ShortCode="US" Sid="6182">
|
253 |
+
<Name ID="40179" Value="US English" langid="1"/>
|
254 |
+
<Name ID="40180" Value="US English" langid="2"/>
|
255 |
+
<Name ID="40181" Value="US English" langid="3"/>
|
256 |
+
<Name ID="40182" Value="US English" langid="4"/>
|
257 |
+
<Name ID="40183" Value="US English" langid="5"/>
|
258 |
+
<Name ID="40184" Value="US English" langid="6"/>
|
259 |
+
<Name ID="198030" Value="Американский английский" langid="8"/>
|
260 |
+
<Name ID="50887" Value="" langid="12"/>
|
261 |
+
<Name ID="205067" Value="Англійська США" langid="25"/>
|
262 |
+
</Language>
|
263 |
+
<Language Code="chinese" ID="12" ShortCode="ZH" Sid="6185">
|
264 |
+
<Name ID="40197" Value="Chinese" langid="1"/>
|
265 |
+
<Name ID="40198" Value="Chinese" langid="2"/>
|
266 |
+
<Name ID="40199" Value="Chinese" langid="3"/>
|
267 |
+
<Name ID="40200" Value="Chinese" langid="4"/>
|
268 |
+
<Name ID="40201" Value="Chinese" langid="5"/>
|
269 |
+
<Name ID="40202" Value="Chinese" langid="6"/>
|
270 |
+
<Name ID="198033" Value="Китайский" langid="8"/>
|
271 |
+
<Name ID="50890" Value="" langid="12"/>
|
272 |
+
<Name ID="205070" Value="Китайська" langid="25"/>
|
273 |
+
</Language>
|
274 |
+
<Language Code="turkish" ID="20" ShortCode="TR" Sid="8665">
|
275 |
+
<Name ID="118819" Value="Turkish" langid="1"/>
|
276 |
+
<Name ID="118820" Value="Turkish" langid="2"/>
|
277 |
+
<Name ID="118821" Value="Turkish" langid="3"/>
|
278 |
+
<Name ID="118822" Value="Turkish" langid="4"/>
|
279 |
+
<Name ID="118823" Value="Turkish" langid="5"/>
|
280 |
+
<Name ID="118824" Value="Turkish" langid="6"/>
|
281 |
+
<Name ID="198041" Value="Турецкий" langid="8"/>
|
282 |
+
<Name ID="205078" Value="Турецька" langid="25"/>
|
283 |
+
</Language>
|
284 |
+
<Language Code="polish" ID="14" ShortCode="PL" Sid="6187">
|
285 |
+
<Name ID="40209" Value="Polish" langid="1"/>
|
286 |
+
<Name ID="40210" Value="Polish" langid="2"/>
|
287 |
+
<Name ID="40211" Value="Polish" langid="3"/>
|
288 |
+
<Name ID="40212" Value="Polish" langid="4"/>
|
289 |
+
<Name ID="40213" Value="Polish" langid="5"/>
|
290 |
+
<Name ID="40214" Value="Polish" langid="6"/>
|
291 |
+
<Name ID="198035" Value="Польский" langid="8"/>
|
292 |
+
<Name ID="50892" Value="" langid="12"/>
|
293 |
+
<Name ID="205072" Value="Польська" langid="25"/>
|
294 |
+
</Language>
|
295 |
+
<Language Code="czech" ID="15" ShortCode="CZ" Sid="6188">
|
296 |
+
<Name ID="40215" Value="Czech" langid="1"/>
|
297 |
+
<Name ID="40216" Value="Czech" langid="2"/>
|
298 |
+
<Name ID="40217" Value="Czech" langid="3"/>
|
299 |
+
<Name ID="40218" Value="Czech" langid="4"/>
|
300 |
+
<Name ID="40219" Value="Czech" langid="5"/>
|
301 |
+
<Name ID="40220" Value="Czech" langid="6"/>
|
302 |
+
<Name ID="198036" Value="Чешский" langid="8"/>
|
303 |
+
<Name ID="50893" Value="" langid="12"/>
|
304 |
+
<Name ID="205073" Value="Чеська" langid="25"/>
|
305 |
+
</Language>
|
306 |
+
<Language Code="russian" ID="8" ShortCode="RU" Sid="6181">
|
307 |
+
<Name ID="40173" Value="Russian" langid="1"/>
|
308 |
+
<Name ID="40174" Value="Russian" langid="2"/>
|
309 |
+
<Name ID="40175" Value="Russian" langid="3"/>
|
310 |
+
<Name ID="40176" Value="Russian" langid="4"/>
|
311 |
+
<Name ID="40177" Value="Russian" langid="5"/>
|
312 |
+
<Name ID="40178" Value="Russian" langid="6"/>
|
313 |
+
<Name ID="40303" Value="Russian" langid="7"/>
|
314 |
+
<Name ID="198029" Value="Русский" langid="8"/>
|
315 |
+
<Name ID="40305" Value="Russian" langid="9"/>
|
316 |
+
<Name ID="40306" Value="Russian" langid="10"/>
|
317 |
+
<Name ID="40307" Value="Russian" langid="11"/>
|
318 |
+
<Name ID="40308" Value="Russian" langid="12"/>
|
319 |
+
<Name ID="40309" Value="Russian" langid="13"/>
|
320 |
+
<Name ID="40310" Value="Russian" langid="14"/>
|
321 |
+
<Name ID="40311" Value="Russian" langid="15"/>
|
322 |
+
<Name ID="40312" Value="Russian" langid="16"/>
|
323 |
+
<Name ID="40313" Value="Russian" langid="17"/>
|
324 |
+
<Name ID="205066" Value="Російська" langid="25"/>
|
325 |
+
</Language>
|
326 |
+
<Language Code="german" ID="4" ShortCode="DE" Sid="4795">
|
327 |
+
<Name ID="14088" Value="German" langid="1"/>
|
328 |
+
<Name ID="14089" Value="German" langid="2"/>
|
329 |
+
<Name ID="14090" Value="German" langid="3"/>
|
330 |
+
<Name ID="18226" Value="German" langid="4"/>
|
331 |
+
<Name ID="104573" Value="Luce per una lettura agevole" langid="5"/>
|
332 |
+
<Name ID="26490" Value="German" langid="6"/>
|
333 |
+
<Name ID="38092" Value="Tysk" langid="7"/>
|
334 |
+
<Name ID="198025" Value="Немецкий" langid="8"/>
|
335 |
+
<Name ID="40264" Value="German" langid="9"/>
|
336 |
+
<Name ID="40265" Value="German" langid="10"/>
|
337 |
+
<Name ID="40266" Value="German" langid="11"/>
|
338 |
+
<Name ID="40267" Value="German" langid="12"/>
|
339 |
+
<Name ID="40268" Value="German" langid="13"/>
|
340 |
+
<Name ID="40269" Value="German" langid="14"/>
|
341 |
+
<Name ID="40270" Value="German" langid="15"/>
|
342 |
+
<Name ID="40271" Value="German" langid="16"/>
|
343 |
+
<Name ID="40272" Value="German" langid="17"/>
|
344 |
+
<Name ID="205062" Value="Німецька" langid="25"/>
|
345 |
+
</Language>
|
346 |
+
<Language Code="serbian" ID="24" ShortCode="SR" Sid="9443">
|
347 |
+
<Name ID="170887" Value="Serbian" langid="1"/>
|
348 |
+
<Name ID="170888" Value="Serbian" langid="2"/>
|
349 |
+
<Name ID="170889" Value="Serbian" langid="3"/>
|
350 |
+
<Name ID="170890" Value="Serbian" langid="4"/>
|
351 |
+
<Name ID="170891" Value="Serbian" langid="5"/>
|
352 |
+
<Name ID="170892" Value="Serbian" langid="6"/>
|
353 |
+
<Name ID="198045" Value="Сербский" langid="8"/>
|
354 |
+
<Name ID="205082" Value="Сербська" langid="25"/>
|
355 |
+
</Language>
|
356 |
+
<Language Code="norwegian" ID="19" ShortCode="NO" Sid="8664">
|
357 |
+
<Name ID="118813" Value="Norwegian" langid="1"/>
|
358 |
+
<Name ID="118814" Value="Norwegian" langid="2"/>
|
359 |
+
<Name ID="118815" Value="Norwegian" langid="3"/>
|
360 |
+
<Name ID="118816" Value="Norwegian" langid="4"/>
|
361 |
+
<Name ID="118817" Value="Norwegian" langid="5"/>
|
362 |
+
<Name ID="118818" Value="Norwegian" langid="6"/>
|
363 |
+
<Name ID="198040" Value="Норвежский" langid="8"/>
|
364 |
+
<Name ID="205077" Value="Норвезька" langid="25"/>
|
365 |
+
</Language>
|
366 |
+
<Language Code="brazilian-portuguese" ID="10" ShortCode="BR" Sid="6183">
|
367 |
+
<Name ID="40185" Value="Brazilian-Portuguese" langid="1"/>
|
368 |
+
<Name ID="40186" Value="Brazilian-Portuguese" langid="2"/>
|
369 |
+
<Name ID="40187" Value="Brazilian-Portuguese" langid="3"/>
|
370 |
+
<Name ID="40188" Value="Brazilian-Portuguese" langid="4"/>
|
371 |
+
<Name ID="40189" Value="Brazilian-Portuguese" langid="5"/>
|
372 |
+
<Name ID="40190" Value="Brazilian-Portuguese" langid="6"/>
|
373 |
+
<Name ID="198031" Value="Бразильский-португальский" langid="8"/>
|
374 |
+
<Name ID="50888" Value="" langid="12"/>
|
375 |
+
<Name ID="205068" Value="Португальська-Бразилія" langid="25"/>
|
376 |
+
</Language>
|
377 |
+
<Language Code="italian" ID="5" ShortCode="IT" Sid="4796">
|
378 |
+
<Name ID="14091" Value="Italian" langid="1"/>
|
379 |
+
<Name ID="14092" Value="Italian" langid="2"/>
|
380 |
+
<Name ID="14093" Value="Italian" langid="3"/>
|
381 |
+
<Name ID="18227" Value="Italian" langid="4"/>
|
382 |
+
<Name ID="104579" Value="Funzione di on/off luce" langid="5"/>
|
383 |
+
<Name ID="26491" Value="Italian" langid="6"/>
|
384 |
+
<Name ID="38093" Value="Italiensk" langid="7"/>
|
385 |
+
<Name ID="198026" Value="Итальянский" langid="8"/>
|
386 |
+
<Name ID="40274" Value="Italian" langid="9"/>
|
387 |
+
<Name ID="40275" Value="Italian" langid="10"/>
|
388 |
+
<Name ID="40276" Value="Italian" langid="11"/>
|
389 |
+
<Name ID="40277" Value="Italian" langid="12"/>
|
390 |
+
<Name ID="40278" Value="Italian" langid="13"/>
|
391 |
+
<Name ID="40279" Value="Italian" langid="14"/>
|
392 |
+
<Name ID="40280" Value="Italian" langid="15"/>
|
393 |
+
<Name ID="40281" Value="Italian" langid="16"/>
|
394 |
+
<Name ID="40282" Value="Italian" langid="17"/>
|
395 |
+
<Name ID="205063" Value="Італійська" langid="25"/>
|
396 |
+
</Language>
|
397 |
+
</LanguageList>
|
398 |
+
</Response>
|
399 |
+
</ICECAT-interface>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Locales.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Provides locales list for Magento BO
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_System_Config_Locales
|
8 |
+
{
|
9 |
+
private $domDoc;
|
10 |
+
public function toOptionArray()
|
11 |
+
{
|
12 |
+
$pathToFile = Mage::getRoot().'/code/local/Bintime/Icecatimport/Model/System/Config/';
|
13 |
+
$fileContent = file_get_contents($pathToFile.'LanguageList.xml');
|
14 |
+
if(!$this->parseXml(utf8_encode($fileContent))){
|
15 |
+
return false;
|
16 |
+
}
|
17 |
+
|
18 |
+
$values = $this->parseLocaleValues();
|
19 |
+
return $values;
|
20 |
+
}
|
21 |
+
|
22 |
+
private function parseLocaleValues(){
|
23 |
+
$languageArray = $this->domDoc->getElementsByTagName('Language');
|
24 |
+
$resultArray = array();
|
25 |
+
foreach($languageArray as $language){
|
26 |
+
$languageShortCode = strtolower($language->getAttribute('ShortCode'));
|
27 |
+
$languageCode = ucfirst($language->getAttribute('Code'));
|
28 |
+
$resultArray[$languageShortCode]=$languageCode;
|
29 |
+
}
|
30 |
+
ksort($resultArray);
|
31 |
+
array_unshift($resultArray, 'Use Store Locale');
|
32 |
+
return $resultArray;
|
33 |
+
}
|
34 |
+
|
35 |
+
private function parseXml($stringXml){
|
36 |
+
$this->domDoc = new DOMDocument();
|
37 |
+
$result = $this->domDoc->loadXML($stringXml);
|
38 |
+
if (!$this->domDoc->validate()){
|
39 |
+
echo "Document is not Valid<br>";
|
40 |
+
return false;
|
41 |
+
}
|
42 |
+
return true;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/Model/System/Config/Subscription.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class provides data for Magento BO
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_Model_System_Config_Subscription
|
8 |
+
{
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
$paramsArray = array(
|
12 |
+
'free' => 'OpenICEcat',
|
13 |
+
'full' => 'Full ICEcat'
|
14 |
+
);
|
15 |
+
return $paramsArray;
|
16 |
+
}
|
17 |
+
}
|
18 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/controllers/ImageController.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class provides controller for import image debug
|
4 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
class Bintime_Icecatimport_ImageController extends Mage_Adminhtml_Controller_Action{
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Action calls load method which uploads data to bintime connector data table
|
11 |
+
*/
|
12 |
+
public function viewAction(){
|
13 |
+
$result = Mage::getModel('icecatimport/observer')->load();
|
14 |
+
}
|
15 |
+
}
|
16 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/controllers/ProductController.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'Mage/Catalog/controllers/ProductController.php';
|
3 |
+
/**
|
4 |
+
* Class rewrites standard product view controller to provide icecat data on the page
|
5 |
+
* @author Sergey Gozhedrianov <info@bintime.com>
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Bintime_Icecatimport_ProductController extends Mage_Catalog_ProductController{
|
9 |
+
/**
|
10 |
+
* parent view Action
|
11 |
+
*/
|
12 |
+
public function viewAction(){
|
13 |
+
parent::viewAction();
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* parent gallery Action
|
18 |
+
*/
|
19 |
+
public function galleryAction(){
|
20 |
+
$this->getRequest()->setRouteName('catalog');
|
21 |
+
parent::galleryAction();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* parent Image Action
|
26 |
+
*/
|
27 |
+
public function imageAction()
|
28 |
+
{
|
29 |
+
$this->getRequest()->setRouteName('catalog');
|
30 |
+
parent::imageAction();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* before resolving url make sure that route name is correct
|
35 |
+
*/
|
36 |
+
public function preDispatch()
|
37 |
+
{
|
38 |
+
parent::preDispatch();
|
39 |
+
if ($this->getRequest()->getActionName() == 'view'){
|
40 |
+
$this->getRequest()->setRouteName('icecatimport');
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/config.xml
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Bintime_Icecatimport>
|
5 |
+
<version>0.1.1</version>
|
6 |
+
</Bintime_Icecatimport>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<icecatimport>
|
11 |
+
<class>Bintime_Icecatimport_Helper</class>
|
12 |
+
</icecatimport>
|
13 |
+
<catalog>
|
14 |
+
<rewrite>
|
15 |
+
<image>Bintime_Icecatimport_Helper_Catalog_Image</image>
|
16 |
+
</rewrite>
|
17 |
+
</catalog>
|
18 |
+
</helpers>
|
19 |
+
<models>
|
20 |
+
<icecatimport>
|
21 |
+
<class>Bintime_Icecatimport_Model</class>
|
22 |
+
<resourceModel>icecatimport_resource_eav_mysql4</resourceModel>
|
23 |
+
</icecatimport>
|
24 |
+
<icecatimport_resource_eav_mysql4>
|
25 |
+
<entities>
|
26 |
+
<data><table>bintime_connector_data</table></data>
|
27 |
+
<supplier_mapping><table>bintime_supplier_mapping</table></supplier_mapping>
|
28 |
+
</entities>
|
29 |
+
</icecatimport_resource_eav_mysql4>
|
30 |
+
<catalog>
|
31 |
+
<rewrite>
|
32 |
+
<product>Bintime_Icecatimport_Model_Catalog_Product</product>
|
33 |
+
<category>Bintime_Icecatimport_Model_Catalog_Category</category>
|
34 |
+
</rewrite>
|
35 |
+
</catalog>
|
36 |
+
<catalogsearch_mysql4>
|
37 |
+
<rewrite>
|
38 |
+
<fulltext_collection>Bintime_Icecatimport_Model_Catalog_Search</fulltext_collection>
|
39 |
+
</rewrite>
|
40 |
+
</catalogsearch_mysql4>
|
41 |
+
</models>
|
42 |
+
<routers>
|
43 |
+
<catalog>
|
44 |
+
<rewrite>
|
45 |
+
<product>
|
46 |
+
<to>Bintime_Icecatimport/product</to>
|
47 |
+
<override_actions>false</override_actions>
|
48 |
+
<actions>
|
49 |
+
<view><to>Bintime_Icecatimport/product/view</to></view>
|
50 |
+
</actions>
|
51 |
+
</product>
|
52 |
+
</rewrite>
|
53 |
+
</catalog>
|
54 |
+
</routers>
|
55 |
+
<resources>
|
56 |
+
<icecatimport_setup>
|
57 |
+
<setup>
|
58 |
+
<module>Bintime_Icecatimport</module>
|
59 |
+
</setup>
|
60 |
+
<connection>
|
61 |
+
<use>core_setup</use>
|
62 |
+
</connection>
|
63 |
+
</icecatimport_setup>
|
64 |
+
</resources>
|
65 |
+
</global>
|
66 |
+
<frontend>
|
67 |
+
<routers>
|
68 |
+
<icecatimport>
|
69 |
+
<use>standard</use>
|
70 |
+
<args>
|
71 |
+
<module>Bintime_Icecatimport</module>
|
72 |
+
<frontName>icecatimport</frontName>
|
73 |
+
</args>
|
74 |
+
</icecatimport>
|
75 |
+
</routers>
|
76 |
+
<layout>
|
77 |
+
<updates>
|
78 |
+
<icecatimport>
|
79 |
+
<file>icecatimport.xml</file>
|
80 |
+
</icecatimport>
|
81 |
+
</updates>
|
82 |
+
</layout>
|
83 |
+
<translate>
|
84 |
+
<modules>
|
85 |
+
<icecatimport>
|
86 |
+
<files>
|
87 |
+
<default>Bintime_Icecatimport.csv</default>
|
88 |
+
</files>
|
89 |
+
</icecatimport>
|
90 |
+
</modules>
|
91 |
+
</translate>
|
92 |
+
</frontend>
|
93 |
+
<adminhtml>
|
94 |
+
<acl>
|
95 |
+
<resources>
|
96 |
+
<admin>
|
97 |
+
<children>
|
98 |
+
<system>
|
99 |
+
<children>
|
100 |
+
<config>
|
101 |
+
<children>
|
102 |
+
<icecat_root translate="title" module="customer">
|
103 |
+
<title>Ice Cat Module powered by Bintime company</title>
|
104 |
+
<sort_order>200</sort_order>
|
105 |
+
</icecat_root>
|
106 |
+
</children>
|
107 |
+
</config>
|
108 |
+
</children>
|
109 |
+
</system>
|
110 |
+
</children>
|
111 |
+
</admin>
|
112 |
+
</resources>
|
113 |
+
</acl>
|
114 |
+
<events></events>
|
115 |
+
<translate>
|
116 |
+
<modules>
|
117 |
+
<mage_adminhtml>
|
118 |
+
<files>
|
119 |
+
<icecatimport>Bintime_Icecatimport.csv</icecatimport>
|
120 |
+
</files>
|
121 |
+
</mage_adminhtml>
|
122 |
+
</modules>
|
123 |
+
</translate>
|
124 |
+
</adminhtml>
|
125 |
+
<crontab>
|
126 |
+
<jobs>
|
127 |
+
<icecatimport>
|
128 |
+
<schedule><cron_expr>0 3 * * *</cron_expr></schedule>
|
129 |
+
<run><model>icecatimport/observer::load</model></run>
|
130 |
+
</icecatimport>
|
131 |
+
</jobs>
|
132 |
+
</crontab>
|
133 |
+
</config>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/config.xml~
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Bintime_Icecatimport>
|
5 |
+
<version>3.0.1</version>
|
6 |
+
</Bintime_Icecatimport>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<icecatimport>
|
11 |
+
<class>Bintime_Icecatimport_Helper</class>
|
12 |
+
</icecatimport>
|
13 |
+
<catalog>
|
14 |
+
<rewrite>
|
15 |
+
<image>Bintime_Icecatimport_Helper_Catalog_Image</image>
|
16 |
+
</rewrite>
|
17 |
+
</catalog>
|
18 |
+
</helpers>
|
19 |
+
<models>
|
20 |
+
<icecatimport>
|
21 |
+
<class>Bintime_Icecatimport_Model</class>
|
22 |
+
<resourceModel>icecatimport_resource_eav_mysql4</resourceModel>
|
23 |
+
</icecatimport>
|
24 |
+
<icecatimport_resource_eav_mysql4>
|
25 |
+
<entities>
|
26 |
+
<data><table>bintime_connector_data</table></data>
|
27 |
+
<supplier_mapping><table>bintime_supplier_mapping</table></supplier_mapping>
|
28 |
+
</entities>
|
29 |
+
</icecatimport_resource_eav_mysql4>
|
30 |
+
<catalog>
|
31 |
+
<rewrite>
|
32 |
+
<product>Bintime_Icecatimport_Model_Catalog_Product</product>
|
33 |
+
<category>Bintime_Icecatimport_Model_Catalog_Category</category>
|
34 |
+
</rewrite>
|
35 |
+
</catalog>
|
36 |
+
<catalogsearch_mysql4>
|
37 |
+
<rewrite>
|
38 |
+
<fulltext_collection>Bintime_Icecatimport_Model_Catalog_Search</fulltext_collection>
|
39 |
+
</rewrite>
|
40 |
+
</catalogsearch_mysql4>
|
41 |
+
</models>
|
42 |
+
<routers>
|
43 |
+
<catalog>
|
44 |
+
<rewrite>
|
45 |
+
<product>
|
46 |
+
<to>Bintime_Icecatimport/product</to>
|
47 |
+
<override_actions>false</override_actions>
|
48 |
+
<actions>
|
49 |
+
<view><to>Bintime_Icecatimport/product/view</to></view>
|
50 |
+
</actions>
|
51 |
+
</product>
|
52 |
+
</rewrite>
|
53 |
+
</catalog>
|
54 |
+
</routers>
|
55 |
+
<resources>
|
56 |
+
<icecatimport_setup>
|
57 |
+
<setup>
|
58 |
+
<module>Bintime_Icecatimport</module>
|
59 |
+
</setup>
|
60 |
+
<connection>
|
61 |
+
<use>core_setup</use>
|
62 |
+
</connection>
|
63 |
+
</icecatimport_setup>
|
64 |
+
</resources>
|
65 |
+
</global>
|
66 |
+
<frontend>
|
67 |
+
<routers>
|
68 |
+
<icecatimport>
|
69 |
+
<use>standard</use>
|
70 |
+
<args>
|
71 |
+
<module>Bintime_Icecatimport</module>
|
72 |
+
<frontName>icecatimport</frontName>
|
73 |
+
</args>
|
74 |
+
</icecatimport>
|
75 |
+
</routers>
|
76 |
+
<layout>
|
77 |
+
<updates>
|
78 |
+
<icecatimport>
|
79 |
+
<file>icecatimport.xml</file>
|
80 |
+
</icecatimport>
|
81 |
+
</updates>
|
82 |
+
</layout>
|
83 |
+
<translate>
|
84 |
+
<modules>
|
85 |
+
<icecatimport>
|
86 |
+
<files>
|
87 |
+
<default>Bintime_Icecatimport.csv</default>
|
88 |
+
</files>
|
89 |
+
</icecatimport>
|
90 |
+
</modules>
|
91 |
+
</translate>
|
92 |
+
</frontend>
|
93 |
+
<adminhtml>
|
94 |
+
<acl>
|
95 |
+
<resources>
|
96 |
+
<admin>
|
97 |
+
<children>
|
98 |
+
<system>
|
99 |
+
<children>
|
100 |
+
<config>
|
101 |
+
<children>
|
102 |
+
<icecat_root translate="title" module="customer">
|
103 |
+
<title>Ice Cat Module powered by Bintime company</title>
|
104 |
+
<sort_order>200</sort_order>
|
105 |
+
</icecat_root>
|
106 |
+
</children>
|
107 |
+
</config>
|
108 |
+
</children>
|
109 |
+
</system>
|
110 |
+
</children>
|
111 |
+
</admin>
|
112 |
+
</resources>
|
113 |
+
</acl>
|
114 |
+
<events></events>
|
115 |
+
<translate>
|
116 |
+
<modules>
|
117 |
+
<mage_adminhtml>
|
118 |
+
<files>
|
119 |
+
<icecatimport>Bintime_Icecatimport.csv</icecatimport>
|
120 |
+
</files>
|
121 |
+
</mage_adminhtml>
|
122 |
+
</modules>
|
123 |
+
</translate>
|
124 |
+
</adminhtml>
|
125 |
+
<crontab>
|
126 |
+
<jobs>
|
127 |
+
<icecatimport>
|
128 |
+
<schedule><cron_expr>0 3 * * *</cron_expr></schedule>
|
129 |
+
<run><model>icecatimport/observer::load</model></run>
|
130 |
+
</icecatimport>
|
131 |
+
</jobs>
|
132 |
+
</crontab>
|
133 |
+
</config>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/system.xml
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<icecat_root translate="label" module="catalog">
|
5 |
+
<class>separator-top</class>
|
6 |
+
<label>Ice Cat Title</label>
|
7 |
+
<tab>catalog</tab>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>200</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<groups>
|
14 |
+
<icecat translate="label">
|
15 |
+
<label>Ice Cat Block</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>50</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<fields>
|
22 |
+
<login translate="label">
|
23 |
+
<label>Ice Cat user login</label>
|
24 |
+
<frontend_type>text</frontend_type>
|
25 |
+
<sort_order>10</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
</login>
|
30 |
+
<password translate="label">
|
31 |
+
<label>Ice Cat Password</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>20</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</password>
|
38 |
+
<icecat_type translate="label">
|
39 |
+
<label>Subscription level</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>icecatimport/system_config_subscription</source_model>
|
42 |
+
<sort_order>25</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</icecat_type>
|
47 |
+
<language translate="label">
|
48 |
+
<label>Language</label>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>icecatimport/system_config_locales</source_model>
|
51 |
+
<sort_order>30</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</language>
|
56 |
+
<sku_field translate="label">
|
57 |
+
<label>MPN</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>icecatimport/system_config_attributes</source_model>
|
60 |
+
<sort_order>40</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
</sku_field>
|
65 |
+
<manufacturer translate="label">
|
66 |
+
<label>Manufacturer Name</label>
|
67 |
+
<frontend_type>select</frontend_type>
|
68 |
+
<source_model>icecatimport/system_config_attributes</source_model>
|
69 |
+
<sort_order>50</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
</manufacturer>
|
74 |
+
</fields>
|
75 |
+
</icecat>
|
76 |
+
</groups>
|
77 |
+
</icecat_root>
|
78 |
+
</sections>
|
79 |
+
</config>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/etc/system.xml~
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<icecat_root translate="label" module="catalog">
|
5 |
+
<class>separator-top</class>
|
6 |
+
<label>Ice Cat Title</label>
|
7 |
+
<tab>catalog</tab>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>200</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<groups>
|
14 |
+
<icecat translate="label">
|
15 |
+
<label>Ice Cat Block</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>50</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<fields>
|
22 |
+
<login translate="label">
|
23 |
+
<label>Ice Cat user login</label>
|
24 |
+
<frontend_type>text</frontend_type>
|
25 |
+
<sort_order>10</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
</login>
|
30 |
+
<password translate="label">
|
31 |
+
<label>Ice Cat Password</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>20</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</password>
|
38 |
+
<icecat_type translate="label">
|
39 |
+
<label>Subscription level</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>icecatimport/system_config_subscription</source_model>
|
42 |
+
<sort_order>25</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</icecat_type>
|
47 |
+
<language translate="label">
|
48 |
+
<label>Language</label>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>icecatimport/system_config_locales</source_model>
|
51 |
+
<sort_order>30</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</language>
|
56 |
+
<sku_field translate="label">
|
57 |
+
<label>Sku Field</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>icecatimport/system_config_attributes</source_model>
|
60 |
+
<sort_order>40</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
</sku_field>
|
65 |
+
<manufacturer translate="label">
|
66 |
+
<label>Manufacturer Field</label>
|
67 |
+
<frontend_type>select</frontend_type>
|
68 |
+
<source_model>icecatimport/system_config_attributes</source_model>
|
69 |
+
<sort_order>50</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
</manufacturer>
|
74 |
+
</fields>
|
75 |
+
</icecat>
|
76 |
+
</groups>
|
77 |
+
</icecat_root>
|
78 |
+
</sections>
|
79 |
+
</config>
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/sql/icecatimport_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
DROP TABLE IF EXISTS {$this->getTable('icecatimport/data')};
|
9 |
+
CREATE TABLE {$this->getTable('icecatimport/data')} (
|
10 |
+
`prod_id` varchar(255) NOT NULL,
|
11 |
+
`prod_img` varchar(255),
|
12 |
+
KEY `PRODUCT_MPN` (`prod_id`)
|
13 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bintime Connector product image table';
|
14 |
+
|
15 |
+
DROP TABLE IF EXISTS {$this->getTable('icecatimport/supplier_mapping')};
|
16 |
+
CREATE TABLE {$this->getTable('icecatimport/supplier_mapping')} (
|
17 |
+
`supplier_id` int(11) NOT NULL,
|
18 |
+
`supplier_symbol` VARCHAR(255),
|
19 |
+
KEY `supplier_id` (`supplier_id`)
|
20 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bintime Connector supplier mapping table';
|
21 |
+
|
22 |
+
");
|
23 |
+
$installer->endSetup();
|
app/code/local/Bintime/MageConnector-3.0.0/Bintime/Icecatimport/sql/icecatimport_setup/mysql4-upgrade-0.1.0-0.1.1.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
$installer->run("
|
7 |
+
ALTER TABLE {$this->getTable('icecatimport/data')} ADD COLUMN `prod_name` VARCHAR(255) AFTER `prod_id`;
|
8 |
+
ALTER TABLE {$this->getTable('icecatimport/data')} ADD COLUMN `supplier_id` int(11) AFTER `prod_id`;
|
9 |
+
ALTER TABLE {$this->getTable('icecatimport/data')} ADD KEY `supplier_id` (`supplier_id`);
|
10 |
+
");
|
11 |
+
$installer->endSetup();
|
12 |
+
?>
|
app/code/local/Bintime/MageConnector-3.0.0/en_US/Bintime_Icecatimport.csv
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Ice Cat Block,";"ICEcat"
|
2 |
+
"Ice Cat Title,";"ICEcat"
|
3 |
+
"Ice Cat user login,";"ICEcat user login"
|
4 |
+
"Ice Cat Password,";"ICEcat Password"
|
5 |
+
"Language,";"Language"
|
6 |
+
"MPN,";"MPN"
|
7 |
+
"Manufacturer Name,";"Manufacturer Name"
|
8 |
+
;
|
9 |
+
"Specification,";"Specification"
|
10 |
+
"Alternatives,";"Alternatives"
|
11 |
+
"Options,""Options""";
|
12 |
+
;
|
13 |
+
"Brand:,";"Brand:"
|
14 |
+
"Product code:,""Product";"code:"""
|
15 |
+
"EAN/UPC code:,""EAN/UPC";"code:"""
|
16 |
+
"Category:,""Category:
|
17 |
+
""";
|
18 |
+
"Image,";"Image"
|
19 |
+
"Article code,";"Article code"
|
20 |
+
"Product name,";"Product name"
|
app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/css/view_table.css
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*=========================================================================
|
2 |
+
PRODUCT BODY AND DOCUMENTATION
|
3 |
+
=========================================================================*/
|
4 |
+
.product-collateral{background:#fff url(../images/product_collateral_bg.gif) repeat-x scroll 0 0 !important;}
|
5 |
+
|
6 |
+
.prod_body_desc { font-size: 11px; }
|
7 |
+
.prod_body_desc a:link { font-size: 12px; color: #c00; text-decoration: none; font-weight: bolder; }
|
8 |
+
.prod_body_desc a:visited { font-size: 12px; color: #c00; text-decoration: none; font-weight: bolder; }
|
9 |
+
.prod_body_desc a:hover { font-size: 12px; color: #c00; text-decoration: underline; font-weight: bolder; }
|
10 |
+
|
11 |
+
.prod_body_space { height: 20px; }
|
12 |
+
|
13 |
+
.prod_doc_tabs_row { width: 100%; }
|
14 |
+
.prod_doc_tabs_space { width: 6px; font-size: 1px; border-bottom: 1px solid #808080; }
|
15 |
+
.prod_doc_tab { height: 20px; width: 170px; padding: 0px; vertical-align: bottom; }
|
16 |
+
.prod_doc_tab_div { line-height:12px; border: 1px solid #808080; background-color: #eee; width: 99%; _width: 100%; text-align: center; font-size: 11px; height: 12px; padding: 0px; cursor: pointer; }
|
17 |
+
.prod_doc_tab_div_sel { border: 1px solid #808080; background-color: #fff; border-bottom: 0px; width: 99%; _width: 100%; text-align: center; font-size: 12px; height: 20px; padding: 0px; font-weight: bold; }
|
18 |
+
|
19 |
+
.prod_doc_content { border: 1px solid #808080; border-top: 0px; width: 100%; }
|
20 |
+
.prod_doc_content_cell { padding: 4px 17px 4px; }
|
21 |
+
|
22 |
+
.prod_doc_table { font-size: 12px; border-collapse: collapse; width: 100%; }
|
23 |
+
.prod_doc_table td { vertical-align:middle; padding-left: 10px; height: 20px; border-bottom: 1px solid #fff; width: 50%; white-space: normal; }
|
24 |
+
.prod_doc_block_head { background-color: #d5e9ff; font-weight: bold; padding: 3px; }
|
25 |
+
.prod_doc_item_head { background-color: #e5eff1; width: auto !important; }
|
26 |
+
.prod_doc_item_head2 { background-color: #e5eff1; text-align: left !important; padding: 3px; }
|
27 |
+
.prod_doc_item_question { background-color: #e5eff1; width: 16px !important; }
|
28 |
+
.prod_doc_item_question img { cursor: help; }
|
29 |
+
.prod_doc_item_descr {padding: 5px 0 5px 10px;}
|
30 |
+
.prod_alt_table td { text-align: center; font-size: 11px; vertical-align:middle;}
|
31 |
+
|
32 |
+
.prod_doc_hint { position: absolute; z-index: 15; visibility: hidden; background: #fffedf; color: #000; border: 1px solid #ccc; padding: 1px; }
|
33 |
+
|
34 |
+
.prod_doc_line_sep { text-align: center; height: 4px; padding: 0px; }
|
35 |
+
.prod_doc_line_sep div { width: 600px; border-bottom: 1px dashed #000; height: 1px; margin: 0px auto; }
|
36 |
+
|
37 |
+
a.prod_link_bold:link { color: #307ac4; text-decoration: underline; font-size: 11px; font-weight: bold; }
|
38 |
+
a.prod_link_bold:visited { color: #307ac4; text-decoration: underline; font-size: 11px; font-weight: bold; }
|
39 |
+
a.prod_link_bold:hover { color: #307ac4; text-decoration: none; font-size: 11px; font-weight: bold; }
|
40 |
+
|
41 |
+
a.prod_link_small:link { color: #307ac4; text-decoration: underline; font-size: 11px; }
|
42 |
+
a.prod_link_small:visited { color: #307ac4; text-decoration: underline; font-size: 11px; }
|
43 |
+
a.prod_link_small:hover { color: #307ac4; text-decoration: none; font-size: 11px; }
|
44 |
+
a.more_link{font-size:12px;font-weight:bold;color:#CC0000;text-decoration: none;}
|
45 |
+
a.more_link:hover{text-decoration: underline;}
|
46 |
+
div.description_b{padding: 25px;}
|
47 |
+
div.short_product_description{ margin-bottom: 10px;}
|
48 |
+
div.product_description span{ font-weight: normal; }
|
app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/js/product_view.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @author Sergey Gozhedrianov
|
3 |
+
* @return
|
4 |
+
*/
|
5 |
+
|
6 |
+
function showMore(){
|
7 |
+
var moreInfo = $('more_info');
|
8 |
+
moreInfo.style.display = 'block';
|
9 |
+
var moreLink = $('more_link');
|
10 |
+
moreLink.style.display = 'none';
|
11 |
+
|
12 |
+
}
|
13 |
+
|
14 |
+
function hideMore(){
|
15 |
+
var moreInfo = $('more_info');
|
16 |
+
moreInfo.style.display = 'none';
|
17 |
+
var moreLink = $('more_link');
|
18 |
+
moreLink.style.display = 'block';
|
19 |
+
}
|
app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/layout/icecatimport.xml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<icecatimport_product_view>
|
5 |
+
<!-- <update handle="catalog_product_view" /> -->
|
6 |
+
<!-- Mage_Catalog -->
|
7 |
+
<reference name="root">
|
8 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
9 |
+
</reference>
|
10 |
+
<reference name="head">
|
11 |
+
<action method="addJs"><script>varien/product.js</script></action>
|
12 |
+
<action method="addCss"><stylesheet>css/view_table.css</stylesheet></action>
|
13 |
+
<action method="addItem"><type>skin_js</type><name>js/product_view.js</name></action>
|
14 |
+
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
|
15 |
+
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
16 |
+
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
17 |
+
</reference>
|
18 |
+
<reference name="content">
|
19 |
+
<block type="catalog/product_view" name="product.info" template="/icecatimport/view.phtml">
|
20 |
+
<!--
|
21 |
+
<action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action>
|
22 |
+
<action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action>
|
23 |
+
<action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action>
|
24 |
+
-->
|
25 |
+
<block type="catalog/product_view_media" name="product.info.media" as="media" template="/icecatimport/media.phtml"/>
|
26 |
+
<block type="core/text_list" name="alert.urls" as="alert_urls" />
|
27 |
+
|
28 |
+
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
|
29 |
+
|
30 |
+
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
|
31 |
+
<action method="setColumnCount"><columns>4</columns></action>
|
32 |
+
<action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
|
33 |
+
</block>
|
34 |
+
|
35 |
+
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
|
36 |
+
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"/>
|
37 |
+
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml"/>
|
38 |
+
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
|
39 |
+
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
|
40 |
+
|
41 |
+
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
|
42 |
+
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
|
43 |
+
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
|
44 |
+
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
|
45 |
+
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
|
46 |
+
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
|
47 |
+
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
|
48 |
+
</block>
|
49 |
+
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
|
50 |
+
</block>
|
51 |
+
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml">
|
52 |
+
<action method="insert"><block>product.tierprices</block></action>
|
53 |
+
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
|
54 |
+
<action method="append"><block>product.info.addtocart</block></action>
|
55 |
+
</block>
|
56 |
+
|
57 |
+
<block type="core/template_facade" name="product.info.container1" as="container1">
|
58 |
+
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
|
59 |
+
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
60 |
+
<action method="append"><block>product.info.options.wrapper</block></action>
|
61 |
+
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
62 |
+
</block>
|
63 |
+
<block type="core/template_facade" name="product.info.container2" as="container2">
|
64 |
+
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
|
65 |
+
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
66 |
+
<action method="append"><block>product.info.options.wrapper</block></action>
|
67 |
+
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
68 |
+
</block>
|
69 |
+
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
70 |
+
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
71 |
+
</block>
|
72 |
+
</reference>
|
73 |
+
<reference name="right">
|
74 |
+
<block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
|
75 |
+
</reference>
|
76 |
+
</icecatimport_product_view>
|
77 |
+
</layout>
|
app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/template/icecatimport/media.phtml
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design_default
|
22 |
+
* @package Mage
|
23 |
+
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product media data template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View_Media
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
|
34 |
+
<?php
|
35 |
+
$_product = $this->getProduct();
|
36 |
+
$_helper = $this->helper('catalog/output');
|
37 |
+
$_productDescriptionHelper = $this->helper('icecatimport/getdata')->getProductDescription($_product);
|
38 |
+
|
39 |
+
?>
|
40 |
+
<?php //if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
41 |
+
<p class="product-image-zoom">
|
42 |
+
<?php
|
43 |
+
$_img = '<img id="image" src="'. $this->helper('catalog/image')->init($_product, 'image') .'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
44 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
45 |
+
?>
|
46 |
+
</p>
|
47 |
+
<p class="a-center" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
|
48 |
+
|
49 |
+
<div class="image-zoom zoom" id="track_outer">
|
50 |
+
<img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
|
51 |
+
<div id="track">
|
52 |
+
<div id="handle"></div>
|
53 |
+
</div>
|
54 |
+
<img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
|
55 |
+
</div>
|
56 |
+
<script type="text/javascript">
|
57 |
+
Event.observe(window, 'load', function() {
|
58 |
+
product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
|
59 |
+
});
|
60 |
+
</script>
|
61 |
+
<?php /*else: ?>
|
62 |
+
<?php
|
63 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($_product->getImageLabel()).'" />';
|
64 |
+
echo $_helper->productAttribute($_product, $_img, 'image')
|
65 |
+
?>
|
66 |
+
<?php endif; */?>
|
67 |
+
<?php if (count($_productDescriptionHelper->getGalleryPhotos()) > 0): ?>
|
68 |
+
<div class="more-views">
|
69 |
+
<h4><?php echo $this->__('More Views') ?></h4>
|
70 |
+
<ul>
|
71 |
+
<?php foreach ($_productDescriptionHelper->getGalleryPhotos() as $_image): ?>
|
72 |
+
<li>
|
73 |
+
<a href="#" onclick="popWin('<?php echo $_image['pic'] ?>', 'gallery', 'width=<?php echo $_image['width']?>,height=<?php echo $_image['height']?>,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="<?php echo $_image['thumb'] ?>" alt="<?php echo $_productDescriptionHelper->getProductName()?>" title="<?php echo $_productDescriptionHelper->getProductName()?>" /></a>
|
74 |
+
</li>
|
75 |
+
<?php endforeach; ?>
|
76 |
+
</ul>
|
77 |
+
</div>
|
78 |
+
<?php else :?>
|
79 |
+
<div class="more-views">
|
80 |
+
<h2><?php echo $this->__('More Views') ?></h2>
|
81 |
+
<ul>
|
82 |
+
<?php foreach ($this->getGalleryImages() as $_image): ?>
|
83 |
+
<li>
|
84 |
+
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
|
85 |
+
</li>
|
86 |
+
<?php endforeach; ?>
|
87 |
+
</ul>
|
88 |
+
</div>
|
89 |
+
<?php endif; ?>
|
app/code/local/Bintime/MageConnector-3.0.0/frontend/default/default/template/icecatimport/view.phtml
ADDED
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design_default
|
22 |
+
* @package Mage
|
23 |
+
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product view template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View
|
31 |
+
* @see Mage_Review_Block_Product_View
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php
|
35 |
+
$_helper = $this->helper('catalog/output');
|
36 |
+
$_product = $this->getProduct();
|
37 |
+
$_productDescriptionHelper = $this->helper('icecatimport/getdata')->getProductDescription($_product);
|
38 |
+
$message = $_productDescriptionHelper->getError();
|
39 |
+
if ($message){
|
40 |
+
$this->getMessagesBlock()->addError($_productDescriptionHelper->getError());
|
41 |
+
}
|
42 |
+
$specificationArray = $_productDescriptionHelper->getProductDescriptionList();
|
43 |
+
$relatedProductsList = $_productDescriptionHelper->getRelatedProducts();
|
44 |
+
?>
|
45 |
+
<script type="text/javascript">
|
46 |
+
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
|
47 |
+
</script>
|
48 |
+
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
|
49 |
+
<div style="display:none"><?php $message=$_productDescriptionHelper->hasSystemError(); if ($message){ echo $message; } ?></div>
|
50 |
+
<div class="product-info-box product-view">
|
51 |
+
<div class="product-essential">
|
52 |
+
<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
|
53 |
+
|
54 |
+
<div class="product-img-box">
|
55 |
+
<?php echo $this->getChildHtml('media') ?>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="product-shop">
|
59 |
+
<?php if (!$_productDescriptionHelper->hasError()) : ?>
|
60 |
+
<h3 class="product-name"><?php echo $_productDescriptionHelper->getProductName()?></h3>
|
61 |
+
<?php else :?>
|
62 |
+
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name')?></h1>
|
63 |
+
<?php endif;?>
|
64 |
+
<?php if ($this->canEmailToFriend()): ?>
|
65 |
+
<a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a><br />
|
66 |
+
<?php endif; ?>
|
67 |
+
|
68 |
+
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
|
69 |
+
|
70 |
+
<fieldset class="no-display">
|
71 |
+
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
|
72 |
+
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
73 |
+
</fieldset>
|
74 |
+
<?php if (!$_productDescriptionHelper->hasError()):?>
|
75 |
+
<div><b><?php echo $this->helper('icecatimport/getdata')->__('Brand:')?></b><?php echo $_productDescriptionHelper->getVendor();?></div>
|
76 |
+
<div><b><?php echo $this->helper('icecatimport/getdata')->__('Product code:')?></b><?php echo $_productDescriptionHelper->getMPN();?></div>
|
77 |
+
<div><b><?php echo $this->helper('icecatimport/getdata')->__('EAN/UPC code:')?></b><?php echo $_productDescriptionHelper->getEAN();?></div>
|
78 |
+
<div><b><?php echo $this->helper('icecatimport/getdata')->__('Category:')?></b><?php echo $_product->getCategory()? $_product->getCategory()->getName() : ''?></div>
|
79 |
+
<?php endif;?>
|
80 |
+
<?php echo $this->getChildHtml('alert_urls') ?>
|
81 |
+
<?php echo $this->getChildHtml('product_type_data') ?>
|
82 |
+
<?php echo $this->getTierPriceHtml() ?>
|
83 |
+
|
84 |
+
<?php if (!$this->hasOptions()):?>
|
85 |
+
<div class="add-to-holder">
|
86 |
+
<?php if($_product->isSaleable()): ?>
|
87 |
+
<?php echo $this->getChildHtml('addtocart') ?>
|
88 |
+
<?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
|
89 |
+
<span class="add-or"><?php echo $this->__('OR') ?></span>
|
90 |
+
<?php endif; ?>
|
91 |
+
<?php endif; ?>
|
92 |
+
<?php echo $this->getChildHtml('addto') ?>
|
93 |
+
</div>
|
94 |
+
<?php else:?>
|
95 |
+
<?php echo $this->getChildHtml('addto') ?>
|
96 |
+
<?php endif; ?>
|
97 |
+
|
98 |
+
<?php if ($_product->getShortDescription() && $_productDescriptionHelper->hasError()):?>
|
99 |
+
<div class="short-description">
|
100 |
+
<h2><?php echo $this->__('Quick Overview') ?></h2>
|
101 |
+
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
|
102 |
+
</div>
|
103 |
+
<?php else :?>
|
104 |
+
<div class="divider"></div>
|
105 |
+
<?php endif;?>
|
106 |
+
|
107 |
+
|
108 |
+
<?php echo $this->getChildHtml('other');?>
|
109 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
110 |
+
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
|
111 |
+
<?php endif;?>
|
112 |
+
|
113 |
+
</div>
|
114 |
+
<div class="clear"></div>
|
115 |
+
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
|
116 |
+
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
|
117 |
+
<?php endif;?>
|
118 |
+
</form>
|
119 |
+
<script type="text/javascript">
|
120 |
+
var productAddToCartForm = new VarienForm('product_addtocart_form');
|
121 |
+
productAddToCartForm.submit = function(){
|
122 |
+
if (this.validator.validate()) {
|
123 |
+
this.form.submit();
|
124 |
+
}
|
125 |
+
}.bind(productAddToCartForm);
|
126 |
+
|
127 |
+
function changeTab(id){
|
128 |
+
for(var i=1;i<4;i++){
|
129 |
+
var tab_cont = (document.getElementById) ? document.getElementById("tab_cont_"+i) : eval('document.all["tab_cont_'+i+'"]');
|
130 |
+
var tab = (document.getElementById) ? document.getElementById("tab_"+i) : eval('document.all["tab_'+i+'"]');
|
131 |
+
|
132 |
+
if (tab_cont!=null && tab!=null) {
|
133 |
+
if(i==id){
|
134 |
+
tab_cont.style.display="";
|
135 |
+
tab.className="prod_doc_tab_div_sel";
|
136 |
+
} else {
|
137 |
+
tab_cont.style.display="none";
|
138 |
+
tab.className="prod_doc_tab_div";
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
</script>
|
144 |
+
</div>
|
145 |
+
<?php if (!$_productDescriptionHelper->hasError()) : ?>
|
146 |
+
<div class="description_b">
|
147 |
+
<div class="short_product_description"><?php echo $_productDescriptionHelper->getShortProductDescription() ?></div>
|
148 |
+
<?php
|
149 |
+
if (strlen($_productDescriptionHelper->getFullProductDescription())>450){
|
150 |
+
$firstPart = str_replace("\\n", "<br>", substr($_productDescriptionHelper->getFullProductDescription(), 0, 400));
|
151 |
+
$space = strrpos($firstPart, " ");
|
152 |
+
$dot = strrpos($firstPart, ".");
|
153 |
+
$column = strrpos($firstPart, ",");
|
154 |
+
$spanTagStart = strrpos($firstPart, "<span");
|
155 |
+
$spanTagEND = strrpos($firstPart, "</span>");
|
156 |
+
|
157 |
+
if ($space-5>$dot && $space-5>$column){
|
158 |
+
$firstPart = substr($firstPart, 0, $space);
|
159 |
+
}
|
160 |
+
else{
|
161 |
+
$firstPart = $column > $dot ? substr($firstPart, 0, $column) : substr($firstPart, 0, $dot);
|
162 |
+
}
|
163 |
+
if ((int)$spanTagEND<$spanTagStart){
|
164 |
+
$firstPart = substr($firstPart, 0, $spanTagStart);
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
?>
|
170 |
+
<div class="product_description">
|
171 |
+
<?php if (isset($firstPart)):?>
|
172 |
+
<span id="more_link"><?php echo $firstPart." "?>... <a class="more_link" href="javascript: showMore();"><?php echo htmlentities(' More>>>')?></a></span>
|
173 |
+
<span id="more_info" style="display: none;"><?php echo str_replace("\\n", "<br>", $_productDescriptionHelper->getFullProductDescription());?><a class="more_link" href="javascript: hideMore();"><?php echo htmlentities(' <<<Less')?></a></span>
|
174 |
+
<?php else: ?>
|
175 |
+
<span><?php echo str_replace("\\n", "<br>", $_productDescriptionHelper->getFullProductDescription());?></span>
|
176 |
+
<?php endif?>
|
177 |
+
</div >
|
178 |
+
</div>
|
179 |
+
<?php endif;?>
|
180 |
+
<div class="product-collateral">
|
181 |
+
<?php if ($_productDescriptionHelper->hasError()) :?>
|
182 |
+
<?php echo $this->getChildHtml('description') ?>
|
183 |
+
<?php else :?>
|
184 |
+
<table cellspacing="0" cellpadding="0" width="100%">
|
185 |
+
<tr>
|
186 |
+
<td>
|
187 |
+
<table cellspacing="0" cellpadding="0" class="prod_doc_tabs_row">
|
188 |
+
<tr>
|
189 |
+
<td class="prod_doc_tabs_space"> </td>
|
190 |
+
<td class="prod_doc_tab"><div id="tab_1" class="prod_doc_tab_div_sel" onclick="changeTab(1)"><?php echo $this->helper('icecatimport/getdata')->__('Specification') ?></div></td>
|
191 |
+
<?php if ($_product->getCategoryId() && array_key_exists($_product->getCategoryId(), $relatedProductsList)):?>
|
192 |
+
<td class="prod_doc_tab"><div id="tab_2" class="prod_doc_tab_div" onclick="changeTab(2)"><?php echo $this->helper('icecatimport/getdata')->__('Alternatives') ?></div></td>
|
193 |
+
<?php endif?>
|
194 |
+
<?php if (!empty($relatedProductsList)):?>
|
195 |
+
<td class="prod_doc_tab"><div id="tab_3" class="prod_doc_tab_div" onclick="changeTab(3)"><?php echo $this->helper('icecatimport/getdata')->__('Options') ?></div></td>
|
196 |
+
<?php endif?>
|
197 |
+
<td class="prod_doc_tabs_space" style="width:auto!important"> </td>
|
198 |
+
</tr>
|
199 |
+
</table>
|
200 |
+
</td>
|
201 |
+
</tr>
|
202 |
+
<tr>
|
203 |
+
<td>
|
204 |
+
<table cellspacing="0" cellpadding="2" class="prod_doc_content">
|
205 |
+
<tr>
|
206 |
+
<td class="prod_doc_content_cell">
|
207 |
+
<!-- FIRST TAB's CONTENT (VISIBLE BY DEFAULT) -->
|
208 |
+
<table id="tab_cont_1" cellspacing="6" cellpadding="0" width="100%">
|
209 |
+
<tr>
|
210 |
+
<td width="50%" valign="top">
|
211 |
+
<table cellspacing="0" cellpadding="2" class="prod_doc_table">
|
212 |
+
<?php foreach($specificationArray as $specBlock => $specArray):?>
|
213 |
+
<?php foreach ($specArray as $key=> $attributeArray):?>
|
214 |
+
<?php //$specArray = array_pop($specArray)?>
|
215 |
+
<tr>
|
216 |
+
<td colspan="3" class="prod_doc_block_head"><?php echo $key?></td>
|
217 |
+
</tr>
|
218 |
+
<?php foreach($attributeArray as $key => $value):?>
|
219 |
+
<tr>
|
220 |
+
<td colspan="2" class="prod_doc_item_head"><?php echo $key?></td>
|
221 |
+
<td class="prod_doc_item_descr"><?php if($value == "Y"){
|
222 |
+
echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/yes.gif"/>';
|
223 |
+
}
|
224 |
+
else if ($value == "N"){
|
225 |
+
echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/no.gif"/>';
|
226 |
+
}
|
227 |
+
else{
|
228 |
+
echo str_replace("\\n", "<br>",$value);
|
229 |
+
}
|
230 |
+
?></td>
|
231 |
+
</tr>
|
232 |
+
<?php endforeach;?>
|
233 |
+
<?php endforeach;?>
|
234 |
+
<?php endforeach;?>
|
235 |
+
</table>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
</table>
|
239 |
+
<!-- SECOND TAB's CONTENT (HIDDEN BY DEFAULT) -->
|
240 |
+
<table id="tab_cont_2" cellspacing="6" cellpadding="0" width="100%" style="display:none">
|
241 |
+
<tr>
|
242 |
+
<td>
|
243 |
+
<table cellspacing="1" cellpadding="5" class="prod_alt_table" width="100%" >
|
244 |
+
<tr>
|
245 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Brand') ?></td>
|
246 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Image') ?></td>
|
247 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Article code') ?></td>
|
248 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Product name') ?></td>
|
249 |
+
</tr>
|
250 |
+
<?php if ($_product->getCategoryId() && array_key_exists($_product->getCategoryId(), $relatedProductsList)):?>
|
251 |
+
<?php foreach($relatedProductsList[$_product->getCategoryId()] as $product):?>
|
252 |
+
<tr>
|
253 |
+
<td><img src="<?php echo $product['supplier_thumb']?>" /></td>
|
254 |
+
<td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
|
255 |
+
<td><?php echo $product['mpn']?></td>
|
256 |
+
<td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
|
257 |
+
</tr>
|
258 |
+
<?php endforeach?>
|
259 |
+
<?php else: ?>
|
260 |
+
<tr><td></>No Alternative proposals for Current product avaible</td></tr>
|
261 |
+
<?php endif?>
|
262 |
+
</table>
|
263 |
+
</td>
|
264 |
+
</tr>
|
265 |
+
</table>
|
266 |
+
<!-- THIRD TAB's CONTENT (HIDDEN BY DEFAULT) -->
|
267 |
+
<table id="tab_cont_3" cellspacing="6" cellpadding="0" width="100%" style="display:none">
|
268 |
+
<tr>
|
269 |
+
<td>
|
270 |
+
|
271 |
+
<table cellspacing="1" cellpadding="5" width="100%" class="prod_alt_table">
|
272 |
+
<tr>
|
273 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Brand') ?></td>
|
274 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Image') ?></td>
|
275 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Article code') ?></td>
|
276 |
+
<td class="prod_doc_block_head"><?php echo $this->helper('icecatimport/getdata')->__('Product name') ?></td>
|
277 |
+
</tr>
|
278 |
+
<?php if (!empty($relatedProductsList)):?>
|
279 |
+
<?php foreach($relatedProductsList as $categoryId => $productsArray):?>
|
280 |
+
<?php if ($categoryId == $_product->getCategoryId()){
|
281 |
+
continue;
|
282 |
+
}?>
|
283 |
+
<?php if (!is_string($categoryId)):?>
|
284 |
+
<tr>
|
285 |
+
<td class="prod_doc_item_head2" colspan="4"><?php echo is_string($categoryId)? '' : Mage::getSingleton('catalog/category')->load($categoryId)->getName() ?></td>
|
286 |
+
|
287 |
+
</tr>
|
288 |
+
<?php endif?>
|
289 |
+
<?php foreach($productsArray as $product):?>
|
290 |
+
<tr>
|
291 |
+
<td><img src="<?php echo $product['supplier_thumb']?>" /></td>
|
292 |
+
<td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
|
293 |
+
<td><?php echo $product['mpn']?></td>
|
294 |
+
<td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
|
295 |
+
</tr>
|
296 |
+
<?php endforeach ?>
|
297 |
+
<?php endforeach ?>
|
298 |
+
<?php else: ?>
|
299 |
+
<tr><td></>No Related proposals for Current product avaible</td></tr>
|
300 |
+
<?php endif?>
|
301 |
+
</table>
|
302 |
+
</td>
|
303 |
+
</tr>
|
304 |
+
</table>
|
305 |
+
<!-- EOF -->
|
306 |
+
</td>
|
307 |
+
</tr>
|
308 |
+
</table>
|
309 |
+
</td>
|
310 |
+
</tr>
|
311 |
+
</table>
|
312 |
+
<?php endif;?>
|
313 |
+
<?php if ($_additional = $this->getChildHtml('additional')):?>
|
314 |
+
<div class="collateral-box">
|
315 |
+
<div class="head">
|
316 |
+
<h4><?php echo $this->__('Additional Information') ?></h4>
|
317 |
+
</div>
|
318 |
+
<?php echo $_additional ?>
|
319 |
+
</div>
|
320 |
+
<?php endif;?>
|
321 |
+
<?php echo $this->getChildHtml('upsell_products') ?>
|
322 |
+
<?php echo $this->getChildHtml('product_additional_data') ?>
|
323 |
+
</div>
|
324 |
+
</div>
|
app/code/local/Bintime/MageConnector-3.0.0/modules/Bintime_Icecatimport.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Bintime_Icecatimport>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Bintime_Icecatimport>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>MagentoConnector</name>
|
4 |
+
<version>3.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>ICEcat to Magento Open Source Connector - rich content in your magento shop</summary>
|
10 |
+
<description>bInTime has released a free &amp;amp;amp;amp; open-source ICEcat connector to Magento - MageConnector
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
MageConnector will provide you with:
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
- Thumb pictures of the products at the category product listings
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
- Product datasheets with images, marketing texts, specs, alternatives and options
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
Data presented on datasheets, are taken from Open ICEcat in a real-time and rendered immediately.</description>
|
31 |
+
<notes>In case of bugs\errors while dowmloading, please report them to marina@bintime.com</notes>
|
32 |
+
<authors><author><name>bInTime</name><user>auto-converted</user><email>info@bintime.com</email></author></authors>
|
33 |
+
<date>2011-01-17</date>
|
34 |
+
<time>11:10:54</time>
|
35 |
+
<contents><target name="magelocal"><dir name="Bintime"><dir name="MageConnector-3.0.0"><dir name="Bintime"><dir name="Icecatimport"><dir name="controllers"><file name="ImageController.php" hash="cdf4984c268346088729831b7abdf026"/><file name="ProductController.php" hash="92c91fe0c165a4785e1c0e218f0f16e7"/></dir><dir name="etc"><file name="config.xml" hash="795143b35cc3c1acbc2172858310ddfd"/><file name="config.xml~" hash="367812c79371721adf4dccbc7e0be47e"/><file name="system.xml" hash="56d56c9df62c3a3d78f4b1dac88086f1"/><file name="system.xml~" hash="ae2e088315ad42f3f4407d897a742323"/></dir><dir name="Helper"><dir name="Catalog"><file name="Image.php" hash="d74c2094fc1daae658f2031e55f0a2ca"/></dir><file name="Getdata.php" hash="73914652d9d0378aaab120f453b35afc"/><file name="Getdata.php~" hash="fa9418bdbd3365e33d45a25239c6192c"/><file name="Image.php" hash="1a979cf3e39a39672929c1b8f042e445"/></dir><dir name="Model"><dir name="Catalog"><file name="Category.php" hash="21abeb7a7c2c85db8ce4d2f4ed203f50"/><file name="Product.php" hash="895cafda0d7a1c2304d80e6f0a993084"/><file name="Search.php" hash="99c7eb706e67e01ea8167ebe88fe72d9"/></dir><dir name="System"><dir name="Config"><file name="Attributes.php" hash="23284e0d38677b4544fc87642a6bc8b5"/><file name="LanguageList.xml" hash="391ef56fab212879709780df5a7710e7"/><file name="Locales.php" hash="d72813a472ad555f21248f7b3e5e67d5"/><file name="Subscription.php" hash="db2d782d32830e88fbe2cc87beaebfa3"/></dir></dir><file name="Import.php" hash="4d6d6b5e3e339a19aef62eb554972257"/><file name="Import.php~" hash="188c42f609d559a003ec280f8d026641"/><file name="Observer.php" hash="c9a23c881a7c32cf315f851466eb00ae"/></dir><dir name="sql"><dir name="icecatimport_setup"><file name="mysql4-install-0.1.0.php" hash="a8f750e7667f8ef0dd077100c9fddf48"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="c0581c5b00420492714bd7e3cc66cb6d"/></dir></dir></dir></dir><dir name="en_US"><file name="Bintime_Icecatimport.csv" hash="320085b57203b83517d1790d3a01dffe"/></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="view_table.css" hash="74eb11cf62d05141d250c933a26cfd0a"/></dir><dir name="js"><file name="product_view.js" hash="d308b475fd6c5dd0ec8ce91a73bb9560"/></dir><dir name="layout"><file name="icecatimport.xml" hash="2ba9d48105f1f319e097558dc4db88fa"/></dir><dir name="template"><dir name="icecatimport"><file name="media.phtml" hash="ecd0486333a824af2eb9b2b70def14ad"/><file name="view.phtml" hash="36fb6f04ef842359eb27d6fce4e740ce"/></dir></dir></dir></dir></dir><dir name="modules"><file name="Bintime_Icecatimport.xml" hash="42e88c21f93cac8ba3185cfdda115b75"/></dir></dir></dir></target></contents>
|
36 |
+
<compatible/>
|
37 |
+
<dependencies/>
|
38 |
+
</package>
|