stockinthechannel2012 - Version 2.0.3

Version Notes

Version 2.0.3:
* Now uses MySQLi instead of the MySQL plugin
* Updated Server's list to contain every region we support
* International fix is now part of the plugin by default

Download this release

Release Info

Developer stockinchannel
Extension stockinthechannel2012
Version 2.0.3
Comparing to
See all releases


Code changes from version 2.0.2 to 2.0.3

Files changed (23) hide show
  1. app/code/local/Bintime/Sinchimport/Block/Layer/View.php +0 -1
  2. app/code/local/Bintime/Sinchimport/Block/List.php +1 -1
  3. app/code/local/Bintime/Sinchimport/Model/Sinch.php +74 -112
  4. app/code/local/Bintime/Sinchimport/Model/Sinch_new_code.php +69 -68
  5. app/code/local/Bintime/Sinchimport/Model/System/Config/ServerList.php +6 -3
  6. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-install-0.1.0.php +4 -4
  7. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.1-0.1.2.php +4 -4
  8. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.2-0.1.3.php +4 -4
  9. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.6-0.1.7.php +6 -6
  10. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.7-0.1.8.php +1 -1
  11. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.2.0-0.2.1.php +1 -1
  12. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.2.1-0.2.2.php +4 -4
  13. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-3.0.0-3.0.1.php +4 -4
  14. app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-3.0.2-3.0.3.php +4 -4
  15. app/design/adminhtml/default/default/layout/sinchimport.xml +57 -57
  16. app/design/adminhtml/default/default/template/sinchimport/sales/items/column/name.phtml +70 -70
  17. app/design/adminhtml/default/default/template/sinchimport/sinchdistributors.phtml +13 -13
  18. app/design/frontend/default/default/layout/sinchimport.xml +110 -110
  19. app/design/frontend/default/default/template/sinchimport/list.phtml +153 -153
  20. app/design/frontend/default/default/template/sinchimport/media.phtml +89 -89
  21. app/design/frontend/default/default/template/sinchimport/view.phtml +363 -363
  22. app/etc/modules/Bintime_Sinchimport.xml +10 -10
  23. package.xml +11 -10
app/code/local/Bintime/Sinchimport/Block/Layer/View.php CHANGED
@@ -1,4 +1,3 @@
1
-
2
  <?php
3
 
4
  class Bintime_Sinchimport_Block_Layer_View extends Mage_Catalog_Block_Layer_View
 
1
  <?php
2
 
3
  class Bintime_Sinchimport_Block_Layer_View extends Mage_Catalog_Block_Layer_View
app/code/local/Bintime/Sinchimport/Block/List.php CHANGED
@@ -144,7 +144,7 @@ class Bintime_Sinchimport_Block_List extends Mage_Catalog_Block_Product_Compare_
144
  $q=" insert ignore into ".$tmp_table_sorted." (store_product_id, sinch_product_id, feature_name, text) values(".$store_product_id.",".$sinch_product_id.",'".$name."','".$value."')";
145
  $this->tep_db_query($q);
146
  }
147
- //mysql_real_escape_string($name)
148
  $i++;
149
  }
150
  }
144
  $q=" insert ignore into ".$tmp_table_sorted." (store_product_id, sinch_product_id, feature_name, text) values(".$store_product_id.",".$sinch_product_id.",'".$name."','".$value."')";
145
  $this->tep_db_query($q);
146
  }
147
+ //mysqli_real_escape_string($name)
148
  $i++;
149
  }
150
  }
app/code/local/Bintime/Sinchimport/Model/Sinch.php CHANGED
@@ -71,7 +71,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
71
  $this->price_breaks_filter=PRICE_BREAKS;
72
  /*$this->db_connect();
73
  $res = $this->db_do("select languages_id from languages where code='".LANG_CODE."'");
74
- $row = mysql_fetch_assoc($res);
75
  $this->lang_id = $row['languages_id'];
76
  */
77
  $this->varDir = TEMPORARY_DIRECTORY_FOR_STORING_FILES;
@@ -150,7 +150,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
150
  function is_imort_not_run(){
151
  $q="SELECT IS_FREE_LOCK('sinchimport') as getlock";
152
  $quer=$this->db_do($q);
153
- $row=mysql_fetch_array($quer);
154
  return $row['getlock'];
155
  }
156
  #################################################################################################
@@ -159,7 +159,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
159
  $q='SHOW PROCEDURE STATUS LIKE "'.Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s').'"';
160
  $quer=$this->db_do($q);
161
  $result=false;
162
- While($row=mysql_fetch_array($quer)){
163
  if(($row['Name']==Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s')) && ($row['Db']==$dbConf->dbname)){
164
  $result = true;
165
  }
@@ -170,7 +170,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
170
  function check_db_privileges(){
171
  $q='SHOW PRIVILEGES';
172
  $quer=$this->db_do($q);
173
- while($row=mysql_fetch_array($quer)){
174
  if($row['Privilege']=='File' && $row['Context']=='File access on server'){
175
  return true;
176
  }
@@ -181,7 +181,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
181
  function check_local_infile(){
182
  $q='SHOW VARIABLES LIKE "local_infile"';
183
  $quer=$this->db_do($q);
184
- $row=mysql_fetch_array($quer);
185
  if($row['Variable_name']=='local_infile' && $row['Value']=="ON"){
186
  return true;
187
  }else{
@@ -194,7 +194,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
194
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_import_status_statistic')."
195
  WHERE import_type='FULL' AND global_status_import='Successful'";
196
  $quer=$this->db_do($q);
197
- $row=mysql_fetch_array($quer);
198
  if($row['cnt']>0){
199
  return true;
200
  }else{
@@ -628,7 +628,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
628
  /**/
629
  if (!$this->check_loaded_data($parse_file, $categories_temp))
630
  {
631
- $inf = mysql_info();
632
  $this->set_import_error_reporting_message('The Stock In The Channel data files do not appear to be in the correct format. Check file'.$parse_file. "(LOAD DATA ... ".$inf.")");
633
  exit;
634
  }/**/
@@ -892,7 +892,7 @@ echo("\n\n $query\n\n");
892
 
893
 
894
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
895
- while ($row = mysql_fetch_array($categories))
896
  {
897
  $parent_id = $row['parent_id'];
898
  $entity_id = $row['entity_id'];
@@ -903,7 +903,7 @@ echo("\n\n $query\n\n");
903
  UPDATE $catalog_category_entity
904
  SET path = '$path'
905
  WHERE entity_id = $entity_id");
906
- } // while ($row = mysql_fetch_array($categories))
907
 
908
 
909
 
@@ -1523,7 +1523,7 @@ $query = "
1523
  echo("\n $query\n");
1524
  $root_categories = $this->db_do($query);
1525
 
1526
- while($root_cat = mysql_fetch_array($root_categories))
1527
  {
1528
  $root_id = $root_cat['entity_id'];
1529
  $root_name = $root_cat['RootName'];
@@ -1594,13 +1594,13 @@ echo("\n\n ==================================================================
1594
  AND cce.entity_type_id = ccev.entity_type_id
1595
  AND ccev.attribute_id = 41
1596
  WHERE parent_id = 1"); // 41 - category name
1597
- while ($row = mysql_fetch_array($query)) $old_cats[] = $row['category_name'];
1598
 
1599
  //var_dump($old_cats);
1600
 
1601
 
1602
  $query = $this->db_do("SELECT MAX(entity_id) AS max_entity_id FROM $catalog_category_entity");
1603
- $max_entity_id = mysql_fetch_array($query);
1604
 
1605
  //var_dump($max_entity_id);
1606
 
@@ -1685,15 +1685,15 @@ echo("\n createNewDefaultCategories done... \n ===========================
1685
  AND ccev.attribute_id = 41
1686
  WHERE parent_id = 1"); // 41 - category name
1687
  $OLD = array();
1688
- while($root_cat = mysql_fetch_array($root_categories)) $OLD[] = $root_cat['category_name'];
1689
 
1690
  $new_categories = $this->db_do("SELECT DISTINCT RootName FROM $categories_temp");
1691
 
1692
  //STP $new_categories = $this->db_do("SELECT DISTINCT ctemp.RootName, ctype.name FROM $categories_temp ctemp LEFT JOIN $category_types ctypes on ctemp.RootName = ctype.name");
1693
 
1694
  $NEW = array();
1695
- while($new_root_cat = mysql_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['RootName']] = TRUE;
1696
- /////STP while($new_root_cat = mysql_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['name']] = TRUE;
1697
  /**
1698
  $exists_coincidence = array();
1699
 
@@ -1902,7 +1902,7 @@ $query = "
1902
  echo("\n\n$query\n\n");
1903
  $root_categories = $this->db_do($query);
1904
 
1905
- while($root_cat = mysql_fetch_array($root_categories))
1906
  {
1907
  $root_id = $root_cat['entity_id'];
1908
  $root_name = $root_cat['RootName'];
@@ -2052,7 +2052,7 @@ echo("\n\n$query\n\n");
2052
 
2053
 
2054
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
2055
- while ($row = mysql_fetch_array($categories))
2056
  {
2057
  $parent_id = $row['parent_id'];
2058
  $entity_id = $row['entity_id'];
@@ -2063,7 +2063,7 @@ echo("\n\n$query\n\n");
2063
  UPDATE $catalog_category_entity
2064
  SET path = '$path'
2065
  WHERE entity_id = $entity_id");
2066
- } // while ($row = mysql_fetch_array($categories))
2067
 
2068
 
2069
  ///////////////////////////////////////////////////////
@@ -2543,7 +2543,7 @@ echo("\n\n$query\n\n");
2543
  FROM $catalog_category_entity
2544
  WHERE entity_id = $cat_id";
2545
  $quer = $this->db_do($q);
2546
- $row = mysql_fetch_array($quer);
2547
  while ($row['parent_id'])
2548
  {
2549
  $path = $row['parent_id'].'/'.$path;
@@ -2555,7 +2555,7 @@ echo("\n\n$query\n\n");
2555
  FROM $catalog_category_entity
2556
  WHERE entity_id = $parent_id";
2557
  $quer = $this->db_do($q);
2558
- $row = mysql_fetch_array($quer);
2559
  }
2560
 
2561
  if ($cat_id) $path.=$cat_id."/";
@@ -4587,7 +4587,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
4587
  WHERE parent_store_category_id = 0");
4588
 
4589
  $store_cat_ids = $this->db_do("SELECT store_category_id FROM $categories_temp");
4590
- while ($row = mysql_fetch_array($store_cat_ids))
4591
  {
4592
  $store_category_id = $row['store_category_id'];
4593
 
@@ -4803,7 +4803,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
4803
 
4804
 
4805
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
4806
- while ($row = mysql_fetch_array($categories))
4807
  {
4808
  $parent_id = $row['parent_id'];
4809
  $entity_id = $row['entity_id'];
@@ -5477,7 +5477,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
5477
  WHERE aov.value IS NULL";
5478
  $quer=$this->db_do($q);
5479
 
5480
- while($row=mysql_fetch_array($quer)){
5481
  $q0="INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
5482
  (attribute_id)
5483
  VALUES(".$this->attributes['manufacturer'].")";
@@ -5489,7 +5489,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
5489
  )(
5490
  SELECT
5491
  max(option_id) as option_id,
5492
- "."'".mysql_real_escape_string($row['manufacturer_name'])."'
5493
  FROM ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
5494
  WHERE attribute_id=".$this->attributes['manufacturer']."
5495
  )
@@ -5630,20 +5630,8 @@ echo("\nParseProducts 2\n");
5630
  $parse_file=$this->varDir.FILE_PRODUCTS;
5631
  if(filesize($parse_file)){
5632
  $this->_LOG("Start parse ".FILE_PRODUCTS);
5633
-
5634
- $file_handle_from = fopen($parse_file, "r");
5635
- unlink($parse_file.".conv");
5636
- $file_handle_to = fopen($parse_file.".conv", "w");
5637
- while (!feof($file_handle_from)) {
5638
- $line = fgets($file_handle_from);
5639
- $line = $this->valid_utf($line);
5640
- fwrite($file_handle_to, $line);
5641
- }
5642
- fclose($file_handle_from);
5643
- fclose($file_handle_to);
5644
  echo("\nParseProducts 2\n");
5645
 
5646
- // $prod_file_str = file_get_contents($parse_file);
5647
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
5648
  if($this->product_file_format == "NEW"){
5649
  $this->db_do("CREATE TABLE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."(
@@ -5714,7 +5702,7 @@ echo("\nParseProducts 2\n");
5714
 
5715
  }
5716
  echo("\nParseProducts 3\n");
5717
- $this->db_do("LOAD DATA LOCAL INFILE '".$parse_file.".conv'
5718
  INTO TABLE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."
5719
  FIELDS TERMINATED BY '".$this->field_terminated_char."'
5720
  OPTIONALLY ENCLOSED BY '\"'
@@ -5754,15 +5742,6 @@ echo("\nParseProducts 3\n");
5754
 
5755
  echo("\nParseProducts 4\n");
5756
 
5757
-
5758
- //$this->db_do("DELETE FROM stINch_products WHERE sinch_product_id IN (4936140, 4326529)");
5759
-
5760
- //echo("\n\n clear parse products....\n\n"); //exit;
5761
-
5762
-
5763
-
5764
- $this->db_do("ALTER TABLE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."
5765
- CONVERT TO CHARACTER SET \"latin1\"");
5766
  echo("\nParseProducts 5\n");
5767
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."
5768
  SET products_date_added=now(), products_last_modified=now()");
@@ -5775,7 +5754,7 @@ echo("\nParseProducts 7\n");
5775
  if($this->current_import_status_statistic_id){
5776
  $res = $this->db_do("SELECT COUNT(*) AS cnt
5777
  FROM ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
5778
- $row = mysql_fetch_assoc($res);
5779
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
5780
  SET number_of_products=".$row['cnt']."
5781
  WHERE id=".$this->current_import_status_statistic_id);
@@ -5869,18 +5848,6 @@ echo("\nParseProducts 11\n");
5869
  $parse_file=$this->varDir.FILE_RESTRICTED_VALUES;
5870
  if(filesize($parse_file) || $this->_ignore_restricted_values){
5871
  $this->_LOG("Start parse ".FILE_RESTRICTED_VALUES);
5872
- $file_handle_from = fopen($parse_file, "r");
5873
- unlink($parse_file.".conv");
5874
- $file_handle_to = fopen($parse_file.".conv", "w");
5875
- while (!feof($file_handle_from)) {
5876
- $line = fgets($file_handle_from);
5877
- $line = $this->valid_utf($line);
5878
- fwrite($file_handle_to, $line);
5879
- }
5880
- fclose($file_handle_from);
5881
- fclose($file_handle_to);
5882
-
5883
-
5884
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp'));
5885
  $this->db_do("CREATE TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')." (
5886
  restricted_value_id int(11),
@@ -5891,15 +5858,13 @@ echo("\nParseProducts 11\n");
5891
  KEY(category_feature_id)
5892
  )");
5893
  if(!$this->_ignore_restricted_values){
5894
- $this->db_do("LOAD DATA LOCAL INFILE '".$parse_file.".conv'
5895
  INTO TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')."
5896
  FIELDS TERMINATED BY '".$this->field_terminated_char."'
5897
  OPTIONALLY ENCLOSED BY '\"'
5898
  LINES TERMINATED BY \"\r\n\"
5899
  IGNORE 1 LINES ");
5900
  }
5901
- $this->db_do("ALTER TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')."
5902
- CONVERT TO CHARACTER SET \"latin1\"");
5903
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_restricted_values'));
5904
  $this->db_do("RENAME TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')."
5905
  TO ".Mage::getSingleton('core/resource')->getTableName('stINch_restricted_values'));
@@ -5942,7 +5907,7 @@ echo("\nParseProducts 11\n");
5942
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
5943
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stock_and_prices_temp')." b
5944
  ON a.store_product_id=b.store_product_id");
5945
- $row = mysql_fetch_assoc($res);
5946
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
5947
  SET number_of_products=".$row['cnt']."
5948
  WHERE id=".$this->current_import_status_statistic_id);
@@ -6245,7 +6210,7 @@ echo("\nParseProducts 11\n");
6245
  FROM ".Mage::getSingleton('core/resource')->getTableName('core_store')."
6246
  WHERE code!='admin'
6247
  "); // where code!='admin' was adder for editing Featured products;
6248
- while ($row = mysql_fetch_assoc($result)) {
6249
  $sql = "INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('products_website_temp')." (
6250
  store_product_id,
6251
  sinch_product_id,
@@ -7655,7 +7620,7 @@ STP DELETE*/
7655
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_link_type')
7656
  );
7657
  $link_type=array();
7658
- while ($row = mysql_fetch_array($result)) {
7659
  $link_type[$row['code']]=$row['link_type_id'];
7660
  }
7661
 
@@ -7732,7 +7697,7 @@ STP DELETE*/
7732
  /* $q="select distinct store_product_id from stINch_related_products";
7733
  $quer=$this->db_do($q);
7734
  $prod = Mage::getModel('catalog/product');
7735
- while ($row = mysql_fetch_assoc($quer)) {
7736
  $q1="select distinct store_related_product_id store_product_id from stINch_related_products where store_product_id=".$row['store_product_id'].;
7737
  $quer1=$this->db_do($q1);
7738
  $prod->load($row['store_product_id']);
@@ -7749,7 +7714,7 @@ STP DELETE*/
7749
  ###$product->save();
7750
  ###
7751
  $i=1;
7752
- while ($row1 = mysql_fetch_assoc($quer1)) {
7753
  $param[$row1['store_related_product_id']]['position']=$i++;
7754
 
7755
  }
@@ -8026,7 +7991,7 @@ STP DELETE*/
8026
  FROM ".Mage::getSingleton('core/resource')->getTableName('import_pricerules')."
8027
  ORDER BY rating DESC
8028
  ");
8029
- while($row = mysql_fetch_assoc($result)) {
8030
  $rulesArray[$row['id']] = $row;
8031
  }
8032
  return $rulesArray;
@@ -8216,7 +8181,7 @@ STP DELETE*/
8216
  $q="SELECT customer_group_id FROM ".Mage::getSingleton('core/resource')->getTableName('customer_group');
8217
  $quer=$this->db_do($q);
8218
 
8219
- while ($row = mysql_fetch_assoc($quer)) {
8220
  $result = $this->db_do("
8221
  INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price')." (
8222
  entity_id,
@@ -8346,7 +8311,7 @@ STP DELETE*/
8346
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products')."
8347
  WHERE store_product_id =".$store_product_id;
8348
  $quer=$this->db_do($q);
8349
- $product=mysql_fetch_array($quer);
8350
 
8351
  $this->productDescription = (string) substr($product['description'],50,0);
8352
  $this->fullProductDescription = (string)$product['description'];
@@ -8361,7 +8326,7 @@ STP DELETE*/
8361
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_manufacturers')."
8362
  WHERE sinch_manufacturer_id=".$product['sinch_manufacturer_id'];
8363
  $quer=$this->db_do($q);
8364
- $manufacturer=mysql_fetch_array($quer);
8365
  $this->vendor = (string)$manufacturer['manufacturer_name'];
8366
  }
8367
  $q="SELECT DISTINCT ean_code
@@ -8370,7 +8335,7 @@ STP DELETE*/
8370
  ON sec.product_id=sp.sinch_product_id
8371
  WHERE sp.store_product_id=".$store_product_id;
8372
  $quer=$this->db_do($q);
8373
- while ($row=mysql_fetch_array($quer)){
8374
  $EANarr[]=$row['ean_code'];
8375
  }
8376
  // $prodEAN = $productTag->EANCode;
@@ -8395,7 +8360,7 @@ STP DELETE*/
8395
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_categories_features')." c
8396
  ON b.category_feature_id = c.category_feature_id
8397
  WHERE a.sinch_product_id = '" .$this->sinchProductId . "'" );
8398
- while ($features = mysql_fetch_array($product_info_features)) {
8399
  $descriptionArray[$features['name']] = $features['value'];
8400
  }
8401
 
@@ -8432,7 +8397,7 @@ STP DELETE*/
8432
 
8433
  // echo $q;
8434
  $quer=$this->db_do($q);
8435
- while($row=mysql_fetch_array($quer)){
8436
 
8437
  $productArray = array();
8438
  $productArray['name'] = (string)$row['product_name'];
@@ -8463,7 +8428,7 @@ STP DELETE*/
8463
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_pictures_gallery')."
8464
  WHERE store_product_id=".$store_product_id);
8465
 
8466
- $res=mysql_fetch_array($q);
8467
  if(!$res || !$res['cnt']){
8468
  return false;
8469
  }
@@ -8475,7 +8440,7 @@ STP DELETE*/
8475
 
8476
  $res=$this->db_do($q);
8477
 
8478
- while($photo=mysql_fetch_array($res)){
8479
  $picHeight = (int)500;//$photo["PicHeight"];
8480
  $picWidth = (int)500;//$photo["PicWidth"];
8481
  $thumbUrl = (string)$photo["ThumbPic"];
@@ -8612,7 +8577,7 @@ STP DELETE*/
8612
  $q=$this->db_do("SELECT store_product_id
8613
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')."
8614
  WHERE entity_id=".$entity_id);
8615
- $res=mysql_fetch_array($q);
8616
  // echo $entity_id."AAAA".$res['store_product_id']; exit;
8617
  return ($res['store_product_id']);
8618
  }
@@ -8623,14 +8588,15 @@ STP DELETE*/
8623
  // $connection = Mage::getModel('core/resource')->getConnection('core_write');
8624
  $dbConf = Mage::getConfig()->getResourceConnectionConfig('core_setup');
8625
 
8626
- if ($this->db = mysql_connect($dbConf->host, $dbConf->username, $dbConf->password, true, 128)) {
8627
- if(mysql_select_db($dbConf->dbname)){
 
8628
  $this->_LOG("Connected..");
8629
  }else{
8630
- die("Can't select the database: " . mysql_error());
8631
  }
8632
  }else{
8633
- die("Could not connect: " . mysql_error());
8634
 
8635
  }
8636
 
@@ -8639,15 +8605,11 @@ STP DELETE*/
8639
 
8640
  private function db_do($query) {
8641
  if($this->debug_mode){
8642
- // $this->_LOG("Query: " . $query);
8643
  Mage::log("Query: " . $query, null, $this->_logFile);
8644
  }
8645
- // $result = $this->this->db_do($query);//
8646
- // $query=mysql_real_escape_string($query);
8647
- //mysql_query('set names utf8');
8648
- $result = mysql_query($query) or die("Query failed: " . mysql_error());
8649
  if (!$result) {
8650
- throw new Exception("Invalid query: $sql\n" . mysql_error());
8651
  } else {
8652
  return $result;
8653
  }
@@ -8657,7 +8619,7 @@ STP DELETE*/
8657
  ##################################################################################################
8658
  function table_rows_count($table){
8659
  $rows_count_res=$this->db_do("select count(*) as cnt from ".$table);
8660
- $rows_count=mysql_fetch_array($rows_count_res);
8661
  return ($rows_count['cnt']);
8662
  }
8663
  ##################################################################################################
@@ -8713,11 +8675,11 @@ STP DELETE*/
8713
  WHERE entity_type_id=".$entity_type_id."
8714
  AND attribute_id=".$attribute_id
8715
  );
8716
- while($row=mysql_fetch_array($result)){
8717
  $value=$this->valid_char($row['value']);
8718
  if($value!='' and $value!=$row['value']){
8719
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
8720
- SET value='".mysql_real_escape_string($value)."'
8721
  WHERE entity_id=".$row['entity_id']."
8722
  AND entity_type_id=".$entity_type_id."
8723
  AND attribute_id=".$attribute_id);
@@ -8847,7 +8809,7 @@ STP DELETE*/
8847
  WHERE parent_store_category_id=".$id;
8848
  $quer=$this->db_do($q);
8849
  $count=0;
8850
- while ($row=mysql_fetch_array($quer)){
8851
  $count+=$this->count_children($row['store_category_id']);
8852
  $count++;
8853
  }
@@ -8894,7 +8856,7 @@ STP DELETE*/
8894
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
8895
  WHERE entity_id=".$cat_id;
8896
  $quer=$this->db_do($q);
8897
- $row=mysql_fetch_array($quer);
8898
  while($row['parent_id']){
8899
  $path=$row['parent_id'].'/'.$path;
8900
  $q="SELECT
@@ -8902,7 +8864,7 @@ STP DELETE*/
8902
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
8903
  WHERE entity_id=".$row['parent_id'];
8904
  $quer=$this->db_do($q);
8905
- $row=mysql_fetch_array($quer);
8906
 
8907
  }
8908
  if($cat_id){
@@ -8924,13 +8886,13 @@ STP DELETE*/
8924
  WHERE store_category_id=".$id;
8925
  $quer=$this->db_do($q);
8926
  $level=1;
8927
- $row=mysql_fetch_array($quer);
8928
  while ($row['parent_store_category_id']!=0){
8929
  $q="SELECT parent_store_category_id
8930
  FROM ".Mage::getSingleton('core/resource')->getTableName('categories_temp')."
8931
  WHERE store_category_id=".$row['parent_store_category_id'];
8932
  $quer=$this->db_do($q);
8933
- $row=mysql_fetch_array($quer);
8934
  $level++;
8935
  if($level>20){
8936
  break;
@@ -8968,7 +8930,7 @@ STP DELETE*/
8968
  $q="SELECT MAX(id) AS id FROM ".$this->import_status_statistic_table;
8969
 
8970
  $quer=$this->db_do($q);
8971
- $row=mysql_fetch_array($quer);
8972
  $this->current_import_status_statistic_id=$row['id'];
8973
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
8974
  SET global_status_import='Failed'
@@ -8984,13 +8946,13 @@ STP DELETE*/
8984
  #################################################################################################
8985
  function set_import_error_reporting_message($message){
8986
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
8987
- SET error_report_message='".mysql_real_escape_string($message)."'
8988
  WHERE id=".$this->current_import_status_statistic_id);
8989
  }
8990
  #################################################################################################
8991
  function getImportStatusHistory(){
8992
  $res="SELECT COUNT(*) FROM ".$this->import_status_statistic_table;
8993
- $cnt_arr=mysql_fetch_array($this->db_do($res));
8994
  $cnt=$cnt_arr[0];
8995
  $StatusHistory_arr = array();
8996
  if($cnt>0){
@@ -9007,7 +8969,7 @@ STP DELETE*/
9007
  FROM ".$this->import_status_statistic_table."
9008
  ORDER BY start_import limit ".$a.", ".$b;
9009
  $result=$this->db_do($q);
9010
- while($row=mysql_fetch_array($result)){
9011
  $StatusHistory_arr[]=$row;
9012
  }
9013
  }
@@ -9019,7 +8981,7 @@ STP DELETE*/
9019
  FROM ".$this->import_status_statistic_table."
9020
  WHERE global_status_import='Successful'
9021
  ORDER BY id DESC LIMIT 1";
9022
- $imp_date=mysql_fetch_array($this->db_do($q));
9023
  return $imp_date['start_import'];
9024
  }
9025
  #################################################################################################
@@ -9035,7 +8997,7 @@ STP DELETE*/
9035
  error_report_message
9036
  FROM ".$this->import_status_statistic_table."
9037
  ORDER BY id DESC LIMIT 1";
9038
- $imp_status=mysql_fetch_array($this->db_do($q));
9039
  return $imp_status;
9040
  }
9041
 
@@ -9065,7 +9027,7 @@ STP DELETE*/
9065
  FROM ".$this->import_status_table."
9066
  ORDER BY id LIMIT 1";
9067
  $quer=$this->db_do($q);
9068
- if($row=mysql_fetch_array($quer)){
9069
  $messages=array('message'=>$row['message'], 'id'=>$row['id'], 'finished'=>$row['finished']);
9070
  $id=$row['id'];
9071
  }
@@ -9085,7 +9047,7 @@ STP DELETE*/
9085
  LIMIT 1
9086
  ";
9087
  $result = $this->db_do($sql);
9088
- if ($row = mysql_fetch_assoc($result)) {
9089
  return $row['entity_type_id'];
9090
  }
9091
  return false;
@@ -9109,7 +9071,7 @@ STP DELETE*/
9109
  LIMIT 1
9110
  ";
9111
  $result = $this->db_do($sql);
9112
- if ($row = mysql_fetch_assoc($result)) {
9113
 
9114
  $this->defaultAttributeSetId = $row['default_attribute_set_id'];
9115
  }
@@ -9127,7 +9089,7 @@ STP DELETE*/
9127
  LIMIT 1
9128
  ";
9129
  $result = $this->db_do($sql);
9130
- if ($row = mysql_fetch_assoc($result)) {
9131
  $this->_categoryEntityTypeId = $row['entity_type_id'];
9132
  $this->_categoryDefault_attribute_set_id = $row['default_attribute_set_id'];
9133
  }
@@ -9151,7 +9113,7 @@ STP DELETE*/
9151
  WHERE entity_type_id = '" . $typeId . "'
9152
  ";
9153
  $result = $this->db_do($sql);
9154
- while ($row = mysql_fetch_assoc($result)) {
9155
  $this->_attributeId[$typeCode][$row['attribute_code']] = $row['attribute_id'];
9156
  }
9157
  }
@@ -9192,7 +9154,7 @@ STP DELETE*/
9192
  WHERE
9193
  value='default-category'";
9194
  $res=$this->db_do($q);
9195
- $row=mysql_fetch_array($res);
9196
  if($row['entity_id']>0){
9197
  return $row['entity_id'];
9198
  }else{
@@ -9201,7 +9163,7 @@ STP DELETE*/
9201
  WHERE parent_id=".$cat_id;
9202
  $quer=$this->db_do($q);
9203
  $count=0;
9204
- while ($row=mysql_fetch_array($quer)){
9205
  $count++;
9206
  $entity_id=$row['entity_id'];
9207
  }
@@ -9219,7 +9181,7 @@ STP DELETE*/
9219
  $q='SHOW TABLES LIKE "'.Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_').'%"';
9220
  $quer=$this->db_do($q);
9221
  $result=false;
9222
- While($row=mysql_fetch_array($quer)){
9223
  if(is_array($row)){
9224
  $catalog_product_flat=array_pop($row);
9225
  $q='DELETE pf1 FROM '.$catalog_product_flat.' pf1
@@ -9921,7 +9883,7 @@ STP DELETE*/
9921
  WHERE store_product_id =".$store_product_id;
9922
  $quer=$this->db_do($q);
9923
  $offers = null;
9924
- while($row = mysql_fetch_array($quer)){
9925
  $offers[]=$row;
9926
  }
9927
  return $offers;
@@ -9941,7 +9903,7 @@ STP DELETE*/
9941
  WHERE parent_id=".$entity_id;
9942
  $quer=$this->db_do($q);
9943
  $children_cat='';
9944
- while ($row=mysql_fetch_array($quer)){
9945
  $children_cat .= ", '".$row['entity_id']."'";
9946
  $children_cat .= $this->get_all_children_cat_recursive($row['entity_id']);
9947
  }
@@ -9955,7 +9917,7 @@ STP DELETE*/
9955
  // echo $q;
9956
  $quer=$this->db_do($q);
9957
  $i=0;
9958
- while ($row=mysql_fetch_array($quer)){
9959
  $i++;
9960
  }
9961
  return ($i);
71
  $this->price_breaks_filter=PRICE_BREAKS;
72
  /*$this->db_connect();
73
  $res = $this->db_do("select languages_id from languages where code='".LANG_CODE."'");
74
+ $row = mysqli_fetch_assoc($res);
75
  $this->lang_id = $row['languages_id'];
76
  */
77
  $this->varDir = TEMPORARY_DIRECTORY_FOR_STORING_FILES;
150
  function is_imort_not_run(){
151
  $q="SELECT IS_FREE_LOCK('sinchimport') as getlock";
152
  $quer=$this->db_do($q);
153
+ $row=mysqli_fetch_array($quer);
154
  return $row['getlock'];
155
  }
156
  #################################################################################################
159
  $q='SHOW PROCEDURE STATUS LIKE "'.Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s').'"';
160
  $quer=$this->db_do($q);
161
  $result=false;
162
+ While($row=mysqli_fetch_array($quer)){
163
  if(($row['Name']==Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s')) && ($row['Db']==$dbConf->dbname)){
164
  $result = true;
165
  }
170
  function check_db_privileges(){
171
  $q='SHOW PRIVILEGES';
172
  $quer=$this->db_do($q);
173
+ while($row=mysqli_fetch_array($quer)){
174
  if($row['Privilege']=='File' && $row['Context']=='File access on server'){
175
  return true;
176
  }
181
  function check_local_infile(){
182
  $q='SHOW VARIABLES LIKE "local_infile"';
183
  $quer=$this->db_do($q);
184
+ $row=mysqli_fetch_array($quer);
185
  if($row['Variable_name']=='local_infile' && $row['Value']=="ON"){
186
  return true;
187
  }else{
194
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_import_status_statistic')."
195
  WHERE import_type='FULL' AND global_status_import='Successful'";
196
  $quer=$this->db_do($q);
197
+ $row=mysqli_fetch_array($quer);
198
  if($row['cnt']>0){
199
  return true;
200
  }else{
628
  /**/
629
  if (!$this->check_loaded_data($parse_file, $categories_temp))
630
  {
631
+ $inf = mysqli_info();
632
  $this->set_import_error_reporting_message('The Stock In The Channel data files do not appear to be in the correct format. Check file'.$parse_file. "(LOAD DATA ... ".$inf.")");
633
  exit;
634
  }/**/
892
 
893
 
894
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
895
+ while ($row = mysqli_fetch_array($categories))
896
  {
897
  $parent_id = $row['parent_id'];
898
  $entity_id = $row['entity_id'];
903
  UPDATE $catalog_category_entity
904
  SET path = '$path'
905
  WHERE entity_id = $entity_id");
906
+ } // while ($row = mysqli_fetch_array($categories))
907
 
908
 
909
 
1523
  echo("\n $query\n");
1524
  $root_categories = $this->db_do($query);
1525
 
1526
+ while($root_cat = mysqli_fetch_array($root_categories))
1527
  {
1528
  $root_id = $root_cat['entity_id'];
1529
  $root_name = $root_cat['RootName'];
1594
  AND cce.entity_type_id = ccev.entity_type_id
1595
  AND ccev.attribute_id = 41
1596
  WHERE parent_id = 1"); // 41 - category name
1597
+ while ($row = mysqli_fetch_array($query)) $old_cats[] = $row['category_name'];
1598
 
1599
  //var_dump($old_cats);
1600
 
1601
 
1602
  $query = $this->db_do("SELECT MAX(entity_id) AS max_entity_id FROM $catalog_category_entity");
1603
+ $max_entity_id = mysqli_fetch_array($query);
1604
 
1605
  //var_dump($max_entity_id);
1606
 
1685
  AND ccev.attribute_id = 41
1686
  WHERE parent_id = 1"); // 41 - category name
1687
  $OLD = array();
1688
+ while($root_cat = mysqli_fetch_array($root_categories)) $OLD[] = $root_cat['category_name'];
1689
 
1690
  $new_categories = $this->db_do("SELECT DISTINCT RootName FROM $categories_temp");
1691
 
1692
  //STP $new_categories = $this->db_do("SELECT DISTINCT ctemp.RootName, ctype.name FROM $categories_temp ctemp LEFT JOIN $category_types ctypes on ctemp.RootName = ctype.name");
1693
 
1694
  $NEW = array();
1695
+ while($new_root_cat = mysqli_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['RootName']] = TRUE;
1696
+ /////STP while($new_root_cat = mysqli_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['name']] = TRUE;
1697
  /**
1698
  $exists_coincidence = array();
1699
 
1902
  echo("\n\n$query\n\n");
1903
  $root_categories = $this->db_do($query);
1904
 
1905
+ while($root_cat = mysqli_fetch_array($root_categories))
1906
  {
1907
  $root_id = $root_cat['entity_id'];
1908
  $root_name = $root_cat['RootName'];
2052
 
2053
 
2054
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
2055
+ while ($row = mysqli_fetch_array($categories))
2056
  {
2057
  $parent_id = $row['parent_id'];
2058
  $entity_id = $row['entity_id'];
2063
  UPDATE $catalog_category_entity
2064
  SET path = '$path'
2065
  WHERE entity_id = $entity_id");
2066
+ } // while ($row = mysqli_fetch_array($categories))
2067
 
2068
 
2069
  ///////////////////////////////////////////////////////
2543
  FROM $catalog_category_entity
2544
  WHERE entity_id = $cat_id";
2545
  $quer = $this->db_do($q);
2546
+ $row = mysqli_fetch_array($quer);
2547
  while ($row['parent_id'])
2548
  {
2549
  $path = $row['parent_id'].'/'.$path;
2555
  FROM $catalog_category_entity
2556
  WHERE entity_id = $parent_id";
2557
  $quer = $this->db_do($q);
2558
+ $row = mysqli_fetch_array($quer);
2559
  }
2560
 
2561
  if ($cat_id) $path.=$cat_id."/";
4587
  WHERE parent_store_category_id = 0");
4588
 
4589
  $store_cat_ids = $this->db_do("SELECT store_category_id FROM $categories_temp");
4590
+ while ($row = mysqli_fetch_array($store_cat_ids))
4591
  {
4592
  $store_category_id = $row['store_category_id'];
4593
 
4803
 
4804
 
4805
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
4806
+ while ($row = mysqli_fetch_array($categories))
4807
  {
4808
  $parent_id = $row['parent_id'];
4809
  $entity_id = $row['entity_id'];
5477
  WHERE aov.value IS NULL";
5478
  $quer=$this->db_do($q);
5479
 
5480
+ while($row=mysqli_fetch_array($quer)){
5481
  $q0="INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
5482
  (attribute_id)
5483
  VALUES(".$this->attributes['manufacturer'].")";
5489
  )(
5490
  SELECT
5491
  max(option_id) as option_id,
5492
+ "."'".mysqli_real_escape_string($row['manufacturer_name'])."'
5493
  FROM ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
5494
  WHERE attribute_id=".$this->attributes['manufacturer']."
5495
  )
5630
  $parse_file=$this->varDir.FILE_PRODUCTS;
5631
  if(filesize($parse_file)){
5632
  $this->_LOG("Start parse ".FILE_PRODUCTS);
 
 
 
 
 
 
 
 
 
 
 
5633
  echo("\nParseProducts 2\n");
5634
 
 
5635
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
5636
  if($this->product_file_format == "NEW"){
5637
  $this->db_do("CREATE TABLE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."(
5702
 
5703
  }
5704
  echo("\nParseProducts 3\n");
5705
+ $this->db_do("LOAD DATA LOCAL INFILE '".$parse_file."'
5706
  INTO TABLE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."
5707
  FIELDS TERMINATED BY '".$this->field_terminated_char."'
5708
  OPTIONALLY ENCLOSED BY '\"'
5742
 
5743
  echo("\nParseProducts 4\n");
5744
 
 
 
 
 
 
 
 
 
 
5745
  echo("\nParseProducts 5\n");
5746
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('products_temp')."
5747
  SET products_date_added=now(), products_last_modified=now()");
5754
  if($this->current_import_status_statistic_id){
5755
  $res = $this->db_do("SELECT COUNT(*) AS cnt
5756
  FROM ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
5757
+ $row = mysqli_fetch_assoc($res);
5758
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
5759
  SET number_of_products=".$row['cnt']."
5760
  WHERE id=".$this->current_import_status_statistic_id);
5848
  $parse_file=$this->varDir.FILE_RESTRICTED_VALUES;
5849
  if(filesize($parse_file) || $this->_ignore_restricted_values){
5850
  $this->_LOG("Start parse ".FILE_RESTRICTED_VALUES);
 
 
 
 
 
 
 
 
 
 
 
 
5851
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp'));
5852
  $this->db_do("CREATE TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')." (
5853
  restricted_value_id int(11),
5858
  KEY(category_feature_id)
5859
  )");
5860
  if(!$this->_ignore_restricted_values){
5861
+ $this->db_do("LOAD DATA LOCAL INFILE '".$parse_file."'
5862
  INTO TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')."
5863
  FIELDS TERMINATED BY '".$this->field_terminated_char."'
5864
  OPTIONALLY ENCLOSED BY '\"'
5865
  LINES TERMINATED BY \"\r\n\"
5866
  IGNORE 1 LINES ");
5867
  }
 
 
5868
  $this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_restricted_values'));
5869
  $this->db_do("RENAME TABLE ".Mage::getSingleton('core/resource')->getTableName('restricted_values_temp')."
5870
  TO ".Mage::getSingleton('core/resource')->getTableName('stINch_restricted_values'));
5907
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
5908
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stock_and_prices_temp')." b
5909
  ON a.store_product_id=b.store_product_id");
5910
+ $row = mysqli_fetch_assoc($res);
5911
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
5912
  SET number_of_products=".$row['cnt']."
5913
  WHERE id=".$this->current_import_status_statistic_id);
6210
  FROM ".Mage::getSingleton('core/resource')->getTableName('core_store')."
6211
  WHERE code!='admin'
6212
  "); // where code!='admin' was adder for editing Featured products;
6213
+ while ($row = mysqli_fetch_assoc($result)) {
6214
  $sql = "INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('products_website_temp')." (
6215
  store_product_id,
6216
  sinch_product_id,
7620
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_link_type')
7621
  );
7622
  $link_type=array();
7623
+ while ($row = mysqli_fetch_array($result)) {
7624
  $link_type[$row['code']]=$row['link_type_id'];
7625
  }
7626
 
7697
  /* $q="select distinct store_product_id from stINch_related_products";
7698
  $quer=$this->db_do($q);
7699
  $prod = Mage::getModel('catalog/product');
7700
+ while ($row = mysqli_fetch_assoc($quer)) {
7701
  $q1="select distinct store_related_product_id store_product_id from stINch_related_products where store_product_id=".$row['store_product_id'].;
7702
  $quer1=$this->db_do($q1);
7703
  $prod->load($row['store_product_id']);
7714
  ###$product->save();
7715
  ###
7716
  $i=1;
7717
+ while ($row1 = mysqli_fetch_assoc($quer1)) {
7718
  $param[$row1['store_related_product_id']]['position']=$i++;
7719
 
7720
  }
7991
  FROM ".Mage::getSingleton('core/resource')->getTableName('import_pricerules')."
7992
  ORDER BY rating DESC
7993
  ");
7994
+ while($row = mysqli_fetch_assoc($result)) {
7995
  $rulesArray[$row['id']] = $row;
7996
  }
7997
  return $rulesArray;
8181
  $q="SELECT customer_group_id FROM ".Mage::getSingleton('core/resource')->getTableName('customer_group');
8182
  $quer=$this->db_do($q);
8183
 
8184
+ while ($row = mysqli_fetch_assoc($quer)) {
8185
  $result = $this->db_do("
8186
  INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price')." (
8187
  entity_id,
8311
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products')."
8312
  WHERE store_product_id =".$store_product_id;
8313
  $quer=$this->db_do($q);
8314
+ $product=mysqli_fetch_array($quer);
8315
 
8316
  $this->productDescription = (string) substr($product['description'],50,0);
8317
  $this->fullProductDescription = (string)$product['description'];
8326
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_manufacturers')."
8327
  WHERE sinch_manufacturer_id=".$product['sinch_manufacturer_id'];
8328
  $quer=$this->db_do($q);
8329
+ $manufacturer=mysqli_fetch_array($quer);
8330
  $this->vendor = (string)$manufacturer['manufacturer_name'];
8331
  }
8332
  $q="SELECT DISTINCT ean_code
8335
  ON sec.product_id=sp.sinch_product_id
8336
  WHERE sp.store_product_id=".$store_product_id;
8337
  $quer=$this->db_do($q);
8338
+ while ($row=mysqli_fetch_array($quer)){
8339
  $EANarr[]=$row['ean_code'];
8340
  }
8341
  // $prodEAN = $productTag->EANCode;
8360
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_categories_features')." c
8361
  ON b.category_feature_id = c.category_feature_id
8362
  WHERE a.sinch_product_id = '" .$this->sinchProductId . "'" );
8363
+ while ($features = mysqli_fetch_array($product_info_features)) {
8364
  $descriptionArray[$features['name']] = $features['value'];
8365
  }
8366
 
8397
 
8398
  // echo $q;
8399
  $quer=$this->db_do($q);
8400
+ while($row=mysqli_fetch_array($quer)){
8401
 
8402
  $productArray = array();
8403
  $productArray['name'] = (string)$row['product_name'];
8428
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_pictures_gallery')."
8429
  WHERE store_product_id=".$store_product_id);
8430
 
8431
+ $res=mysqli_fetch_array($q);
8432
  if(!$res || !$res['cnt']){
8433
  return false;
8434
  }
8440
 
8441
  $res=$this->db_do($q);
8442
 
8443
+ while($photo=mysqli_fetch_array($res)){
8444
  $picHeight = (int)500;//$photo["PicHeight"];
8445
  $picWidth = (int)500;//$photo["PicWidth"];
8446
  $thumbUrl = (string)$photo["ThumbPic"];
8577
  $q=$this->db_do("SELECT store_product_id
8578
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')."
8579
  WHERE entity_id=".$entity_id);
8580
+ $res=mysqli_fetch_array($q);
8581
  // echo $entity_id."AAAA".$res['store_product_id']; exit;
8582
  return ($res['store_product_id']);
8583
  }
8588
  // $connection = Mage::getModel('core/resource')->getConnection('core_write');
8589
  $dbConf = Mage::getConfig()->getResourceConnectionConfig('core_setup');
8590
 
8591
+ if ($this->db = mysqli_connect($dbConf->host, $dbConf->username, $dbConf->password)) {
8592
+ mysqli_options($this->db, MYSQLI_OPT_LOCAL_INFILE, true);
8593
+ if(mysqli_select_db($this->db, $dbConf->dbname)){
8594
  $this->_LOG("Connected..");
8595
  }else{
8596
+ die("Can't select the database: " . mysqli_error($this->db));
8597
  }
8598
  }else{
8599
+ die("Could not connect: " . mysqli_error($this->db));
8600
 
8601
  }
8602
 
8605
 
8606
  private function db_do($query) {
8607
  if($this->debug_mode){
 
8608
  Mage::log("Query: " . $query, null, $this->_logFile);
8609
  }
8610
+ $result = mysqli_query($this->db, $query) or die("Query failed: " . mysqli_error($this->db));
 
 
 
8611
  if (!$result) {
8612
+ throw new Exception("Invalid query: $sql\n" . mysqli_error($this->db));
8613
  } else {
8614
  return $result;
8615
  }
8619
  ##################################################################################################
8620
  function table_rows_count($table){
8621
  $rows_count_res=$this->db_do("select count(*) as cnt from ".$table);
8622
+ $rows_count=mysqli_fetch_array($rows_count_res);
8623
  return ($rows_count['cnt']);
8624
  }
8625
  ##################################################################################################
8675
  WHERE entity_type_id=".$entity_type_id."
8676
  AND attribute_id=".$attribute_id
8677
  );
8678
+ while($row=mysqli_fetch_array($result)){
8679
  $value=$this->valid_char($row['value']);
8680
  if($value!='' and $value!=$row['value']){
8681
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
8682
+ SET value='".mysqli_real_escape_string($value)."'
8683
  WHERE entity_id=".$row['entity_id']."
8684
  AND entity_type_id=".$entity_type_id."
8685
  AND attribute_id=".$attribute_id);
8809
  WHERE parent_store_category_id=".$id;
8810
  $quer=$this->db_do($q);
8811
  $count=0;
8812
+ while ($row=mysqli_fetch_array($quer)){
8813
  $count+=$this->count_children($row['store_category_id']);
8814
  $count++;
8815
  }
8856
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
8857
  WHERE entity_id=".$cat_id;
8858
  $quer=$this->db_do($q);
8859
+ $row=mysqli_fetch_array($quer);
8860
  while($row['parent_id']){
8861
  $path=$row['parent_id'].'/'.$path;
8862
  $q="SELECT
8864
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
8865
  WHERE entity_id=".$row['parent_id'];
8866
  $quer=$this->db_do($q);
8867
+ $row=mysqli_fetch_array($quer);
8868
 
8869
  }
8870
  if($cat_id){
8886
  WHERE store_category_id=".$id;
8887
  $quer=$this->db_do($q);
8888
  $level=1;
8889
+ $row=mysqli_fetch_array($quer);
8890
  while ($row['parent_store_category_id']!=0){
8891
  $q="SELECT parent_store_category_id
8892
  FROM ".Mage::getSingleton('core/resource')->getTableName('categories_temp')."
8893
  WHERE store_category_id=".$row['parent_store_category_id'];
8894
  $quer=$this->db_do($q);
8895
+ $row=mysqli_fetch_array($quer);
8896
  $level++;
8897
  if($level>20){
8898
  break;
8930
  $q="SELECT MAX(id) AS id FROM ".$this->import_status_statistic_table;
8931
 
8932
  $quer=$this->db_do($q);
8933
+ $row=mysqli_fetch_array($quer);
8934
  $this->current_import_status_statistic_id=$row['id'];
8935
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
8936
  SET global_status_import='Failed'
8946
  #################################################################################################
8947
  function set_import_error_reporting_message($message){
8948
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
8949
+ SET error_report_message='".mysqli_real_escape_string($message)."'
8950
  WHERE id=".$this->current_import_status_statistic_id);
8951
  }
8952
  #################################################################################################
8953
  function getImportStatusHistory(){
8954
  $res="SELECT COUNT(*) FROM ".$this->import_status_statistic_table;
8955
+ $cnt_arr=mysqli_fetch_array($this->db_do($res));
8956
  $cnt=$cnt_arr[0];
8957
  $StatusHistory_arr = array();
8958
  if($cnt>0){
8969
  FROM ".$this->import_status_statistic_table."
8970
  ORDER BY start_import limit ".$a.", ".$b;
8971
  $result=$this->db_do($q);
8972
+ while($row=mysqli_fetch_array($result)){
8973
  $StatusHistory_arr[]=$row;
8974
  }
8975
  }
8981
  FROM ".$this->import_status_statistic_table."
8982
  WHERE global_status_import='Successful'
8983
  ORDER BY id DESC LIMIT 1";
8984
+ $imp_date=mysqli_fetch_array($this->db_do($q));
8985
  return $imp_date['start_import'];
8986
  }
8987
  #################################################################################################
8997
  error_report_message
8998
  FROM ".$this->import_status_statistic_table."
8999
  ORDER BY id DESC LIMIT 1";
9000
+ $imp_status=mysqli_fetch_array($this->db_do($q));
9001
  return $imp_status;
9002
  }
9003
 
9027
  FROM ".$this->import_status_table."
9028
  ORDER BY id LIMIT 1";
9029
  $quer=$this->db_do($q);
9030
+ if($row=mysqli_fetch_array($quer)){
9031
  $messages=array('message'=>$row['message'], 'id'=>$row['id'], 'finished'=>$row['finished']);
9032
  $id=$row['id'];
9033
  }
9047
  LIMIT 1
9048
  ";
9049
  $result = $this->db_do($sql);
9050
+ if ($row = mysqli_fetch_assoc($result)) {
9051
  return $row['entity_type_id'];
9052
  }
9053
  return false;
9071
  LIMIT 1
9072
  ";
9073
  $result = $this->db_do($sql);
9074
+ if ($row = mysqli_fetch_assoc($result)) {
9075
 
9076
  $this->defaultAttributeSetId = $row['default_attribute_set_id'];
9077
  }
9089
  LIMIT 1
9090
  ";
9091
  $result = $this->db_do($sql);
9092
+ if ($row = mysqli_fetch_assoc($result)) {
9093
  $this->_categoryEntityTypeId = $row['entity_type_id'];
9094
  $this->_categoryDefault_attribute_set_id = $row['default_attribute_set_id'];
9095
  }
9113
  WHERE entity_type_id = '" . $typeId . "'
9114
  ";
9115
  $result = $this->db_do($sql);
9116
+ while ($row = mysqli_fetch_assoc($result)) {
9117
  $this->_attributeId[$typeCode][$row['attribute_code']] = $row['attribute_id'];
9118
  }
9119
  }
9154
  WHERE
9155
  value='default-category'";
9156
  $res=$this->db_do($q);
9157
+ $row=mysqli_fetch_array($res);
9158
  if($row['entity_id']>0){
9159
  return $row['entity_id'];
9160
  }else{
9163
  WHERE parent_id=".$cat_id;
9164
  $quer=$this->db_do($q);
9165
  $count=0;
9166
+ while ($row=mysqli_fetch_array($quer)){
9167
  $count++;
9168
  $entity_id=$row['entity_id'];
9169
  }
9181
  $q='SHOW TABLES LIKE "'.Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_').'%"';
9182
  $quer=$this->db_do($q);
9183
  $result=false;
9184
+ While($row=mysqli_fetch_array($quer)){
9185
  if(is_array($row)){
9186
  $catalog_product_flat=array_pop($row);
9187
  $q='DELETE pf1 FROM '.$catalog_product_flat.' pf1
9883
  WHERE store_product_id =".$store_product_id;
9884
  $quer=$this->db_do($q);
9885
  $offers = null;
9886
+ while($row = mysqli_fetch_array($quer)){
9887
  $offers[]=$row;
9888
  }
9889
  return $offers;
9903
  WHERE parent_id=".$entity_id;
9904
  $quer=$this->db_do($q);
9905
  $children_cat='';
9906
+ while ($row=mysqli_fetch_array($quer)){
9907
  $children_cat .= ", '".$row['entity_id']."'";
9908
  $children_cat .= $this->get_all_children_cat_recursive($row['entity_id']);
9909
  }
9917
  // echo $q;
9918
  $quer=$this->db_do($q);
9919
  $i=0;
9920
+ while ($row=mysqli_fetch_array($quer)){
9921
  $i++;
9922
  }
9923
  return ($i);
app/code/local/Bintime/Sinchimport/Model/Sinch_new_code.php CHANGED
@@ -57,7 +57,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
57
  $this->price_breaks_filter=PRICE_BREAKS;
58
  /*$this->db_connect();
59
  $res = $this->db_do("select languages_id from languages where code='".LANG_CODE."'");
60
- $row = mysql_fetch_assoc($res);
61
  $this->lang_id = $row['languages_id'];
62
  */
63
  $this->varDir = TEMPORARY_DIRECTORY_FOR_STORING_FILES;
@@ -132,7 +132,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
132
  function is_imort_not_run(){
133
  $q="SELECT IS_FREE_LOCK('sinchimport') as getlock";
134
  $quer=$this->db_do($q);
135
- $row=mysql_fetch_array($quer);
136
  return $row['getlock'];
137
  }
138
  #################################################################################################
@@ -141,7 +141,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
141
  $q='SHOW PROCEDURE STATUS LIKE "'.Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s').'"';
142
  $quer=$this->db_do($q);
143
  $result=false;
144
- While($row=mysql_fetch_array($quer)){
145
  if(($row['Name']==Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s')) && ($row['Db']==$dbConf->dbname)){
146
  $result = true;
147
  }
@@ -152,7 +152,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
152
  function check_db_privileges(){
153
  $q='SHOW PRIVILEGES';
154
  $quer=$this->db_do($q);
155
- while($row=mysql_fetch_array($quer)){
156
  if($row['Privilege']=='File' && $row['Context']=='File access on server'){
157
  return true;
158
  }
@@ -163,7 +163,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
163
  function check_local_infile(){
164
  $q='SHOW VARIABLES LIKE "local_infile"';
165
  $quer=$this->db_do($q);
166
- $row=mysql_fetch_array($quer);
167
  if($row['Variable_name']=='local_infile' && $row['Value']=="ON"){
168
  return true;
169
  }else{
@@ -176,7 +176,7 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
176
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_import_status_statistic')."
177
  WHERE import_type='FULL' AND global_status_import='Successful'";
178
  $quer=$this->db_do($q);
179
- $row=mysql_fetch_array($quer);
180
  if($row['cnt']>0){
181
  return true;
182
  }else{
@@ -528,7 +528,7 @@ echo("\n\n\n==================RETURN=================\n\n\n");
528
 
529
  /**if (!$this->check_loaded_data($parse_file, $categories_temp))
530
  {
531
- $inf = mysql_info();
532
  $this->set_import_error_reporting_message('The Stock In The Channel data files do not appear to be in the correct format. Check file'.$parse_file. "(LOAD DATA ... ".$inf.")");
533
  exit;
534
  }/**/
@@ -764,7 +764,7 @@ echo("\n\n $query\n\n");
764
 
765
 
766
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
767
- while ($row = mysql_fetch_array($categories))
768
  {
769
  $parent_id = $row['parent_id'];
770
  $entity_id = $row['entity_id'];
@@ -775,7 +775,7 @@ echo("\n\n $query\n\n");
775
  UPDATE $catalog_category_entity
776
  SET path = '$path'
777
  WHERE entity_id = $entity_id");
778
- } // while ($row = mysql_fetch_array($categories))
779
 
780
 
781
 
@@ -1211,7 +1211,7 @@ $query = "
1211
  echo("\n $query\n");
1212
  $root_categories = $this->db_do($query);
1213
 
1214
- while($root_cat = mysql_fetch_array($root_categories))
1215
  {
1216
  $root_id = $root_cat['entity_id'];
1217
  $root_name = $root_cat['RootName'];
@@ -1282,13 +1282,13 @@ echo("\n\n ==================================================================
1282
  AND cce.entity_type_id = ccev.entity_type_id
1283
  AND ccev.attribute_id = 41
1284
  WHERE parent_id = 1"); // 41 - category name
1285
- while ($row = mysql_fetch_array($query)) $old_cats[] = $row['category_name'];
1286
 
1287
  //var_dump($old_cats);
1288
 
1289
 
1290
  $query = $this->db_do("SELECT MAX(entity_id) AS max_entity_id FROM $catalog_category_entity");
1291
- $max_entity_id = mysql_fetch_array($query);
1292
 
1293
  //var_dump($max_entity_id);
1294
 
@@ -1373,11 +1373,11 @@ echo("\n createNewDefaultCategories done... \n ===========================
1373
  AND ccev.attribute_id = 41
1374
  WHERE parent_id = 1"); // 41 - category name
1375
  $OLD = array();
1376
- while($root_cat = mysql_fetch_array($root_categories)) $OLD[] = $root_cat['category_name'];
1377
 
1378
  $new_categories = $this->db_do("SELECT DISTINCT RootName FROM $categories_temp");
1379
  $NEW = array();
1380
- while($new_root_cat = mysql_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['RootName']] = TRUE;
1381
 
1382
  /**
1383
  $exists_coincidence = array();
@@ -1587,7 +1587,7 @@ $query = "
1587
  echo("\n\n$query\n\n");
1588
  $root_categories = $this->db_do($query);
1589
 
1590
- while($root_cat = mysql_fetch_array($root_categories))
1591
  {
1592
  $root_id = $root_cat['entity_id'];
1593
  $root_name = $root_cat['RootName'];
@@ -1737,7 +1737,7 @@ echo("\n\n$query\n\n");
1737
 
1738
 
1739
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
1740
- while ($row = mysql_fetch_array($categories))
1741
  {
1742
  $parent_id = $row['parent_id'];
1743
  $entity_id = $row['entity_id'];
@@ -1748,7 +1748,7 @@ echo("\n\n$query\n\n");
1748
  UPDATE $catalog_category_entity
1749
  SET path = '$path'
1750
  WHERE entity_id = $entity_id");
1751
- } // while ($row = mysql_fetch_array($categories))
1752
 
1753
 
1754
  ///////////////////////////////////////////////////////
@@ -2086,7 +2086,7 @@ echo("\n\n$query\n\n");
2086
  FROM $catalog_category_entity
2087
  WHERE entity_id = $cat_id";
2088
  $quer = $this->db_do($q);
2089
- $row = mysql_fetch_array($quer);
2090
  while ($row['parent_id'])
2091
  {
2092
  $path = $row['parent_id'].'/'.$path;
@@ -2098,7 +2098,7 @@ echo("\n\n$query\n\n");
2098
  FROM $catalog_category_entity
2099
  WHERE entity_id = $parent_id";
2100
  $quer = $this->db_do($q);
2101
- $row = mysql_fetch_array($quer);
2102
  }
2103
 
2104
  if ($cat_id) $path.=$cat_id."/";
@@ -3043,7 +3043,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
3043
  WHERE parent_store_category_id = 0");
3044
 
3045
  $store_cat_ids = $this->db_do("SELECT store_category_id FROM $categories_temp");
3046
- while ($row = mysql_fetch_array($store_cat_ids))
3047
  {
3048
  $store_category_id = $row['store_category_id'];
3049
 
@@ -3259,7 +3259,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
3259
 
3260
 
3261
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
3262
- while ($row = mysql_fetch_array($categories))
3263
  {
3264
  $parent_id = $row['parent_id'];
3265
  $entity_id = $row['entity_id'];
@@ -3752,7 +3752,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
3752
  WHERE aov.value IS NULL";
3753
  $quer=$this->db_do($q);
3754
 
3755
- while($row=mysql_fetch_array($quer)){
3756
  $q0="INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
3757
  (attribute_id)
3758
  VALUES(".$this->attributes['manufacturer'].")";
@@ -3764,7 +3764,7 @@ echo("\n replaceMagentoProductsMultistore 41\n");
3764
  )(
3765
  SELECT
3766
  max(option_id) as option_id,
3767
- "."'".mysql_real_escape_string($row['manufacturer_name'])."'
3768
  FROM ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
3769
  WHERE attribute_id=".$this->attributes['manufacturer']."
3770
  )
@@ -3906,7 +3906,7 @@ echo("\nParseProducts 7\n");
3906
  if($this->current_import_status_statistic_id){
3907
  $res = $this->db_do("SELECT COUNT(*) AS cnt
3908
  FROM ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
3909
- $row = mysql_fetch_assoc($res);
3910
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
3911
  SET number_of_products=".$row['cnt']."
3912
  WHERE id=".$this->current_import_status_statistic_id);
@@ -4059,7 +4059,7 @@ echo("\nParseProducts 11\n");
4059
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
4060
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stock_and_prices_temp')." b
4061
  ON a.store_product_id=b.store_product_id");
4062
- $row = mysql_fetch_assoc($res);
4063
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
4064
  SET number_of_products=".$row['cnt']."
4065
  WHERE id=".$this->current_import_status_statistic_id);
@@ -4227,7 +4227,7 @@ echo("\nParseProducts 11\n");
4227
  FROM ".Mage::getSingleton('core/resource')->getTableName('core_store')."
4228
  WHERE code!='admin'
4229
  "); // where code!='admin' was adder for editing Featured products;
4230
- while ($row = mysql_fetch_assoc($result)) {
4231
  $sql = "INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('products_website_temp')." (
4232
  store_product_id,
4233
  sinch_product_id,
@@ -5314,7 +5314,7 @@ echo("\ndone\n");
5314
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_link_type')
5315
  );
5316
  $link_type=array();
5317
- while ($row = mysql_fetch_array($result)) {
5318
  $link_type[$row['code']]=$row['link_type_id'];
5319
  }
5320
 
@@ -5391,7 +5391,7 @@ echo("\ndone\n");
5391
  /* $q="select distinct store_product_id from stINch_related_products";
5392
  $quer=$this->db_do($q);
5393
  $prod = Mage::getModel('catalog/product');
5394
- while ($row = mysql_fetch_assoc($quer)) {
5395
  $q1="select distinct store_related_product_id store_product_id from stINch_related_products where store_product_id=".$row['store_product_id'].;
5396
  $quer1=$this->db_do($q1);
5397
  $prod->load($row['store_product_id']);
@@ -5408,7 +5408,7 @@ echo("\ndone\n");
5408
  ###$product->save();
5409
  ###
5410
  $i=1;
5411
- while ($row1 = mysql_fetch_assoc($quer1)) {
5412
  $param[$row1['store_related_product_id']]['position']=$i++;
5413
 
5414
  }
@@ -5655,7 +5655,7 @@ echo("\ndone\n");
5655
  $q="SELECT customer_group_id FROM ".Mage::getSingleton('core/resource')->getTableName('customer_group');
5656
  $quer=$this->db_do($q);
5657
 
5658
- while ($row = mysql_fetch_assoc($quer)) {
5659
  $result = $this->db_do("
5660
  INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price')." (
5661
  entity_id,
@@ -5785,7 +5785,7 @@ echo("\ndone\n");
5785
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products')."
5786
  WHERE store_product_id =".$store_product_id;
5787
  $quer=$this->db_do($q);
5788
- $product=mysql_fetch_array($quer);
5789
 
5790
  $this->productDescription = (string) substr($product['description'],50,0);
5791
  $this->fullProductDescription = (string)$product['description'];
@@ -5800,7 +5800,7 @@ echo("\ndone\n");
5800
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_manufacturers')."
5801
  WHERE sinch_manufacturer_id=".$product['sinch_manufacturer_id'];
5802
  $quer=$this->db_do($q);
5803
- $manufacturer=mysql_fetch_array($quer);
5804
  $this->vendor = (string)$manufacturer['manufacturer_name'];
5805
  }
5806
  $q="SELECT DISTINCT ean_code
@@ -5809,7 +5809,7 @@ echo("\ndone\n");
5809
  ON sec.product_id=sp.sinch_product_id
5810
  WHERE sp.store_product_id=".$store_product_id;
5811
  $quer=$this->db_do($q);
5812
- while ($row=mysql_fetch_array($quer)){
5813
  $EANarr[]=$row['ean_code'];
5814
  }
5815
  // $prodEAN = $productTag->EANCode;
@@ -5834,7 +5834,7 @@ echo("\ndone\n");
5834
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_categories_features')." c
5835
  ON b.category_feature_id = c.category_feature_id
5836
  WHERE a.sinch_product_id = '" .$this->sinchProductId . "'" );
5837
- while ($features = mysql_fetch_array($product_info_features)) {
5838
  $descriptionArray[$features['name']] = $features['value'];
5839
  }
5840
 
@@ -5871,7 +5871,7 @@ echo("\ndone\n");
5871
 
5872
  // echo $q;
5873
  $quer=$this->db_do($q);
5874
- while($row=mysql_fetch_array($quer)){
5875
 
5876
  $productArray = array();
5877
  $productArray['name'] = (string)$row['product_name'];
@@ -5902,7 +5902,7 @@ echo("\ndone\n");
5902
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_pictures_gallery')."
5903
  WHERE store_product_id=".$store_product_id);
5904
 
5905
- $res=mysql_fetch_array($q);
5906
  if(!$res || !$res['cnt']){
5907
  return false;
5908
  }
@@ -5914,7 +5914,7 @@ echo("\ndone\n");
5914
 
5915
  $res=$this->db_do($q);
5916
 
5917
- while($photo=mysql_fetch_array($res)){
5918
  $picHeight = (int)500;//$photo["PicHeight"];
5919
  $picWidth = (int)500;//$photo["PicWidth"];
5920
  $thumbUrl = (string)$photo["ThumbPic"];
@@ -6044,7 +6044,7 @@ echo("\ndone\n");
6044
  $q=$this->db_do("SELECT store_product_id
6045
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')."
6046
  WHERE entity_id=".$entity_id);
6047
- $res=mysql_fetch_array($q);
6048
  // echo $entity_id."AAAA".$res['store_product_id']; exit;
6049
  return ($res['store_product_id']);
6050
  }
@@ -6055,14 +6055,15 @@ echo("\ndone\n");
6055
  // $connection = Mage::getModel('core/resource')->getConnection('core_write');
6056
  $dbConf = Mage::getConfig()->getResourceConnectionConfig('core_setup');
6057
 
6058
- if ($this->db = mysql_connect($dbConf->host, $dbConf->username, $dbConf->password, true, 128)) {
6059
- if(mysql_select_db($dbConf->dbname)){
 
6060
  $this->_LOG("Connected..");
6061
  }else{
6062
- die("Can't select the database: " . mysql_error());
6063
  }
6064
  }else{
6065
- die("Could not connect: " . mysql_error());
6066
 
6067
  }
6068
 
@@ -6075,11 +6076,11 @@ echo("\ndone\n");
6075
  Mage::log("Query: " . $query, null, $this->_logFile);
6076
  }
6077
  // $result = $this->this->db_do($query);//
6078
- // $query=mysql_real_escape_string($query);
6079
- //mysql_query('set names utf8');
6080
- $result = mysql_query($query) or die("Query failed: " . mysql_error());
6081
  if (!$result) {
6082
- throw new Exception("Invalid query: $sql\n" . mysql_error());
6083
  } else {
6084
  return $result;
6085
  }
@@ -6089,7 +6090,7 @@ echo("\ndone\n");
6089
  ##################################################################################################
6090
  function table_rows_count($table){
6091
  $rows_count_res=$this->db_do("select count(*) as cnt from ".$table);
6092
- $rows_count=mysql_fetch_array($rows_count_res);
6093
  return ($rows_count['cnt']);
6094
  }
6095
  ##################################################################################################
@@ -6145,11 +6146,11 @@ echo("\ndone\n");
6145
  WHERE entity_type_id=".$entity_type_id."
6146
  AND attribute_id=".$attribute_id
6147
  );
6148
- while($row=mysql_fetch_array($result)){
6149
  $value=$this->valid_char($row['value']);
6150
  if($value!='' and $value!=$row['value']){
6151
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
6152
- SET value='".mysql_real_escape_string($value)."'
6153
  WHERE entity_id=".$row['entity_id']."
6154
  AND entity_type_id=".$entity_type_id."
6155
  AND attribute_id=".$attribute_id);
@@ -6279,7 +6280,7 @@ echo("\ndone\n");
6279
  WHERE parent_store_category_id=".$id;
6280
  $quer=$this->db_do($q);
6281
  $count=0;
6282
- while ($row=mysql_fetch_array($quer)){
6283
  $count+=$this->count_children($row['store_category_id']);
6284
  $count++;
6285
  }
@@ -6326,7 +6327,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6326
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
6327
  WHERE entity_id=".$cat_id;
6328
  $quer=$this->db_do($q);
6329
- $row=mysql_fetch_array($quer);
6330
  while($row['parent_id']){
6331
  $path=$row['parent_id'].'/'.$path;
6332
  $q="SELECT
@@ -6334,7 +6335,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6334
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
6335
  WHERE entity_id=".$row['parent_id'];
6336
  $quer=$this->db_do($q);
6337
- $row=mysql_fetch_array($quer);
6338
 
6339
  }
6340
  if($cat_id){
@@ -6356,13 +6357,13 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6356
  WHERE store_category_id=".$id;
6357
  $quer=$this->db_do($q);
6358
  $level=1;
6359
- $row=mysql_fetch_array($quer);
6360
  while ($row['parent_store_category_id']!=0){
6361
  $q="SELECT parent_store_category_id
6362
  FROM ".Mage::getSingleton('core/resource')->getTableName('categories_temp')."
6363
  WHERE store_category_id=".$row['parent_store_category_id'];
6364
  $quer=$this->db_do($q);
6365
- $row=mysql_fetch_array($quer);
6366
  $level++;
6367
  if($level>20){
6368
  break;
@@ -6400,7 +6401,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6400
  $q="SELECT MAX(id) AS id FROM ".$this->import_status_statistic_table;
6401
 
6402
  $quer=$this->db_do($q);
6403
- $row=mysql_fetch_array($quer);
6404
  $this->current_import_status_statistic_id=$row['id'];
6405
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
6406
  SET global_status_import='Failed'
@@ -6416,13 +6417,13 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6416
  #################################################################################################
6417
  function set_import_error_reporting_message($message){
6418
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
6419
- SET error_report_message='".mysql_real_escape_string($message)."'
6420
  WHERE id=".$this->current_import_status_statistic_id);
6421
  }
6422
  #################################################################################################
6423
  function getImportStatusHistory(){
6424
  $res="SELECT COUNT(*) FROM ".$this->import_status_statistic_table;
6425
- $cnt_arr=mysql_fetch_array($this->db_do($res));
6426
  $cnt=$cnt_arr[0];
6427
  $StatusHistory_arr = array();
6428
  if($cnt>0){
@@ -6439,7 +6440,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6439
  FROM ".$this->import_status_statistic_table."
6440
  ORDER BY start_import limit ".$a.", ".$b;
6441
  $result=$this->db_do($q);
6442
- while($row=mysql_fetch_array($result)){
6443
  $StatusHistory_arr[]=$row;
6444
  }
6445
  }
@@ -6451,7 +6452,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6451
  FROM ".$this->import_status_statistic_table."
6452
  WHERE global_status_import='Successful'
6453
  ORDER BY id DESC LIMIT 1";
6454
- $imp_date=mysql_fetch_array($this->db_do($q));
6455
  return $imp_date['start_import'];
6456
  }
6457
  #################################################################################################
@@ -6467,7 +6468,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6467
  error_report_message
6468
  FROM ".$this->import_status_statistic_table."
6469
  ORDER BY id DESC LIMIT 1";
6470
- $imp_status=mysql_fetch_array($this->db_do($q));
6471
  return $imp_status;
6472
  }
6473
 
@@ -6497,7 +6498,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6497
  FROM ".$this->import_status_table."
6498
  ORDER BY id LIMIT 1";
6499
  $quer=$this->db_do($q);
6500
- if($row=mysql_fetch_array($quer)){
6501
  $messages=array('message'=>$row['message'], 'id'=>$row['id'], 'finished'=>$row['finished']);
6502
  $id=$row['id'];
6503
  }
@@ -6517,7 +6518,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6517
  LIMIT 1
6518
  ";
6519
  $result = $this->db_do($sql);
6520
- if ($row = mysql_fetch_assoc($result)) {
6521
  return $row['entity_type_id'];
6522
  }
6523
  return false;
@@ -6541,7 +6542,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6541
  LIMIT 1
6542
  ";
6543
  $result = $this->db_do($sql);
6544
- if ($row = mysql_fetch_assoc($result)) {
6545
 
6546
  $this->defaultAttributeSetId = $row['default_attribute_set_id'];
6547
  }
@@ -6559,7 +6560,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6559
  LIMIT 1
6560
  ";
6561
  $result = $this->db_do($sql);
6562
- if ($row = mysql_fetch_assoc($result)) {
6563
  $this->_categoryEntityTypeId = $row['entity_type_id'];
6564
  $this->_categoryDefault_attribute_set_id = $row['default_attribute_set_id'];
6565
  }
@@ -6583,7 +6584,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6583
  WHERE entity_type_id = '" . $typeId . "'
6584
  ";
6585
  $result = $this->db_do($sql);
6586
- while ($row = mysql_fetch_assoc($result)) {
6587
  $this->_attributeId[$typeCode][$row['attribute_code']] = $row['attribute_id'];
6588
  }
6589
  }
@@ -6624,7 +6625,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6624
  WHERE
6625
  value='default-category'";
6626
  $res=$this->db_do($q);
6627
- $row=mysql_fetch_array($res);
6628
  if($row['entity_id']>0){
6629
  return $row['entity_id'];
6630
  }else{
@@ -6633,7 +6634,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6633
  WHERE parent_id=".$cat_id;
6634
  $quer=$this->db_do($q);
6635
  $count=0;
6636
- while ($row=mysql_fetch_array($quer)){
6637
  $count++;
6638
  $entity_id=$row['entity_id'];
6639
  }
@@ -6651,7 +6652,7 @@ echo("\nparent_id = [$parent_id] ent_id = [$ent_id]\n");
6651
  $q='SHOW TABLES LIKE "'.Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_').'%"';
6652
  $quer=$this->db_do($q);
6653
  $result=false;
6654
- While($row=mysql_fetch_array($quer)){
6655
  if(is_array($row)){
6656
  $catalog_product_flat=array_pop($row);
6657
  $q='DELETE pf1 FROM '.$catalog_product_flat.' pf1
57
  $this->price_breaks_filter=PRICE_BREAKS;
58
  /*$this->db_connect();
59
  $res = $this->db_do("select languages_id from languages where code='".LANG_CODE."'");
60
+ $row = mysqli_fetch_assoc($res);
61
  $this->lang_id = $row['languages_id'];
62
  */
63
  $this->varDir = TEMPORARY_DIRECTORY_FOR_STORING_FILES;
132
  function is_imort_not_run(){
133
  $q="SELECT IS_FREE_LOCK('sinchimport') as getlock";
134
  $quer=$this->db_do($q);
135
+ $row=mysqli_fetch_array($quer);
136
  return $row['getlock'];
137
  }
138
  #################################################################################################
141
  $q='SHOW PROCEDURE STATUS LIKE "'.Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s').'"';
142
  $quer=$this->db_do($q);
143
  $result=false;
144
+ While($row=mysqli_fetch_array($quer)){
145
  if(($row['Name']==Mage::getSingleton('core/resource')->getTableName('filter_sinch_products_s')) && ($row['Db']==$dbConf->dbname)){
146
  $result = true;
147
  }
152
  function check_db_privileges(){
153
  $q='SHOW PRIVILEGES';
154
  $quer=$this->db_do($q);
155
+ while($row=mysqli_fetch_array($quer)){
156
  if($row['Privilege']=='File' && $row['Context']=='File access on server'){
157
  return true;
158
  }
163
  function check_local_infile(){
164
  $q='SHOW VARIABLES LIKE "local_infile"';
165
  $quer=$this->db_do($q);
166
+ $row=mysqli_fetch_array($quer);
167
  if($row['Variable_name']=='local_infile' && $row['Value']=="ON"){
168
  return true;
169
  }else{
176
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_import_status_statistic')."
177
  WHERE import_type='FULL' AND global_status_import='Successful'";
178
  $quer=$this->db_do($q);
179
+ $row=mysqli_fetch_array($quer);
180
  if($row['cnt']>0){
181
  return true;
182
  }else{
528
 
529
  /**if (!$this->check_loaded_data($parse_file, $categories_temp))
530
  {
531
+ $inf = mysqli_info();
532
  $this->set_import_error_reporting_message('The Stock In The Channel data files do not appear to be in the correct format. Check file'.$parse_file. "(LOAD DATA ... ".$inf.")");
533
  exit;
534
  }/**/
764
 
765
 
766
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
767
+ while ($row = mysqli_fetch_array($categories))
768
  {
769
  $parent_id = $row['parent_id'];
770
  $entity_id = $row['entity_id'];
775
  UPDATE $catalog_category_entity
776
  SET path = '$path'
777
  WHERE entity_id = $entity_id");
778
+ } // while ($row = mysqli_fetch_array($categories))
779
 
780
 
781
 
1211
  echo("\n $query\n");
1212
  $root_categories = $this->db_do($query);
1213
 
1214
+ while($root_cat = mysqli_fetch_array($root_categories))
1215
  {
1216
  $root_id = $root_cat['entity_id'];
1217
  $root_name = $root_cat['RootName'];
1282
  AND cce.entity_type_id = ccev.entity_type_id
1283
  AND ccev.attribute_id = 41
1284
  WHERE parent_id = 1"); // 41 - category name
1285
+ while ($row = mysqli_fetch_array($query)) $old_cats[] = $row['category_name'];
1286
 
1287
  //var_dump($old_cats);
1288
 
1289
 
1290
  $query = $this->db_do("SELECT MAX(entity_id) AS max_entity_id FROM $catalog_category_entity");
1291
+ $max_entity_id = mysqli_fetch_array($query);
1292
 
1293
  //var_dump($max_entity_id);
1294
 
1373
  AND ccev.attribute_id = 41
1374
  WHERE parent_id = 1"); // 41 - category name
1375
  $OLD = array();
1376
+ while($root_cat = mysqli_fetch_array($root_categories)) $OLD[] = $root_cat['category_name'];
1377
 
1378
  $new_categories = $this->db_do("SELECT DISTINCT RootName FROM $categories_temp");
1379
  $NEW = array();
1380
+ while($new_root_cat = mysqli_fetch_array($new_categories)) $exists_coincidence[$new_root_cat['RootName']] = TRUE;
1381
 
1382
  /**
1383
  $exists_coincidence = array();
1587
  echo("\n\n$query\n\n");
1588
  $root_categories = $this->db_do($query);
1589
 
1590
+ while($root_cat = mysqli_fetch_array($root_categories))
1591
  {
1592
  $root_id = $root_cat['entity_id'];
1593
  $root_name = $root_cat['RootName'];
1737
 
1738
 
1739
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
1740
+ while ($row = mysqli_fetch_array($categories))
1741
  {
1742
  $parent_id = $row['parent_id'];
1743
  $entity_id = $row['entity_id'];
1748
  UPDATE $catalog_category_entity
1749
  SET path = '$path'
1750
  WHERE entity_id = $entity_id");
1751
+ } // while ($row = mysqli_fetch_array($categories))
1752
 
1753
 
1754
  ///////////////////////////////////////////////////////
2086
  FROM $catalog_category_entity
2087
  WHERE entity_id = $cat_id";
2088
  $quer = $this->db_do($q);
2089
+ $row = mysqli_fetch_array($quer);
2090
  while ($row['parent_id'])
2091
  {
2092
  $path = $row['parent_id'].'/'.$path;
2098
  FROM $catalog_category_entity
2099
  WHERE entity_id = $parent_id";
2100
  $quer = $this->db_do($q);
2101
+ $row = mysqli_fetch_array($quer);
2102
  }
2103
 
2104
  if ($cat_id) $path.=$cat_id."/";
3043
  WHERE parent_store_category_id = 0");
3044
 
3045
  $store_cat_ids = $this->db_do("SELECT store_category_id FROM $categories_temp");
3046
+ while ($row = mysqli_fetch_array($store_cat_ids))
3047
  {
3048
  $store_category_id = $row['store_category_id'];
3049
 
3259
 
3260
 
3261
  $categories = $this->db_do("SELECT entity_id, parent_id FROM $catalog_category_entity ORDER BY parent_id");
3262
+ while ($row = mysqli_fetch_array($categories))
3263
  {
3264
  $parent_id = $row['parent_id'];
3265
  $entity_id = $row['entity_id'];
3752
  WHERE aov.value IS NULL";
3753
  $quer=$this->db_do($q);
3754
 
3755
+ while($row=mysqli_fetch_array($quer)){
3756
  $q0="INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
3757
  (attribute_id)
3758
  VALUES(".$this->attributes['manufacturer'].")";
3764
  )(
3765
  SELECT
3766
  max(option_id) as option_id,
3767
+ "."'".mysqli_real_escape_string($row['manufacturer_name'])."'
3768
  FROM ".Mage::getSingleton('core/resource')->getTableName('eav_attribute_option')."
3769
  WHERE attribute_id=".$this->attributes['manufacturer']."
3770
  )
3906
  if($this->current_import_status_statistic_id){
3907
  $res = $this->db_do("SELECT COUNT(*) AS cnt
3908
  FROM ".Mage::getSingleton('core/resource')->getTableName('products_temp'));
3909
+ $row = mysqli_fetch_assoc($res);
3910
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
3911
  SET number_of_products=".$row['cnt']."
3912
  WHERE id=".$this->current_import_status_statistic_id);
4059
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
4060
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stock_and_prices_temp')." b
4061
  ON a.store_product_id=b.store_product_id");
4062
+ $row = mysqli_fetch_assoc($res);
4063
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
4064
  SET number_of_products=".$row['cnt']."
4065
  WHERE id=".$this->current_import_status_statistic_id);
4227
  FROM ".Mage::getSingleton('core/resource')->getTableName('core_store')."
4228
  WHERE code!='admin'
4229
  "); // where code!='admin' was adder for editing Featured products;
4230
+ while ($row = mysqli_fetch_assoc($result)) {
4231
  $sql = "INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('products_website_temp')." (
4232
  store_product_id,
4233
  sinch_product_id,
5314
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_link_type')
5315
  );
5316
  $link_type=array();
5317
+ while ($row = mysqli_fetch_array($result)) {
5318
  $link_type[$row['code']]=$row['link_type_id'];
5319
  }
5320
 
5391
  /* $q="select distinct store_product_id from stINch_related_products";
5392
  $quer=$this->db_do($q);
5393
  $prod = Mage::getModel('catalog/product');
5394
+ while ($row = mysqli_fetch_assoc($quer)) {
5395
  $q1="select distinct store_related_product_id store_product_id from stINch_related_products where store_product_id=".$row['store_product_id'].;
5396
  $quer1=$this->db_do($q1);
5397
  $prod->load($row['store_product_id']);
5408
  ###$product->save();
5409
  ###
5410
  $i=1;
5411
+ while ($row1 = mysqli_fetch_assoc($quer1)) {
5412
  $param[$row1['store_related_product_id']]['position']=$i++;
5413
 
5414
  }
5655
  $q="SELECT customer_group_id FROM ".Mage::getSingleton('core/resource')->getTableName('customer_group');
5656
  $quer=$this->db_do($q);
5657
 
5658
+ while ($row = mysqli_fetch_assoc($quer)) {
5659
  $result = $this->db_do("
5660
  INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price')." (
5661
  entity_id,
5785
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products')."
5786
  WHERE store_product_id =".$store_product_id;
5787
  $quer=$this->db_do($q);
5788
+ $product=mysqli_fetch_array($quer);
5789
 
5790
  $this->productDescription = (string) substr($product['description'],50,0);
5791
  $this->fullProductDescription = (string)$product['description'];
5800
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_manufacturers')."
5801
  WHERE sinch_manufacturer_id=".$product['sinch_manufacturer_id'];
5802
  $quer=$this->db_do($q);
5803
+ $manufacturer=mysqli_fetch_array($quer);
5804
  $this->vendor = (string)$manufacturer['manufacturer_name'];
5805
  }
5806
  $q="SELECT DISTINCT ean_code
5809
  ON sec.product_id=sp.sinch_product_id
5810
  WHERE sp.store_product_id=".$store_product_id;
5811
  $quer=$this->db_do($q);
5812
+ while ($row=mysqli_fetch_array($quer)){
5813
  $EANarr[]=$row['ean_code'];
5814
  }
5815
  // $prodEAN = $productTag->EANCode;
5834
  INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_categories_features')." c
5835
  ON b.category_feature_id = c.category_feature_id
5836
  WHERE a.sinch_product_id = '" .$this->sinchProductId . "'" );
5837
+ while ($features = mysqli_fetch_array($product_info_features)) {
5838
  $descriptionArray[$features['name']] = $features['value'];
5839
  }
5840
 
5871
 
5872
  // echo $q;
5873
  $quer=$this->db_do($q);
5874
+ while($row=mysqli_fetch_array($quer)){
5875
 
5876
  $productArray = array();
5877
  $productArray['name'] = (string)$row['product_name'];
5902
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_pictures_gallery')."
5903
  WHERE store_product_id=".$store_product_id);
5904
 
5905
+ $res=mysqli_fetch_array($q);
5906
  if(!$res || !$res['cnt']){
5907
  return false;
5908
  }
5914
 
5915
  $res=$this->db_do($q);
5916
 
5917
+ while($photo=mysqli_fetch_array($res)){
5918
  $picHeight = (int)500;//$photo["PicHeight"];
5919
  $picWidth = (int)500;//$photo["PicWidth"];
5920
  $thumbUrl = (string)$photo["ThumbPic"];
6044
  $q=$this->db_do("SELECT store_product_id
6045
  FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')."
6046
  WHERE entity_id=".$entity_id);
6047
+ $res=mysqli_fetch_array($q);
6048
  // echo $entity_id."AAAA".$res['store_product_id']; exit;
6049
  return ($res['store_product_id']);
6050
  }
6055
  // $connection = Mage::getModel('core/resource')->getConnection('core_write');
6056
  $dbConf = Mage::getConfig()->getResourceConnectionConfig('core_setup');
6057
 
6058
+ if ($this->db = mysqli_connect($dbConf->host, $dbConf->username, $dbConf->password)) {
6059
+ mysqli_options($this->db, MYSQLI_OPT_LOCAL_INFILE, true);
6060
+ if(mysqli_select_db($this->db, $dbConf->dbname)){
6061
  $this->_LOG("Connected..");
6062
  }else{
6063
+ die("Can't select the database: " . mysqli_error($this->db));
6064
  }
6065
  }else{
6066
+ die("Could not connect: " . mysqli_error($this->db));
6067
 
6068
  }
6069
 
6076
  Mage::log("Query: " . $query, null, $this->_logFile);
6077
  }
6078
  // $result = $this->this->db_do($query);//
6079
+ // $query=mysqli_real_escape_string($query);
6080
+ //mysqli_query('set names utf8');
6081
+ $result = mysqli_query($this->db, $query) or die("Query failed: " . mysqli_error($this->db));
6082
  if (!$result) {
6083
+ throw new Exception("Invalid query: $sql\n" . mysqli_error($this->db));
6084
  } else {
6085
  return $result;
6086
  }
6090
  ##################################################################################################
6091
  function table_rows_count($table){
6092
  $rows_count_res=$this->db_do("select count(*) as cnt from ".$table);
6093
+ $rows_count=mysqli_fetch_array($rows_count_res);
6094
  return ($rows_count['cnt']);
6095
  }
6096
  ##################################################################################################
6146
  WHERE entity_type_id=".$entity_type_id."
6147
  AND attribute_id=".$attribute_id
6148
  );
6149
+ while($row=mysqli_fetch_array($result)){
6150
  $value=$this->valid_char($row['value']);
6151
  if($value!='' and $value!=$row['value']){
6152
  $this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
6153
+ SET value='".mysqli_real_escape_string($value)."'
6154
  WHERE entity_id=".$row['entity_id']."
6155
  AND entity_type_id=".$entity_type_id."
6156
  AND attribute_id=".$attribute_id);
6280
  WHERE parent_store_category_id=".$id;
6281
  $quer=$this->db_do($q);
6282
  $count=0;
6283
+ while ($row=mysqli_fetch_array($quer)){
6284
  $count+=$this->count_children($row['store_category_id']);
6285
  $count++;
6286
  }
6327
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
6328
  WHERE entity_id=".$cat_id;
6329
  $quer=$this->db_do($q);
6330
+ $row=mysqli_fetch_array($quer);
6331
  while($row['parent_id']){
6332
  $path=$row['parent_id'].'/'.$path;
6333
  $q="SELECT
6335
  FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_category_entity')."
6336
  WHERE entity_id=".$row['parent_id'];
6337
  $quer=$this->db_do($q);
6338
+ $row=mysqli_fetch_array($quer);
6339
 
6340
  }
6341
  if($cat_id){
6357
  WHERE store_category_id=".$id;
6358
  $quer=$this->db_do($q);
6359
  $level=1;
6360
+ $row=mysqli_fetch_array($quer);
6361
  while ($row['parent_store_category_id']!=0){
6362
  $q="SELECT parent_store_category_id
6363
  FROM ".Mage::getSingleton('core/resource')->getTableName('categories_temp')."
6364
  WHERE store_category_id=".$row['parent_store_category_id'];
6365
  $quer=$this->db_do($q);
6366
+ $row=mysqli_fetch_array($quer);
6367
  $level++;
6368
  if($level>20){
6369
  break;
6401
  $q="SELECT MAX(id) AS id FROM ".$this->import_status_statistic_table;
6402
 
6403
  $quer=$this->db_do($q);
6404
+ $row=mysqli_fetch_array($quer);
6405
  $this->current_import_status_statistic_id=$row['id'];
6406
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
6407
  SET global_status_import='Failed'
6417
  #################################################################################################
6418
  function set_import_error_reporting_message($message){
6419
  $this->db_do("UPDATE ".$this->import_status_statistic_table."
6420
+ SET error_report_message='".mysqli_real_escape_string($message)."'
6421
  WHERE id=".$this->current_import_status_statistic_id);
6422
  }
6423
  #################################################################################################
6424
  function getImportStatusHistory(){
6425
  $res="SELECT COUNT(*) FROM ".$this->import_status_statistic_table;
6426
+ $cnt_arr=mysqli_fetch_array($this->db_do($res));
6427
  $cnt=$cnt_arr[0];
6428
  $StatusHistory_arr = array();
6429
  if($cnt>0){
6440
  FROM ".$this->import_status_statistic_table."
6441
  ORDER BY start_import limit ".$a.", ".$b;
6442
  $result=$this->db_do($q);
6443
+ while($row=mysqli_fetch_array($result)){
6444
  $StatusHistory_arr[]=$row;
6445
  }
6446
  }
6452
  FROM ".$this->import_status_statistic_table."
6453
  WHERE global_status_import='Successful'
6454
  ORDER BY id DESC LIMIT 1";
6455
+ $imp_date=mysqli_fetch_array($this->db_do($q));
6456
  return $imp_date['start_import'];
6457
  }
6458
  #################################################################################################
6468
  error_report_message
6469
  FROM ".$this->import_status_statistic_table."
6470
  ORDER BY id DESC LIMIT 1";
6471
+ $imp_status=mysqli_fetch_array($this->db_do($q));
6472
  return $imp_status;
6473
  }
6474
 
6498
  FROM ".$this->import_status_table."
6499
  ORDER BY id LIMIT 1";
6500
  $quer=$this->db_do($q);
6501
+ if($row=mysqli_fetch_array($quer)){
6502
  $messages=array('message'=>$row['message'], 'id'=>$row['id'], 'finished'=>$row['finished']);
6503
  $id=$row['id'];
6504
  }
6518
  LIMIT 1
6519
  ";
6520
  $result = $this->db_do($sql);
6521
+ if ($row = mysqli_fetch_assoc($result)) {
6522
  return $row['entity_type_id'];
6523
  }
6524
  return false;
6542
  LIMIT 1
6543
  ";
6544
  $result = $this->db_do($sql);
6545
+ if ($row = mysqli_fetch_assoc($result)) {
6546
 
6547
  $this->defaultAttributeSetId = $row['default_attribute_set_id'];
6548
  }
6560
  LIMIT 1
6561
  ";
6562
  $result = $this->db_do($sql);
6563
+ if ($row = mysqli_fetch_assoc($result)) {
6564
  $this->_categoryEntityTypeId = $row['entity_type_id'];
6565
  $this->_categoryDefault_attribute_set_id = $row['default_attribute_set_id'];
6566
  }
6584
  WHERE entity_type_id = '" . $typeId . "'
6585
  ";
6586
  $result = $this->db_do($sql);
6587
+ while ($row = mysqli_fetch_assoc($result)) {
6588
  $this->_attributeId[$typeCode][$row['attribute_code']] = $row['attribute_id'];
6589
  }
6590
  }
6625
  WHERE
6626
  value='default-category'";
6627
  $res=$this->db_do($q);
6628
+ $row=mysqli_fetch_array($res);
6629
  if($row['entity_id']>0){
6630
  return $row['entity_id'];
6631
  }else{
6634
  WHERE parent_id=".$cat_id;
6635
  $quer=$this->db_do($q);
6636
  $count=0;
6637
+ while ($row=mysqli_fetch_array($quer)){
6638
  $count++;
6639
  $entity_id=$row['entity_id'];
6640
  }
6652
  $q='SHOW TABLES LIKE "'.Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_').'%"';
6653
  $quer=$this->db_do($q);
6654
  $result=false;
6655
+ While($row=mysqli_fetch_array($quer)){
6656
  if(is_array($row)){
6657
  $catalog_product_flat=array_pop($row);
6658
  $q='DELETE pf1 FROM '.$catalog_product_flat.' pf1
app/code/local/Bintime/Sinchimport/Model/System/Config/ServerList.php CHANGED
@@ -9,10 +9,13 @@ class Bintime_Sinchimport_Model_System_Config_ServerList
9
  public function toOptionArray()
10
  {
11
  $paramsArray = array(
12
- 'ftp.stockinthechannel.com' => 'UK(ftp.stockinthechannel.com)',
13
- 'ftpus.stockinthechannel.com' => 'USA(ftpus.stockinthechannel.com)',
 
 
 
 
14
  );
15
-
16
  return $paramsArray;
17
  }
18
  }
9
  public function toOptionArray()
10
  {
11
  $paramsArray = array(
12
+ 'ftp.stockinthechannel.com' => 'UK - ftp.stockinthechannel.com',
13
+ 'ftpus.stockinthechannel.com' => 'USA - ftpus.stockinthechannel.com',
14
+ 'ftp.canalstock.es' => 'Spain - ftp.canalstock.es',
15
+ 'ftp.canalstock.mx' => 'Mexico - ftp.canalstock.mx',
16
+ 'ftp.stockradar.be' => 'Belgium - ftp.stockradar.be',
17
+ 'ftpau.stockinthechannel.com' => 'Australia - ftpau.stockinthechannel.com',
18
  );
 
19
  return $paramsArray;
20
  }
21
  }
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-install-0.1.0.php CHANGED
@@ -4,12 +4,12 @@ $installer = $this;
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
- if (!mysql_select_db($config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
@@ -133,10 +133,10 @@ BEGIN
133
  END
134
  ";
135
 
136
- if (!mysql_query($query, $cnx)) {
137
  throw new Exception("Failed to create stored procedure");
138
  }
139
 
140
- mysql_close($cnx);
141
 
142
  $installer->endSetup();
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
133
  END
134
  ";
135
 
136
+ if (!mysqli_query($cnx, $query)) {
137
  throw new Exception("Failed to create stored procedure");
138
  }
139
 
140
+ mysqli_close($cnx);
141
 
142
  $installer->endSetup();
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.1-0.1.2.php CHANGED
@@ -5,20 +5,20 @@ stepan
5
  $installer = $this;
6
 
7
  $config = $installer->getConnection()->getConfig();
8
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
9
  if (!$cnx) {
10
  throw new Exception('Failed to connect to database.');
11
  }
12
 
13
- if (!mysql_select_db($config['dbname'])) {
14
  throw new Exception('Failed to select a database.');
15
  }
16
 
17
  $check_store_product_id=1;
18
  $check_sinch_product_id=1;
19
  $q="show columns from catalog_product_entity";
20
- $res=mysql_query($q);
21
- while($row=mysql_fetch_assoc($res)){
22
  if($row['Field']=='store_product_id'){
23
  $check_store_product_id=0;
24
  }elseif($row['Field']=='sinch_product_id'){
5
  $installer = $this;
6
 
7
  $config = $installer->getConnection()->getConfig();
8
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
9
  if (!$cnx) {
10
  throw new Exception('Failed to connect to database.');
11
  }
12
 
13
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
14
  throw new Exception('Failed to select a database.');
15
  }
16
 
17
  $check_store_product_id=1;
18
  $check_sinch_product_id=1;
19
  $q="show columns from catalog_product_entity";
20
+ $res=mysqli_query($cnx, $q);
21
+ while($row=mysqli_fetch_assoc($res)){
22
  if($row['Field']=='store_product_id'){
23
  $check_store_product_id=0;
24
  }elseif($row['Field']=='sinch_product_id'){
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.2-0.1.3.php CHANGED
@@ -4,12 +4,12 @@ $installer = $this;
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
- if (!mysql_select_db($config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
@@ -124,10 +124,10 @@ BEGIN
124
  END
125
  ";
126
 
127
- if (!mysql_query($query, $cnx)) {
128
  throw new Exception("Failed to create stored procedure");
129
  }
130
 
131
- mysql_close($cnx);
132
 
133
  $installer->endSetup();
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
124
  END
125
  ";
126
 
127
+ if (!mysqli_query($cnx, $query)) {
128
  throw new Exception("Failed to create stored procedure");
129
  }
130
 
131
+ mysqli_close($cnx);
132
 
133
  $installer->endSetup();
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.6-0.1.7.php CHANGED
@@ -4,12 +4,12 @@ $installer = $this;
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
- if (!mysql_select_db($config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
@@ -19,8 +19,8 @@ $installer->startSetup();
19
  $check_store_category_id=1;
20
  $check_parent_store_category_id=1;
21
  $q="show columns from catalog_category_entity";
22
- $res=mysql_query($q);
23
- while($row=mysql_fetch_assoc($res)){
24
  if($row['Field']=='store_category_id'){
25
  $check_store_category_id=0;
26
  }elseif($row['Field']=='parent_store_category_id'){
@@ -265,10 +265,10 @@ BEGIN
265
  END
266
  ";
267
 
268
- if (!mysql_query($query, $cnx)) {
269
  throw new Exception("Failed to create stored procedure");
270
  }
271
 
272
- mysql_close($cnx);
273
 
274
  $installer->endSetup();
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
19
  $check_store_category_id=1;
20
  $check_parent_store_category_id=1;
21
  $q="show columns from catalog_category_entity";
22
+ $res=mysqli_query($cnx, $q);
23
+ while($row=mysqli_fetch_assoc($res)){
24
  if($row['Field']=='store_category_id'){
25
  $check_store_category_id=0;
26
  }elseif($row['Field']=='parent_store_category_id'){
265
  END
266
  ";
267
 
268
+ if (!mysqli_query($cnx, $query)) {
269
  throw new Exception("Failed to create stored procedure");
270
  }
271
 
272
+ mysqli_close($cnx);
273
 
274
  $installer->endSetup();
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.1.7-0.1.8.php CHANGED
@@ -98,7 +98,7 @@ INSERT ".$installer->getTable('stINch_sinchcheck')."(caption, descr, check_code,
98
  'You are missing the MySQL stored procedure ".$installer->getTable('filter_icecat_products_s').".sql', 'You can recreate it by running the script found in [shop dir]/app/code/local/Bintime/Sinchimport/sql/ in PhpMyAdmin');
99
  ");
100
 
101
- mysql_close($cnx);
102
 
103
  $installer->endSetup();
104
 
98
  'You are missing the MySQL stored procedure ".$installer->getTable('filter_icecat_products_s').".sql', 'You can recreate it by running the script found in [shop dir]/app/code/local/Bintime/Sinchimport/sql/ in PhpMyAdmin');
99
  ");
100
 
101
+ mysqli_close($cnx);
102
 
103
  $installer->endSetup();
104
 
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.2.0-0.2.1.php CHANGED
@@ -98,7 +98,7 @@ INSERT ".$installer->getTable('stINch_sinchcheck')."(caption, descr, check_code,
98
  'You are missing the MySQL stored procedure ".$installer->getTable('filter_sinch_products_s').".sql', 'You can recreate it by running the script found in [shop dir]/app/code/local/Bintime/Sinchimport/sql/ in PhpMyAdmin');
99
  ");
100
 
101
- mysql_close($cnx);
102
 
103
  $installer->endSetup();
104
 
98
  'You are missing the MySQL stored procedure ".$installer->getTable('filter_sinch_products_s').".sql', 'You can recreate it by running the script found in [shop dir]/app/code/local/Bintime/Sinchimport/sql/ in PhpMyAdmin');
99
  ");
100
 
101
+ mysqli_close($cnx);
102
 
103
  $installer->endSetup();
104
 
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-0.2.1-0.2.2.php CHANGED
@@ -4,12 +4,12 @@ $installer = $this;
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
- if (!mysql_select_db($config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
@@ -221,10 +221,10 @@ BEGIN
221
  END
222
  ";
223
 
224
- if (!mysql_query($query, $cnx)) {
225
  throw new Exception("Failed to create stored procedure");
226
  }
227
 
228
- mysql_close($cnx);
229
 
230
  $installer->endSetup();
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
221
  END
222
  ";
223
 
224
+ if (!mysqli_query($cnx, $query)) {
225
  throw new Exception("Failed to create stored procedure");
226
  }
227
 
228
+ mysqli_close($cnx);
229
 
230
  $installer->endSetup();
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-3.0.0-3.0.1.php CHANGED
@@ -3,12 +3,12 @@ $installer = $this;
3
 
4
  //прямое подключение к базе необходимо для добавления хранимки
5
  $config = $installer->getConnection()->getConfig();
6
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
7
  if (!$cnx) {
8
  throw new Exception('Failed to connect to database.');
9
  }
10
 
11
- if (!mysql_select_db($config['dbname'])) {
12
  throw new Exception('Failed to select a database.');
13
  }
14
 
@@ -297,11 +297,11 @@ BEGIN
297
  END
298
  ";
299
 
300
- if (!mysql_query($query, $cnx)) {
301
  throw new Exception("Failed to create stored procedure".$query);
302
  }
303
 
304
 
305
- mysql_close($cnx);
306
 
307
  $installer->endSetup();
3
 
4
  //прямое подключение к базе необходимо для добавления хранимки
5
  $config = $installer->getConnection()->getConfig();
6
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
7
  if (!$cnx) {
8
  throw new Exception('Failed to connect to database.');
9
  }
10
 
11
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
12
  throw new Exception('Failed to select a database.');
13
  }
14
 
297
  END
298
  ";
299
 
300
+ if (!mysqli_query($cnx, $query)) {
301
  throw new Exception("Failed to create stored procedure".$query);
302
  }
303
 
304
 
305
+ mysqli_close($cnx);
306
 
307
  $installer->endSetup();
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-3.0.2-3.0.3.php CHANGED
@@ -4,12 +4,12 @@ $installer = $this;
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
- $cnx = mysql_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
- if (!mysql_select_db($config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
@@ -33,10 +33,10 @@ BEGIN
33
  END
34
  ";
35
 
36
- if (!mysql_query($query, $cnx)) {
37
  throw new Exception("Failed to create stored function");
38
  }
39
 
40
- mysql_close($cnx);
41
 
42
  $installer->endSetup();
4
 
5
  //прямое подключение к базе необходимо для добавления хранимки
6
  $config = $installer->getConnection()->getConfig();
7
+ $cnx = mysqli_connect($config['host'], $config['username'], $config['password']);
8
  if (!$cnx) {
9
  throw new Exception('Failed to connect to database.');
10
  }
11
 
12
+ if (!mysqli_select_db($cnx, $config['dbname'])) {
13
  throw new Exception('Failed to select a database.');
14
  }
15
 
33
  END
34
  ";
35
 
36
+ if (!mysqli_query($cnx, $query)) {
37
  throw new Exception("Failed to create stored function");
38
  }
39
 
40
+ mysqli_close($cnx);
41
 
42
  $installer->endSetup();
app/design/adminhtml/default/default/layout/sinchimport.xml CHANGED
@@ -1,57 +1,57 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
-
4
- <!-- To add a tab on edit product page -->
5
- <adminhtml_catalog_product_edit>
6
- <reference name="product_tabs">
7
- <action method="addTab">
8
- <name>sinch_distributors_tab</name>
9
- <block template="sinchimport/sinchdistributors.phtml">sinchimport/adminhtml_catalog_product_sinchdistributors</block>
10
- </action>
11
- </reference>
12
- </adminhtml_catalog_product_edit>
13
- <!-- To add a tab on edit product page -->
14
-
15
- <!-- Change -->
16
- <!--adminhtml_sales_order_view>
17
- <reference name="head">
18
- <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
19
- <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
20
- </reference>
21
- <reference name="content">
22
- <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
23
- </reference>
24
- <reference name="left">
25
- <block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
26
- <block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="sales/order/view/tab/info.phtml">
27
- <block type="adminhtml/sales_order_view_messages" name="order_messages"></block>
28
- <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
29
- <block type="adminhtml/sales_order_view_items" name="order_items" template="sales/order/view/items.phtml">
30
- <action method="addItemRender"><type>default</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>sales/order/view/items/renderer/default.phtml</template></action>
31
- <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
32
- <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sinchimport/sales/items/column/name.phtml</template></action>
33
- <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
34
- <block type="core/text_list" name="order_item_extra_info" />
35
- </block>
36
- <block type="adminhtml/sales_order_payment" name="order_payment"/>
37
- <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml"></block>
38
- <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
39
- <block type="adminhtml/sales_order_view_giftmessage" name="order_giftmessage" template="sales/order/view/giftmessa ge.phtml"></block>
40
- </block>
41
- <block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
42
- <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
43
- </block>
44
- </block>
45
- <action method="addTab"><name>order_info</name><block>order_tab_info</block></action>
46
- <action method="addTab"><name>order_invoices</name><block>adminhtml/sales_order_view_tab_invoices</block></action>
47
- <action method="addTab"><name>order_creditmemos</name><block>adminhtml/sales_order_view_tab_creditmemos</block></action>
48
- <action method="addTab"><name>order_shipments</name><block>adminhtml/sales_order_view_tab_shipments</block></action>
49
- <action method="addTab"><name>order_history</name><block>adminhtml/sales_order_view_tab_history</block></action>
50
- <action method="addTab"><name>order_transactions</name><block>adminhtml/sales_order_view_tab_transactions</block></action>
51
- </block>
52
- </reference>
53
- </adminhtml_sales_order_view-->
54
-
55
-
56
-
57
- </layout>
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+
4
+ <!-- To add a tab on edit product page -->
5
+ <adminhtml_catalog_product_edit>
6
+ <reference name="product_tabs">
7
+ <action method="addTab">
8
+ <name>sinch_distributors_tab</name>
9
+ <block template="sinchimport/sinchdistributors.phtml">sinchimport/adminhtml_catalog_product_sinchdistributors</block>
10
+ </action>
11
+ </reference>
12
+ </adminhtml_catalog_product_edit>
13
+ <!-- To add a tab on edit product page -->
14
+
15
+ <!-- Change -->
16
+ <adminhtml_sales_order_view>
17
+ <reference name="head">
18
+ <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
19
+ <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
20
+ </reference>
21
+ <reference name="content">
22
+ <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
23
+ </reference>
24
+ <reference name="left">
25
+ <block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
26
+ <block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="sales/order/view/tab/info.phtml">
27
+ <block type="adminhtml/sales_order_view_messages" name="order_messages"></block>
28
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
29
+ <block type="adminhtml/sales_order_view_items" name="order_items" template="sales/order/view/items.phtml">
30
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>sales/order/view/items/renderer/default.phtml</template></action>
31
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
32
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sinchimport/sales/items/column/name.phtml</template></action>
33
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
34
+ <block type="core/text_list" name="order_item_extra_info" />
35
+ </block>
36
+ <block type="adminhtml/sales_order_payment" name="order_payment"/>
37
+ <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml"></block>
38
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
39
+ <block type="adminhtml/sales_order_view_giftmessage" name="order_giftmessage" template="sales/order/view/giftmessa ge.phtml"></block>
40
+ </block>
41
+ <block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
42
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
43
+ </block>
44
+ </block>
45
+ <action method="addTab"><name>order_info</name><block>order_tab_info</block></action>
46
+ <action method="addTab"><name>order_invoices</name><block>adminhtml/sales_order_view_tab_invoices</block></action>
47
+ <action method="addTab"><name>order_creditmemos</name><block>adminhtml/sales_order_view_tab_creditmemos</block></action>
48
+ <action method="addTab"><name>order_shipments</name><block>adminhtml/sales_order_view_tab_shipments</block></action>
49
+ <action method="addTab"><name>order_history</name><block>adminhtml/sales_order_view_tab_history</block></action>
50
+ <action method="addTab"><name>order_transactions</name><block>adminhtml/sales_order_view_tab_transactions</block></action>
51
+ </block>
52
+ </reference>
53
+ </adminhtml_sales_order_view>
54
+
55
+
56
+
57
+ </layout>
app/design/adminhtml/default/default/template/sinchimport/sales/items/column/name.phtml CHANGED
@@ -1,70 +1,70 @@
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
22
- * @package default_default
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php
28
- /**
29
- * @see Mage_Adminhtml_Block_Sales_Items_Column_Name
30
- */
31
- ?>
32
-
33
- <?php if ($_item = $this->getItem()): ?>
34
- <h5 class="title">
35
- <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span>
36
- <span style="float:right"><a id="<?php echo $_product = "product_".$_item->getProduct()->getId()?>" >View Suppliers</a></span>
37
- <div style="position: relative; left: 200px; top: -25px; background: #EA7601; width: 300px" id="<?php echo $_offers = "offers_".$_item->getProduct()->getId()?>"><?php echo Mage::getModel('sinchimport/sinch')->getSinchDistribotorsTableHtml($_item->getProduct()->getId())?></div>
38
- </h5>
39
- <script type="text/javascript">
40
- $('<?php echo $_offers ?>').hide();
41
- $('<?php echo $_offers ?>').up().observe('mouseover', function(){$('<?php echo $_offers ?>').show();});
42
- $('<?php echo $_offers ?>').up().observe('mouseout', function(){$('<?php echo $_offers ?>').hide();});
43
- </script>
44
-
45
- <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div>
46
- <?php if ($this->getOrderOptions()): ?>
47
- <dl class="item-options">
48
- <?php foreach ($this->getOrderOptions() as $_option): ?>
49
- <dt><?php echo $_option['label'] ?></dt>
50
- <dd>
51
- <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
52
- <?php echo $this->getCustomizedOptionValue($_option); ?>
53
- <?php else: ?>
54
- <?php $_option = $this->getFormattedOption($_option['value']); ?>
55
- <?php echo $_option['value']; ?><?php if (isset($_option['remainder']) && $_option['remainder']): ?><span id="<?php echo $_dots = 'dots' . uniqid()?>"> ...</span><span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_option['remainder'] ?></span>
56
- <script type="text/javascript">
57
- $('<?php echo $_id ?>').hide();
58
- $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
59
- $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_dots?>').hide();});
60
- $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
61
- $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_dots ?>').show();});
62
- </script>
63
- <?php endif; ?>
64
- <?php endif; ?>
65
- </dd>
66
- <?php endforeach; ?>
67
- </dl>
68
- <?php endif; ?>
69
- <?php echo $this->htmlEscape($_item->getDescription()) ?>
70
- <?php endif; ?>
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
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Sales_Items_Column_Name
30
+ */
31
+ ?>
32
+
33
+ <?php if ($_item = $this->getItem()): ?>
34
+ <h5 class="title">
35
+ <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span>
36
+ <span style="float:right"><a id="<?php echo $_product = "product_".$_item->getProduct()->getId()?>" >View Suppliers</a></span>
37
+ <div style="position: relative; left: 200px; top: -25px; background: #EA7601; width: 300px" id="<?php echo $_offers = "offers_".$_item->getProduct()->getId()?>"><?php echo Mage::getModel('sinchimport/sinch')->getSinchDistribotorsTableHtml($_item->getProduct()->getId())?></div>
38
+ </h5>
39
+ <script type="text/javascript">
40
+ $('<?php echo $_offers ?>').hide();
41
+ $('<?php echo $_offers ?>').up().observe('mouseover', function(){$('<?php echo $_offers ?>').show();});
42
+ $('<?php echo $_offers ?>').up().observe('mouseout', function(){$('<?php echo $_offers ?>').hide();});
43
+ </script>
44
+
45
+ <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div>
46
+ <?php if ($this->getOrderOptions()): ?>
47
+ <dl class="item-options">
48
+ <?php foreach ($this->getOrderOptions() as $_option): ?>
49
+ <dt><?php echo $_option['label'] ?></dt>
50
+ <dd>
51
+ <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
52
+ <?php echo $this->getCustomizedOptionValue($_option); ?>
53
+ <?php else: ?>
54
+ <?php $_option = $this->getFormattedOption($_option['value']); ?>
55
+ <?php echo $_option['value']; ?><?php if (isset($_option['remainder']) && $_option['remainder']): ?><span id="<?php echo $_dots = 'dots' . uniqid()?>"> ...</span><span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_option['remainder'] ?></span>
56
+ <script type="text/javascript">
57
+ $('<?php echo $_id ?>').hide();
58
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
59
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_dots?>').hide();});
60
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
61
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_dots ?>').show();});
62
+ </script>
63
+ <?php endif; ?>
64
+ <?php endif; ?>
65
+ </dd>
66
+ <?php endforeach; ?>
67
+ </dl>
68
+ <?php endif; ?>
69
+ <?php echo $this->htmlEscape($_item->getDescription()) ?>
70
+ <?php endif; ?>
app/design/adminhtml/default/default/template/sinchimport/sinchdistributors.phtml CHANGED
@@ -1,13 +1,13 @@
1
-
2
- <div class="entry-edit">
3
- <div class="entry-edit-head">
4
- <h4 class="icon-head head-edit-form fieldset-legend">Suppliers</h4>
5
- </div>
6
- <div id="group_fields4" class="fieldset fieldset-wide">
7
- <div class="grid">
8
- <?php
9
- echo Mage::getModel('sinchimport/sinch')->getSinchDistribotorsTableHtml();
10
- ?>
11
- </div>
12
- </div>
13
- </div>
1
+
2
+ <div class="entry-edit">
3
+ <div class="entry-edit-head">
4
+ <h4 class="icon-head head-edit-form fieldset-legend">Suppliers</h4>
5
+ </div>
6
+ <div id="group_fields4" class="fieldset fieldset-wide">
7
+ <div class="grid">
8
+ <?php
9
+ echo Mage::getModel('sinchimport/sinch')->getSinchDistribotorsTableHtml();
10
+ ?>
11
+ </div>
12
+ </div>
13
+ </div>
app/design/frontend/default/default/layout/sinchimport.xml CHANGED
@@ -1,110 +1,110 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <sinchimport_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="/sinchimport/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="/sinchimport/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
- </sinchimport_product_view>
77
- <!--
78
- Compare products page
79
- -->
80
-
81
- <catalog_product_compare_index translate="label">
82
- <label>Catalog Product Compare List</label>
83
- <!-- Mage_Catalog -->
84
- <reference name="root">
85
- <action method="setTemplate"><template>page/popup.phtml</template></action>
86
- </reference>
87
- <reference name="head">
88
- <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
89
- <action method="addJs"><script>varien/product.js</script></action>
90
- </reference>
91
- <reference name="content">
92
- <block type="catalog/product_compare_list" name="sinch.catalog.compare.list" template="sinchimport/list.phtml"/>
93
- </reference>
94
- <reference name="content">
95
- <remove name="catalog.compare.list"/>
96
- </reference>
97
-
98
- </catalog_product_compare_index>
99
-
100
- <customer_account_index>
101
- <reference name="right">
102
- <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
103
- </reference>
104
- </customer_account_index>
105
-
106
- <!--
107
- Product view
108
- -->
109
-
110
- </layout>
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <sinchimport_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="/sinchimport/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="/sinchimport/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
+ </sinchimport_product_view>
77
+ <!--
78
+ Compare products page
79
+ -->
80
+
81
+ <catalog_product_compare_index translate="label">
82
+ <label>Catalog Product Compare List</label>
83
+ <!-- Mage_Catalog -->
84
+ <reference name="root">
85
+ <action method="setTemplate"><template>page/popup.phtml</template></action>
86
+ </reference>
87
+ <reference name="head">
88
+ <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
89
+ <action method="addJs"><script>varien/product.js</script></action>
90
+ </reference>
91
+ <reference name="content">
92
+ <block type="catalog/product_compare_list" name="sinch.catalog.compare.list" template="sinchimport/list.phtml"/>
93
+ </reference>
94
+ <reference name="content">
95
+ <remove name="catalog.compare.list"/>
96
+ </reference>
97
+
98
+ </catalog_product_compare_index>
99
+
100
+ <customer_account_index>
101
+ <reference name="right">
102
+ <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
103
+ </reference>
104
+ </customer_account_index>
105
+
106
+ <!--
107
+ Product view
108
+ -->
109
+
110
+ </layout>
app/design/frontend/default/default/template/sinchimport/list.phtml CHANGED
@@ -1,153 +1,153 @@
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
- <div class="page-head button-level">
28
- <h3><?php echo $this->__('Compare Products') ?></h3>
29
- <a href="#" class="link-print right" onclick="print();"><?php echo $this->__('Print This Page') ?></a>
30
- </div>
31
- <?php $_total=$this->getItems()->getSize() ?>
32
- <?php if($_total): ?>
33
- <div class="compare-products">
34
- <table cellspacing="0" class="data-table box-table catalog-listing" id="product_comparison">
35
- <?php if ($_total>2): ?>
36
- <tbody class="remove-buttons">
37
- <tr>
38
- <?php $_i=0 ?>
39
- <?php foreach($this->getItems() as $_item): ?>
40
- <?php if($_i++%10==0): ?>
41
- <td>&nbsp;</td>
42
- <?php endif; ?>
43
- <td><a href="#" onclick="setLocation('<?php echo $this->helper('catalog/product_compare')->getRemoveUrl($_item) ?>');window.opener.location.reload();"><img src="<?php echo $this->getSkinUrl('images/chart_remove.gif') ?>" alt="<?php echo $this->__('Remove Product') ?>" /></a></td>
44
- <?php endforeach; ?>
45
- </tr>
46
- </tbody>
47
- <?php endif ?>
48
- <tbody>
49
- <tr class="first">
50
- <?php $_i=0 ?>
51
- <?php foreach($this->getItems() as $_item): ?>
52
- <?php if($_i++%10==0): ?>
53
- <td class="label">&nbsp;</td>
54
- <?php endif; ?>
55
- <td>
56
- <a href="#" onclick="setPLocation('<?php echo $_item->getProductUrl() ?>', true)" title="<?php echo $this->htmlEscape($_item->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
57
- <h5><a href="#" onclick="setPLocation('<?php echo $_item->getProductUrl() ?>', true)" title="<?php echo $this->htmlEscape($_item->getName()) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></h5>
58
- <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
59
- <?php echo $this->getPriceHtml($_item, true) ?>
60
- <?php if($_item->isSaleable()): ?>
61
- <button class="form-button" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><?php echo $this->__('Add to Cart') ?></span></button><br/>
62
- <?php else: ?>
63
- <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
64
- <?php endif; ?>
65
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
66
- <a href="#" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToWishlistUrl($_item) ?>', true)" class="link-cart"><small><?php echo $this->__('Add to Wishlist') ?></small></a>
67
- <?php endif; ?>
68
- </td>
69
- <?php endforeach; ?>
70
- </tr>
71
- </tbody>
72
- <tbody>
73
- <?php /**************************************************** Sinch attributes ****************************************/ ?>
74
- <?php $prod_attributes=$this->getSinchAttributes(); ?>
75
- <?php foreach ($prod_attributes as $_attribute): ?>
76
-
77
- <?php if($this->getSinchAttributeName($_attribute)) : ?>
78
- <tr>
79
- <?php $countItems = 0; ?>
80
- <?php $_i=0; ?>
81
-
82
- <?php foreach($this->getItems() as $_item) : ?>
83
- <?php if ($this->getSinchProductAttributeValue($_item, $_attribute)) : $countItems++; endif; ?>
84
- <?php endforeach; // Items (for count number) ?>
85
- <?php foreach($this->getItems() as $_item) : ?>
86
- <?php if ($countItems > 0 ) : ?>
87
- <?php if($_i++%10==0): ?><td class="label"><?php echo $this->getSinchAttributeName($_attribute) ?></td><?php endif; ?>
88
- <td>
89
- <?php echo nl2br($this->getSinchProductAttributeValue($_item, $_attribute))."&nbsp;"; //.var_dump($this->getSinchProductAttributeValue($_item, $_attribute)); ?>
90
- </td>
91
- <?php endif; //AttributeValue ?>
92
-
93
- <?php endforeach; // Items ?>
94
- </tr>
95
- <?php endif; //AttributeName ?>
96
-
97
- <?php endforeach; ?>
98
- <?php /**************************************************** End Sinch attributes ****************************************/ ?>
99
-
100
- <?php /* foreach ($this->getAttributes() as $_attribute): ?>
101
- <tr>
102
- <?php $_i=0 ?>
103
- <?php foreach($this->getItems() as $_item): ?>
104
- <?php if($_i++%10==0): ?>
105
- <td class="label"><?php echo $this->__($_attribute->getFrontendLabel()) ?><? //echo " "; print_r($_attribute->getFrontendLabel()); ?></td>
106
- <?php endif; ?>
107
- <td>
108
- <?php switch ($_attribute->getAttributeCode()) {
109
- case "price": ?>
110
- <?php echo $this->getPriceHtml($_item, true) ?>
111
- <?php break;
112
- case "small_image": ?>
113
- <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
114
- <?php break;
115
- default: ?>
116
- <?php echo nl2br($this->getProductAttributeValue($_item, $_attribute)) ?>
117
- <?php break;
118
- } ?>
119
- </td>
120
- <?php endforeach; ?>
121
- </tr>
122
- <?php endforeach; */ ?>
123
- </tbody>
124
- <tbody class="attribute-cart">
125
- <tr>
126
- <?php $_i=0 ?>
127
- <?php foreach($this->getItems() as $_item): ?>
128
- <?php if($_i++%10==0): ?>
129
- <td class="label">&nbsp;</td>
130
- <?php endif; ?>
131
- <td>
132
- <?php echo $this->getPriceHtml($_item, true) ?>
133
- <?php if($_item->isSaleable()): ?>
134
- <button class="form-button" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><?php echo $this->__('Add to Cart') ?></span></button><br/>
135
- <?php else: ?>
136
- <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
137
- <?php endif; ?>
138
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
139
- <a href="#" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToWishlistUrl($_item) ?>', true)" class="link-cart"><small><?php echo $this->__('Add to Wishlist') ?></small></a>
140
- <?php endif; ?>
141
- </td>
142
- <?php endforeach; ?>
143
- </tr>
144
- </tbody>
145
- </table>
146
- <div class="button-set">
147
- <button class="form-button" onclick="window.close();"><span><?php echo $this->__('Close Window') ?></span></button>
148
- </div>
149
- </div>
150
- <script type="text/javascript">decorateTable('product_comparison');</script>
151
- <?php else: ?>
152
- <script type="text/javascript">window.close();</script>
153
- <?php endif; ?>
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
+ <div class="page-head button-level">
28
+ <h3><?php echo $this->__('Compare Products') ?></h3>
29
+ <a href="#" class="link-print right" onclick="print();"><?php echo $this->__('Print This Page') ?></a>
30
+ </div>
31
+ <?php $_total=$this->getItems()->getSize() ?>
32
+ <?php if($_total): ?>
33
+ <div class="compare-products">
34
+ <table cellspacing="0" class="data-table box-table catalog-listing" id="product_comparison">
35
+ <?php if ($_total>2): ?>
36
+ <tbody class="remove-buttons">
37
+ <tr>
38
+ <?php $_i=0 ?>
39
+ <?php foreach($this->getItems() as $_item): ?>
40
+ <?php if($_i++%10==0): ?>
41
+ <td>&nbsp;</td>
42
+ <?php endif; ?>
43
+ <td><a href="#" onclick="setLocation('<?php echo $this->helper('catalog/product_compare')->getRemoveUrl($_item) ?>');window.opener.location.reload();"><img src="<?php echo $this->getSkinUrl('images/chart_remove.gif') ?>" alt="<?php echo $this->__('Remove Product') ?>" /></a></td>
44
+ <?php endforeach; ?>
45
+ </tr>
46
+ </tbody>
47
+ <?php endif ?>
48
+ <tbody>
49
+ <tr class="first">
50
+ <?php $_i=0 ?>
51
+ <?php foreach($this->getItems() as $_item): ?>
52
+ <?php if($_i++%10==0): ?>
53
+ <td class="label">&nbsp;</td>
54
+ <?php endif; ?>
55
+ <td>
56
+ <a href="#" onclick="setPLocation('<?php echo $_item->getProductUrl() ?>', true)" title="<?php echo $this->htmlEscape($_item->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
57
+ <h5><a href="#" onclick="setPLocation('<?php echo $_item->getProductUrl() ?>', true)" title="<?php echo $this->htmlEscape($_item->getName()) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></h5>
58
+ <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?>
59
+ <?php echo $this->getPriceHtml($_item, true) ?>
60
+ <?php if($_item->isSaleable()): ?>
61
+ <button class="form-button" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><?php echo $this->__('Add to Cart') ?></span></button><br/>
62
+ <?php else: ?>
63
+ <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
64
+ <?php endif; ?>
65
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
66
+ <a href="#" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToWishlistUrl($_item) ?>', true)" class="link-cart"><small><?php echo $this->__('Add to Wishlist') ?></small></a>
67
+ <?php endif; ?>
68
+ </td>
69
+ <?php endforeach; ?>
70
+ </tr>
71
+ </tbody>
72
+ <tbody>
73
+ <?php /**************************************************** Sinch attributes ****************************************/ ?>
74
+ <?php $prod_attributes=$this->getSinchAttributes(); ?>
75
+ <?php foreach ($prod_attributes as $_attribute): ?>
76
+
77
+ <?php if($this->getSinchAttributeName($_attribute)) : ?>
78
+ <tr>
79
+ <?php $countItems = 0; ?>
80
+ <?php $_i=0; ?>
81
+
82
+ <?php foreach($this->getItems() as $_item) : ?>
83
+ <?php if ($this->getSinchProductAttributeValue($_item, $_attribute)) : $countItems++; endif; ?>
84
+ <?php endforeach; // Items (for count number) ?>
85
+ <?php foreach($this->getItems() as $_item) : ?>
86
+ <?php if ($countItems > 0 ) : ?>
87
+ <?php if($_i++%10==0): ?><td class="label"><?php echo $this->getSinchAttributeName($_attribute) ?></td><?php endif; ?>
88
+ <td>
89
+ <?php echo nl2br($this->getSinchProductAttributeValue($_item, $_attribute))."&nbsp;"; //.var_dump($this->getSinchProductAttributeValue($_item, $_attribute)); ?>
90
+ </td>
91
+ <?php endif; //AttributeValue ?>
92
+
93
+ <?php endforeach; // Items ?>
94
+ </tr>
95
+ <?php endif; //AttributeName ?>
96
+
97
+ <?php endforeach; ?>
98
+ <?php /**************************************************** End Sinch attributes ****************************************/ ?>
99
+
100
+ <?php /* foreach ($this->getAttributes() as $_attribute): ?>
101
+ <tr>
102
+ <?php $_i=0 ?>
103
+ <?php foreach($this->getItems() as $_item): ?>
104
+ <?php if($_i++%10==0): ?>
105
+ <td class="label"><?php echo $this->__($_attribute->getFrontendLabel()) ?><? //echo " "; print_r($_attribute->getFrontendLabel()); ?></td>
106
+ <?php endif; ?>
107
+ <td>
108
+ <?php switch ($_attribute->getAttributeCode()) {
109
+ case "price": ?>
110
+ <?php echo $this->getPriceHtml($_item, true) ?>
111
+ <?php break;
112
+ case "small_image": ?>
113
+ <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(125, 125); ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
114
+ <?php break;
115
+ default: ?>
116
+ <?php echo nl2br($this->getProductAttributeValue($_item, $_attribute)) ?>
117
+ <?php break;
118
+ } ?>
119
+ </td>
120
+ <?php endforeach; ?>
121
+ </tr>
122
+ <?php endforeach; */ ?>
123
+ </tbody>
124
+ <tbody class="attribute-cart">
125
+ <tr>
126
+ <?php $_i=0 ?>
127
+ <?php foreach($this->getItems() as $_item): ?>
128
+ <?php if($_i++%10==0): ?>
129
+ <td class="label">&nbsp;</td>
130
+ <?php endif; ?>
131
+ <td>
132
+ <?php echo $this->getPriceHtml($_item, true) ?>
133
+ <?php if($_item->isSaleable()): ?>
134
+ <button class="form-button" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToCartUrl($_item) ?>', true)"><span><?php echo $this->__('Add to Cart') ?></span></button><br/>
135
+ <?php else: ?>
136
+ <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
137
+ <?php endif; ?>
138
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
139
+ <a href="#" onclick="setPLocation('<?php echo $this->helper('catalog/product_compare')->getAddToWishlistUrl($_item) ?>', true)" class="link-cart"><small><?php echo $this->__('Add to Wishlist') ?></small></a>
140
+ <?php endif; ?>
141
+ </td>
142
+ <?php endforeach; ?>
143
+ </tr>
144
+ </tbody>
145
+ </table>
146
+ <div class="button-set">
147
+ <button class="form-button" onclick="window.close();"><span><?php echo $this->__('Close Window') ?></span></button>
148
+ </div>
149
+ </div>
150
+ <script type="text/javascript">decorateTable('product_comparison');</script>
151
+ <?php else: ?>
152
+ <script type="text/javascript">window.close();</script>
153
+ <?php endif; ?>
app/design/frontend/default/default/template/sinchimport/media.phtml CHANGED
@@ -1,89 +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('sinchimport/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; ?>
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('sinchimport/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/design/frontend/default/default/template/sinchimport/view.phtml CHANGED
@@ -1,363 +1,363 @@
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
- $_catIds = $_product->getCategoryIds();
38
- $_catId = $_catIds[0];
39
-
40
- $_productDescriptionHelper = $this->helper('sinchimport/getdata')->getProductDescription($_product);
41
- $message = $_productDescriptionHelper->getError();
42
- if ($message){
43
- $this->getMessagesBlock()->addError($_productDescriptionHelper->getError());
44
- }
45
- $specificationArray = $_productDescriptionHelper->getProductDescriptionList();
46
- $sinchSpecification=$_productDescriptionHelper->getProductSpecifications();
47
- $relatedProductsList = $_productDescriptionHelper->getRelatedProducts();
48
- // echo "related= ".$_productDescriptionHelper->getVendor();
49
- ?>
50
- <script type="text/javascript">
51
- var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
52
- </script>
53
- <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
54
- <div style="display:none"><?php $message=$_productDescriptionHelper->hasSystemError(); if ($message){ echo $message; } ?></div>
55
- <div class="product-info-box product-view">
56
- <div class="product-essential">
57
- <form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
58
-
59
- <div class="product-img-box">
60
- <?php echo $this->getChildHtml('media'); ?>
61
- </div>
62
-
63
- <div class="product-shop">
64
- <?php if (!$_productDescriptionHelper->hasError()) : ?>
65
- <h3 class="product-name"><?php echo $_productDescriptionHelper->getProductName()?></h3>
66
- <?php else :?>
67
- <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name')?></h1>
68
- <?php endif;?>
69
- <?php if ($this->canEmailToFriend()): ?>
70
- <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a><br />
71
- <?php endif; ?>
72
-
73
- <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
74
-
75
- <fieldset class="no-display">
76
- <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
77
- <input type="hidden" name="related_product" id="related-products-field" value="" />
78
- </fieldset>
79
- <?php if (!$_productDescriptionHelper->hasError()):?>
80
- <div><b><?php echo $this->helper('sinchimport/getdata')->__('Brand:')?></b><?php echo $_productDescriptionHelper->getVendor();?></div>
81
- <div><b><?php echo $this->helper('sinchimport/getdata')->__('Product code:')?></b><?php echo $_productDescriptionHelper->getMPN();?></div>
82
- <div><b><?php echo $this->helper('sinchimport/getdata')->__('EAN/UPC code:')?></b><?php echo $_productDescriptionHelper->getEAN();?></div>
83
- <div><b><?php echo $this->helper('sinchimport/getdata')->__('Category:')?></b><?php echo Mage::getModel('catalog/category')->load($_catId)->getName()?></div>
84
- <?php endif;?>
85
- <?php echo $this->getChildHtml('alert_urls') ?>
86
- <?php echo $this->getChildHtml('product_type_data') ?>
87
- <?php echo $this->getTierPriceHtml() ?>
88
-
89
- <?php if (!$this->hasOptions()):?>
90
- <div class="add-to-holder">
91
- <?php if($_product->isSaleable()): ?>
92
- <?php echo $this->getChildHtml('addtocart') ?>
93
- <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
94
- <span class="add-or"><?php echo $this->__('OR') ?></span>
95
- <?php endif; ?>
96
- <?php endif; ?>
97
- <?php echo $this->getChildHtml('addto') ?>
98
- </div>
99
- <?php else:?>
100
- <?php echo $this->getChildHtml('addto') ?>
101
- <?php endif; ?>
102
-
103
- <?php if ($_product->getShortDescription() && $_productDescriptionHelper->hasError()):?>
104
- <div class="short-description">
105
- <h2><?php echo $this->__('Quick Overview') ?></h2>
106
- <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
107
- </div>
108
- <?php else :?>
109
- <div class="divider"></div>
110
- <?php endif;?>
111
-
112
-
113
- <?php echo $this->getChildHtml('other');?>
114
- <?php if ($_product->isSaleable() && $this->hasOptions()):?>
115
- <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
116
- <?php endif;?>
117
-
118
- </div>
119
- <div class="clear"></div>
120
- <?php if ($_product->isSaleable() && $this->hasOptions()):?>
121
- <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
122
- <?php endif;?>
123
- </form>
124
- <script type="text/javascript">
125
- var productAddToCartForm = new VarienForm('product_addtocart_form');
126
- productAddToCartForm.submit = function(){
127
- if (this.validator.validate()) {
128
- this.form.submit();
129
- }
130
- }.bind(productAddToCartForm);
131
-
132
- function changeTab(id){
133
- for(var i=0;i<4;i++){
134
- var tab_cont = (document.getElementById) ? document.getElementById("tab_cont_"+i) : eval('document.all["tab_cont_'+i+'"]');
135
- var tab = (document.getElementById) ? document.getElementById("tab_"+i) : eval('document.all["tab_'+i+'"]');
136
-
137
- if (tab_cont!=null && tab!=null) {
138
- if(i==id){
139
- tab_cont.style.display="";
140
- tab.className="prod_doc_tab_div_sel";
141
- } else {
142
- tab_cont.style.display="none";
143
- tab.className="prod_doc_tab_div";
144
- }
145
- }
146
- }
147
- }
148
- </script>
149
- </div>
150
- <?php if (!$_productDescriptionHelper->hasError()) : ?>
151
- <div class="description_b">
152
- <div class="short_product_description"><?php echo $_productDescriptionHelper->getShortProductDescription() ?></div>
153
- <?php
154
- if (strlen($_productDescriptionHelper->getFullProductDescription())>450){
155
- $firstPart = str_replace("\\n", "<br>", substr($_productDescriptionHelper->getFullProductDescription(), 0, 400));
156
- $space = strrpos($firstPart, " ");
157
- $dot = strrpos($firstPart, ".");
158
- $column = strrpos($firstPart, ",");
159
- $spanTagStart = strrpos($firstPart, "<span");
160
- $spanTagEND = strrpos($firstPart, "</span>");
161
-
162
- if ($space-5>$dot && $space-5>$column){
163
- $firstPart = substr($firstPart, 0, $space);
164
- }
165
- else{
166
- $firstPart = $column > $dot ? substr($firstPart, 0, $column) : substr($firstPart, 0, $dot);
167
- }
168
- if ((int)$spanTagEND<$spanTagStart){
169
- $firstPart = substr($firstPart, 0, $spanTagStart);
170
- }
171
-
172
- }
173
-
174
- ?>
175
- <div class="product_description">
176
- <?php if (isset($firstPart)):?>
177
- <span id="more_link"><?php echo $firstPart." "?>... <a class="more_link" href="javascript: showMore();"><?php echo htmlentities(' More>>>')?></a></span>
178
- <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>
179
- <?php else: ?>
180
- <span><?php echo str_replace("\\n", "<br>", $_productDescriptionHelper->getFullProductDescription());?></span>
181
- <?php endif?>
182
- </div >
183
- </div>
184
- <?php endif;?>
185
- <div class="product-collateral">
186
- <?php if ($_productDescriptionHelper->hasError()) :?>
187
- <?php echo $this->getChildHtml('description') ?>
188
- <?php else :
189
- $tab_class0=$tab_class1=$tab_class2=$tab_class3='prod_doc_tab_div';
190
- $data_tab_style0=$data_tab_style1=$data_tab_style2=$data_tab_style3="display:none";
191
- if($sinchSpecification || $sinchSpecification!=''){
192
- $tab_class0='prod_doc_tab_div_sel';
193
- $data_tab_style0='';
194
- }elseif(!empty($specificationArray)){
195
- $tab_class1='prod_doc_tab_div_sel';
196
- $data_tab_style1='';
197
- }elseif($_catId && array_key_exists($_catId, $relatedProductsList)){
198
- $tab_class2='prod_doc_tab_div_sel';
199
- $data_tab_style2='';
200
- }elseif(!empty($relatedProductsList)){
201
- $tab_class3='prod_doc_tab_div_sel';
202
- $data_tab_style3='';
203
- }
204
- ?>
205
- <? if(false): ?>
206
- <table cellspacing="0" cellpadding="0" width="100%">
207
- <tr>
208
- <td>
209
- <table cellspacing="0" cellpadding="0" class="prod_doc_tabs_row">
210
- <tr>
211
- <td class="prod_doc_tabs_space">&nbsp;</td>
212
- <?php if ($sinchSpecification || $sinchSpecification!=''):?>
213
- <td class="prod_doc_tab"><div id="tab_0" class="<?php echo $tab_class0 ?>" onclick="changeTab(0)"><?php echo $this->helper('sinchimport/getdata')->__('Specification') ?></div></td>
214
- <?php endif?>
215
- <?php if (!empty($specificationArray)):?>
216
- <td class="prod_doc_tab"><div id="tab_1" class="<?php echo $tab_class1 ?>" onclick="changeTab(1)"><?php echo $this->helper('sinchimport/getdata')->__('Star features') ?></div></td>
217
- <?php endif?>
218
- <?php if ($_catId && array_key_exists($_catId, $relatedProductsList)):?>
219
- <td class="prod_doc_tab"><div id="tab_2" class="prod_doc_tab_div" onclick="changeTab(2)"><?php echo $this->helper('sinchimport/getdata')->__('Alternatives') ?></div></td>
220
- <?php endif?>
221
- <?php if (!empty($relatedProductsList)):?>
222
- <td class="prod_doc_tab"><div id="tab_3" class="prod_doc_tab_div" onclick="changeTab(3)"><?php echo $this->helper('sinchimport/getdata')->__('Options') ?></div></td>
223
- <?php endif?>
224
- <td class="prod_doc_tabs_space" style="width:auto!important">&nbsp;</td>
225
- </tr>
226
- </table>
227
- </td>
228
- </tr>
229
- <tr>
230
- <td>
231
- <table cellspacing="0" cellpadding="2" class="prod_doc_content">
232
- <tr>
233
- <td class="prod_doc_content_cell">
234
- <!-- ZERO TAB's CONTENT (VISIBLE BY DEFAULT) -->
235
- <table id="tab_cont_0" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style0; ?>">
236
- <tr>
237
- <td width="50%" valign="top">
238
- <table cellspacing="0" cellpadding="2" class="prod_doc_table">
239
- <tr><td>
240
- <?php echo $sinchSpecification; ?>
241
- </td></tr>
242
- </table>
243
- </td>
244
- </tr>
245
- </table>
246
-
247
- <!-- FIRST TAB's CONTENT (VISIBLE BY DEFAULT) -->
248
- <table id="tab_cont_1" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style1; ?>">
249
- <tr>
250
- <td width="50%" valign="top">
251
- <table cellspacing="0" cellpadding="2" class="prod_doc_table">
252
-
253
- <?php foreach($specificationArray as $key => $value):?>
254
- <tr>
255
- <td colspan="2" class="prod_doc_item_head"><?php echo $key?></td>
256
- <td class="prod_doc_item_descr"><?php if($value == "Y"){
257
- echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/yes.gif"/>';
258
- }
259
- else if ($value == "N"){
260
- echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/no.gif"/>';
261
- }
262
- else{
263
- echo str_replace("\\n", "<br>",$value);
264
- }
265
- ?></td>
266
- </tr>
267
- <?php endforeach;?>
268
- </table>
269
- </td>
270
- </tr>
271
- </table>
272
- <!-- SECOND TAB's CONTENT (HIDDEN BY DEFAULT) -->
273
- <table id="tab_cont_2" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style2; ?>">
274
- <tr>
275
- <td>
276
- <table cellspacing="1" cellpadding="5" class="prod_alt_table" width="100%" >
277
- <tr>
278
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Brand') ?></td>
279
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Image') ?></td>
280
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Article code') ?></td>
281
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Product name') ?></td>
282
- </tr>
283
- <?php if ($_catId && array_key_exists($_catId, $relatedProductsList)):?>
284
- <?php foreach($relatedProductsList[$_catId] as $product):?>
285
- <tr>
286
- <?php if($product['supplier_thumb']&&($product['supplier_thumb']!='')): ?>
287
- <td><img src="<?php echo $product['supplier_thumb']?>" /></td>
288
- <?php else :?>
289
- <td><?php echo $product['supplier_name']?></td>
290
- <?php endif ?>
291
- <td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
292
- <td><?php echo $product['mpn']?></td>
293
- <td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
294
- </tr>
295
- <?php endforeach?>
296
- <?php else: ?>
297
- <tr><td></>No Alternative proposals for Current product avaible</td></tr>
298
- <?php endif?>
299
- </table>
300
- </td>
301
- </tr>
302
- </table>
303
- <!-- THIRD TAB's CONTENT (HIDDEN BY DEFAULT) -->
304
- <table id="tab_cont_3" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style3; ?>">
305
- <tr>
306
- <td>
307
-
308
- <table cellspacing="1" cellpadding="5" width="100%" class="prod_alt_table">
309
- <tr>
310
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Brand') ?></td>
311
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Image') ?></td>
312
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Article code') ?></td>
313
- <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Product name') ?></td>
314
- </tr>
315
- <?php if (!empty($relatedProductsList)):?>
316
- <?php foreach($relatedProductsList as $categoryId => $productsArray):?>
317
- <?php if ($categoryId == $_catId){
318
- continue;
319
- }?>
320
- <?php if (!is_string($categoryId)):?>
321
- <tr>
322
- <td class="prod_doc_item_head2" colspan="4"><?php echo is_string($categoryId)? '' : Mage::getSingleton('catalog/category')->load($categoryId)->getName() ?></td>
323
-
324
- </tr>
325
- <?php endif?>
326
- <?php foreach($productsArray as $product):?>
327
- <tr>
328
- <?php if($product['supplier_thumb']&&($product['supplier_thumb']!='')): ?>
329
- <td><img src="<?php echo $product['supplier_thumb']?>" /></td>
330
- <?php else :?>
331
- <td><?php echo $product['supplier_name']?></td>
332
- <?php endif ?>
333
- <td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
334
- <td><?php echo $product['mpn']?></td>
335
- <td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
336
- </tr>
337
- <?php endforeach ?>
338
- <?php endforeach ?>
339
- <?php else: ?>
340
- <tr><td></>No Related proposals for Current product avaible</td></tr>
341
- <?php endif?>
342
- </table>
343
- </td>
344
- </tr>
345
- </table>
346
- <!-- EOF -->
347
- </td>
348
- </tr>
349
- </table>
350
- <?php endif; ?>
351
- </td>
352
- </tr>
353
- </table>
354
- <?php endif;?>
355
- <?php if ($_additional = $this->getChildHtml('additional')):?>
356
- <div class="collateral-box">
357
- <?php echo $_additional ?>
358
- </div>
359
- <?php endif;?>
360
- <?php echo $this->getChildHtml('upsell_products') ?>
361
- <?php echo $this->getChildHtml('product_additional_data') ?>
362
- </div>
363
- </div>
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
+ $_catIds = $_product->getCategoryIds();
38
+ $_catId = $_catIds[0];
39
+
40
+ $_productDescriptionHelper = $this->helper('sinchimport/getdata')->getProductDescription($_product);
41
+ $message = $_productDescriptionHelper->getError();
42
+ if ($message){
43
+ $this->getMessagesBlock()->addError($_productDescriptionHelper->getError());
44
+ }
45
+ $specificationArray = $_productDescriptionHelper->getProductDescriptionList();
46
+ $sinchSpecification=$_productDescriptionHelper->getProductSpecifications();
47
+ $relatedProductsList = $_productDescriptionHelper->getRelatedProducts();
48
+ // echo "related= ".$_productDescriptionHelper->getVendor();
49
+ ?>
50
+ <script type="text/javascript">
51
+ var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
52
+ </script>
53
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
54
+ <div style="display:none"><?php $message=$_productDescriptionHelper->hasSystemError(); if ($message){ echo $message; } ?></div>
55
+ <div class="product-info-box product-view">
56
+ <div class="product-essential">
57
+ <form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
58
+
59
+ <div class="product-img-box">
60
+ <?php echo $this->getChildHtml('media'); ?>
61
+ </div>
62
+
63
+ <div class="product-shop">
64
+ <?php if (!$_productDescriptionHelper->hasError()) : ?>
65
+ <h3 class="product-name"><?php echo $_productDescriptionHelper->getProductName()?></h3>
66
+ <?php else :?>
67
+ <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name')?></h1>
68
+ <?php endif;?>
69
+ <?php if ($this->canEmailToFriend()): ?>
70
+ <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a><br />
71
+ <?php endif; ?>
72
+
73
+ <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
74
+
75
+ <fieldset class="no-display">
76
+ <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
77
+ <input type="hidden" name="related_product" id="related-products-field" value="" />
78
+ </fieldset>
79
+ <?php if (!$_productDescriptionHelper->hasError()):?>
80
+ <div><b><?php echo $this->helper('sinchimport/getdata')->__('Brand:')?></b><?php echo $_productDescriptionHelper->getVendor();?></div>
81
+ <div><b><?php echo $this->helper('sinchimport/getdata')->__('Product code:')?></b><?php echo $_productDescriptionHelper->getMPN();?></div>
82
+ <div><b><?php echo $this->helper('sinchimport/getdata')->__('EAN/UPC code:')?></b><?php echo $_productDescriptionHelper->getEAN();?></div>
83
+ <div><b><?php echo $this->helper('sinchimport/getdata')->__('Category:')?></b><?php echo Mage::getModel('catalog/category')->load($_catId)->getName()?></div>
84
+ <?php endif;?>
85
+ <?php echo $this->getChildHtml('alert_urls') ?>
86
+ <?php echo $this->getChildHtml('product_type_data') ?>
87
+ <?php echo $this->getTierPriceHtml() ?>
88
+
89
+ <?php if (!$this->hasOptions()):?>
90
+ <div class="add-to-holder">
91
+ <?php if($_product->isSaleable()): ?>
92
+ <?php echo $this->getChildHtml('addtocart') ?>
93
+ <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
94
+ <span class="add-or"><?php echo $this->__('OR') ?></span>
95
+ <?php endif; ?>
96
+ <?php endif; ?>
97
+ <?php echo $this->getChildHtml('addto') ?>
98
+ </div>
99
+ <?php else:?>
100
+ <?php echo $this->getChildHtml('addto') ?>
101
+ <?php endif; ?>
102
+
103
+ <?php if ($_product->getShortDescription() && $_productDescriptionHelper->hasError()):?>
104
+ <div class="short-description">
105
+ <h2><?php echo $this->__('Quick Overview') ?></h2>
106
+ <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
107
+ </div>
108
+ <?php else :?>
109
+ <div class="divider"></div>
110
+ <?php endif;?>
111
+
112
+
113
+ <?php echo $this->getChildHtml('other');?>
114
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
115
+ <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
116
+ <?php endif;?>
117
+
118
+ </div>
119
+ <div class="clear"></div>
120
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
121
+ <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
122
+ <?php endif;?>
123
+ </form>
124
+ <script type="text/javascript">
125
+ var productAddToCartForm = new VarienForm('product_addtocart_form');
126
+ productAddToCartForm.submit = function(){
127
+ if (this.validator.validate()) {
128
+ this.form.submit();
129
+ }
130
+ }.bind(productAddToCartForm);
131
+
132
+ function changeTab(id){
133
+ for(var i=0;i<4;i++){
134
+ var tab_cont = (document.getElementById) ? document.getElementById("tab_cont_"+i) : eval('document.all["tab_cont_'+i+'"]');
135
+ var tab = (document.getElementById) ? document.getElementById("tab_"+i) : eval('document.all["tab_'+i+'"]');
136
+
137
+ if (tab_cont!=null && tab!=null) {
138
+ if(i==id){
139
+ tab_cont.style.display="";
140
+ tab.className="prod_doc_tab_div_sel";
141
+ } else {
142
+ tab_cont.style.display="none";
143
+ tab.className="prod_doc_tab_div";
144
+ }
145
+ }
146
+ }
147
+ }
148
+ </script>
149
+ </div>
150
+ <?php if (!$_productDescriptionHelper->hasError()) : ?>
151
+ <div class="description_b">
152
+ <div class="short_product_description"><?php echo $_productDescriptionHelper->getShortProductDescription() ?></div>
153
+ <?php
154
+ if (strlen($_productDescriptionHelper->getFullProductDescription())>450){
155
+ $firstPart = str_replace("\\n", "<br>", substr($_productDescriptionHelper->getFullProductDescription(), 0, 400));
156
+ $space = strrpos($firstPart, " ");
157
+ $dot = strrpos($firstPart, ".");
158
+ $column = strrpos($firstPart, ",");
159
+ $spanTagStart = strrpos($firstPart, "<span");
160
+ $spanTagEND = strrpos($firstPart, "</span>");
161
+
162
+ if ($space-5>$dot && $space-5>$column){
163
+ $firstPart = substr($firstPart, 0, $space);
164
+ }
165
+ else{
166
+ $firstPart = $column > $dot ? substr($firstPart, 0, $column) : substr($firstPart, 0, $dot);
167
+ }
168
+ if ((int)$spanTagEND<$spanTagStart){
169
+ $firstPart = substr($firstPart, 0, $spanTagStart);
170
+ }
171
+
172
+ }
173
+
174
+ ?>
175
+ <div class="product_description">
176
+ <?php if (isset($firstPart)):?>
177
+ <span id="more_link"><?php echo $firstPart." "?>... <a class="more_link" href="javascript: showMore();"><?php echo htmlentities(' More>>>')?></a></span>
178
+ <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>
179
+ <?php else: ?>
180
+ <span><?php echo str_replace("\\n", "<br>", $_productDescriptionHelper->getFullProductDescription());?></span>
181
+ <?php endif?>
182
+ </div >
183
+ </div>
184
+ <?php endif;?>
185
+ <div class="product-collateral">
186
+ <?php if ($_productDescriptionHelper->hasError()) :?>
187
+ <?php echo $this->getChildHtml('description') ?>
188
+ <?php else :
189
+ $tab_class0=$tab_class1=$tab_class2=$tab_class3='prod_doc_tab_div';
190
+ $data_tab_style0=$data_tab_style1=$data_tab_style2=$data_tab_style3="display:none";
191
+ if($sinchSpecification || $sinchSpecification!=''){
192
+ $tab_class0='prod_doc_tab_div_sel';
193
+ $data_tab_style0='';
194
+ }elseif(!empty($specificationArray)){
195
+ $tab_class1='prod_doc_tab_div_sel';
196
+ $data_tab_style1='';
197
+ }elseif($_catId && array_key_exists($_catId, $relatedProductsList)){
198
+ $tab_class2='prod_doc_tab_div_sel';
199
+ $data_tab_style2='';
200
+ }elseif(!empty($relatedProductsList)){
201
+ $tab_class3='prod_doc_tab_div_sel';
202
+ $data_tab_style3='';
203
+ }
204
+ ?>
205
+ <? if(false): ?>
206
+ <table cellspacing="0" cellpadding="0" width="100%">
207
+ <tr>
208
+ <td>
209
+ <table cellspacing="0" cellpadding="0" class="prod_doc_tabs_row">
210
+ <tr>
211
+ <td class="prod_doc_tabs_space">&nbsp;</td>
212
+ <?php if ($sinchSpecification || $sinchSpecification!=''):?>
213
+ <td class="prod_doc_tab"><div id="tab_0" class="<?php echo $tab_class0 ?>" onclick="changeTab(0)"><?php echo $this->helper('sinchimport/getdata')->__('Specification') ?></div></td>
214
+ <?php endif?>
215
+ <?php if (!empty($specificationArray)):?>
216
+ <td class="prod_doc_tab"><div id="tab_1" class="<?php echo $tab_class1 ?>" onclick="changeTab(1)"><?php echo $this->helper('sinchimport/getdata')->__('Star features') ?></div></td>
217
+ <?php endif?>
218
+ <?php if ($_catId && array_key_exists($_catId, $relatedProductsList)):?>
219
+ <td class="prod_doc_tab"><div id="tab_2" class="prod_doc_tab_div" onclick="changeTab(2)"><?php echo $this->helper('sinchimport/getdata')->__('Alternatives') ?></div></td>
220
+ <?php endif?>
221
+ <?php if (!empty($relatedProductsList)):?>
222
+ <td class="prod_doc_tab"><div id="tab_3" class="prod_doc_tab_div" onclick="changeTab(3)"><?php echo $this->helper('sinchimport/getdata')->__('Options') ?></div></td>
223
+ <?php endif?>
224
+ <td class="prod_doc_tabs_space" style="width:auto!important">&nbsp;</td>
225
+ </tr>
226
+ </table>
227
+ </td>
228
+ </tr>
229
+ <tr>
230
+ <td>
231
+ <table cellspacing="0" cellpadding="2" class="prod_doc_content">
232
+ <tr>
233
+ <td class="prod_doc_content_cell">
234
+ <!-- ZERO TAB's CONTENT (VISIBLE BY DEFAULT) -->
235
+ <table id="tab_cont_0" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style0; ?>">
236
+ <tr>
237
+ <td width="50%" valign="top">
238
+ <table cellspacing="0" cellpadding="2" class="prod_doc_table">
239
+ <tr><td>
240
+ <?php echo $sinchSpecification; ?>
241
+ </td></tr>
242
+ </table>
243
+ </td>
244
+ </tr>
245
+ </table>
246
+
247
+ <!-- FIRST TAB's CONTENT (VISIBLE BY DEFAULT) -->
248
+ <table id="tab_cont_1" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style1; ?>">
249
+ <tr>
250
+ <td width="50%" valign="top">
251
+ <table cellspacing="0" cellpadding="2" class="prod_doc_table">
252
+
253
+ <?php foreach($specificationArray as $key => $value):?>
254
+ <tr>
255
+ <td colspan="2" class="prod_doc_item_head"><?php echo $key?></td>
256
+ <td class="prod_doc_item_descr"><?php if($value == "Y"){
257
+ echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/yes.gif"/>';
258
+ }
259
+ else if ($value == "N"){
260
+ echo '<img border="0" alt="" src="http://prf.icecat.biz/imgs/no.gif"/>';
261
+ }
262
+ else{
263
+ echo str_replace("\\n", "<br>",$value);
264
+ }
265
+ ?></td>
266
+ </tr>
267
+ <?php endforeach;?>
268
+ </table>
269
+ </td>
270
+ </tr>
271
+ </table>
272
+ <!-- SECOND TAB's CONTENT (HIDDEN BY DEFAULT) -->
273
+ <table id="tab_cont_2" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style2; ?>">
274
+ <tr>
275
+ <td>
276
+ <table cellspacing="1" cellpadding="5" class="prod_alt_table" width="100%" >
277
+ <tr>
278
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Brand') ?></td>
279
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Image') ?></td>
280
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Article code') ?></td>
281
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Product name') ?></td>
282
+ </tr>
283
+ <?php if ($_catId && array_key_exists($_catId, $relatedProductsList)):?>
284
+ <?php foreach($relatedProductsList[$_catId] as $product):?>
285
+ <tr>
286
+ <?php if($product['supplier_thumb']&&($product['supplier_thumb']!='')): ?>
287
+ <td><img src="<?php echo $product['supplier_thumb']?>" /></td>
288
+ <?php else :?>
289
+ <td><?php echo $product['supplier_name']?></td>
290
+ <?php endif ?>
291
+ <td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
292
+ <td><?php echo $product['mpn']?></td>
293
+ <td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
294
+ </tr>
295
+ <?php endforeach?>
296
+ <?php else: ?>
297
+ <tr><td></>No Alternative proposals for Current product avaible</td></tr>
298
+ <?php endif?>
299
+ </table>
300
+ </td>
301
+ </tr>
302
+ </table>
303
+ <!-- THIRD TAB's CONTENT (HIDDEN BY DEFAULT) -->
304
+ <table id="tab_cont_3" cellspacing="6" cellpadding="0" width="100%" style="<?php echo $data_tab_style3; ?>">
305
+ <tr>
306
+ <td>
307
+
308
+ <table cellspacing="1" cellpadding="5" width="100%" class="prod_alt_table">
309
+ <tr>
310
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Brand') ?></td>
311
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Image') ?></td>
312
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Article code') ?></td>
313
+ <td class="prod_doc_block_head"><?php echo $this->helper('sinchimport/getdata')->__('Product name') ?></td>
314
+ </tr>
315
+ <?php if (!empty($relatedProductsList)):?>
316
+ <?php foreach($relatedProductsList as $categoryId => $productsArray):?>
317
+ <?php if ($categoryId == $_catId){
318
+ continue;
319
+ }?>
320
+ <?php if (!is_string($categoryId)):?>
321
+ <tr>
322
+ <td class="prod_doc_item_head2" colspan="4"><?php echo is_string($categoryId)? '' : Mage::getSingleton('catalog/category')->load($categoryId)->getName() ?></td>
323
+
324
+ </tr>
325
+ <?php endif?>
326
+ <?php foreach($productsArray as $product):?>
327
+ <tr>
328
+ <?php if($product['supplier_thumb']&&($product['supplier_thumb']!='')): ?>
329
+ <td><img src="<?php echo $product['supplier_thumb']?>" /></td>
330
+ <?php else :?>
331
+ <td><?php echo $product['supplier_name']?></td>
332
+ <?php endif ?>
333
+ <td><a href="<?php echo $product['url']?>"><img src="<?php echo $product['thumb']?>" /></a></td>
334
+ <td><?php echo $product['mpn']?></td>
335
+ <td><a href="<?php echo $product['url']?>" class="prod_link_small"><?php echo $product['name']?></a></td>
336
+ </tr>
337
+ <?php endforeach ?>
338
+ <?php endforeach ?>
339
+ <?php else: ?>
340
+ <tr><td></>No Related proposals for Current product avaible</td></tr>
341
+ <?php endif?>
342
+ </table>
343
+ </td>
344
+ </tr>
345
+ </table>
346
+ <!-- EOF -->
347
+ </td>
348
+ </tr>
349
+ </table>
350
+ <?php endif; ?>
351
+ </td>
352
+ </tr>
353
+ </table>
354
+ <?php endif;?>
355
+ <?php if ($_additional = $this->getChildHtml('additional')):?>
356
+ <div class="collateral-box">
357
+ <?php echo $_additional ?>
358
+ </div>
359
+ <?php endif;?>
360
+ <?php echo $this->getChildHtml('upsell_products') ?>
361
+ <?php echo $this->getChildHtml('product_additional_data') ?>
362
+ </div>
363
+ </div>
app/etc/modules/Bintime_Sinchimport.xml CHANGED
@@ -1,10 +1,10 @@
1
- <?xml version="1.0"?>
2
-
3
- <config>
4
- <modules>
5
- <Bintime_Sinchimport>
6
- <active>true</active>
7
- <codePool>local</codePool>
8
- </Bintime_Sinchimport>
9
- </modules>
10
- </config>
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Bintime_Sinchimport>
6
+ <active>true</active>
7
+ <codePool>local</codePool>
8
+ </Bintime_Sinchimport>
9
+ </modules>
10
+ </config>
package.xml CHANGED
@@ -1,21 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>stockinthechannel2012</name>
4
- <version>2.0.2</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPL v3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Import Plugin for the Stock in the Channel Magento Data Feed</summary>
10
  <description>Import Plugin for the Stock in the Channel Magento Data Feed.&#xD;
11
  Requires a Magento Formatted Data feed from http://stockinthechannel.com</description>
12
- <notes>Version 2.0.2:&#xD;
13
- * Import now flushes URL rewrites before rebuilding them&#xD;
14
- * Now calls Magento Event to import Pricerules</notes>
15
- <authors><author><name>stockinchannel</name><user>stockinchannel</user><email>support@stockinthechannel.com</email></author><author><name>Nick Anstee</name><user>nicka101</user><email>nick@stockinthechannel.com</email></author></authors>
16
- <date>2014-04-08</date>
17
- <time>11:47:55</time>
18
- <contents><target name="magelocal"><dir name="Bintime"><dir name="Sinchimport"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Sinchdistributors.php" hash="20c2452bfbf7206c72b2402e4eaa1541"/></dir></dir></dir><file name="Importenvironment.php" hash="85ac7cf582ad798fc31d85855319d6e1"/><file name="Importhistory.php" hash="3748b6e5ccdd242fa8a8cdb96a53241e"/><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="239d86cde4cf08f5f50183df26e89eea"/></dir><file name="View.php" hash="97cf41b42afc26d46ee3d876721601c7"/></dir><file name="List.php" hash="fb81ed4b565c1099bc7a47d19538c730"/><dir name="Product"><dir name="View"><file name="Media.php" hash="401c8afd5af4d0edda0929e8df4d6cd4"/></dir></dir><file name="Startimportbutton.php" hash="7dafc8567377960378db533fc690fc07"/><file name="Startstockpriceimportbutton.php" hash="14f033367ee4df620494f57be8f26719"/></dir><dir name="Helper"><file name="Data.php" hash="c9baa21be5ba345512e5c390b1954c72"/><file name="Getdata.php" hash="dcdf2bd47b01a26ed9400497774c86f8"/><file name="Image.php" hash="4507e0741e1bf094ce558ffb908dbae8"/></dir><dir name="Model"><file name="Api.php" hash="dbcb072fdf2a27766df6aae8213b3e5e"/><file name="Category.php" hash="c3e3410e01e33334b058dd9781f5d84a"/><file name="Image.php" hash="b87da6ed365c3265495afdc2f3b04eb2"/><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="4ab6866b88f6aa5e59a99808b38dc85b"/><file name="Price.php" hash="93a6b62fec1e11bf6af57dd0cb2f063a"/></dir></dir><file name="Layer.php" hash="2c0131265f18450126d7a0988d6ed284"/><file name="Product.php" hash="1e3be2c2c605b3eaf79aea1627ef4d49"/><dir name="Resource"><dir name="Layer"><dir name="Filter"><file name="Price.php" hash="0d1fd59eb80f281ebad11bf15d3007da"/></dir></dir><dir name="Mysql4"><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="ea9c35e365239bdcc362ff98369cbd87"/></dir></dir><file name="Setup.php" hash="280a1ece3e1bb1f035e2cf265da05b63"/></dir></dir><file name="Sinch.php" hash="fc6a8a799525a4281fdef0e90de9c409"/><file name="Sinch_new_code.php" hash="45139a984755a15503ee0c4c987f1e11"/><dir name="System"><dir name="Config"><file name="CatRewrite.php" hash="f54ba849b2342dfb177f4cd4736eaa48"/><file name="ProdRewrite.php" hash="95c993c6ef3258fd0c2745f39f3fcec7"/><file name="ServerList.php" hash="ff26802c85ed0733241a2166a702f34a"/><file name="Subscription.php" hash="985102ab2005f33e017818ef9247b633"/></dir></dir><file name="config.php" hash="89690f17588698f736ff9070d6f947a2"/></dir><dir name="controllers"><file name="AjaxController.php" hash="997ca1a6c79ad85b7eff86e2b3125bf1"/><file name="IndexController.php" hash="910f7a5547e9bad529ea71f3e8cd37e6"/><file name="ProductController.php" hash="a7619ef76a1f48bd7f2c029b7c488385"/><file name="SplitfeaturesController.php" hash="a1c27276bced097e8b2a6667e4b6fdbd"/></dir><dir name="etc"><file name="api.xml" hash="4b9df3ba0ff94824f06a5c14497034cb"/><file name="config.xml" hash="d1aef99f24977f702b6f3f5aaaf1f373"/><file name="system.xml" hash="b725941c89c9695ac9ff6e15e30ffb8e"/></dir><file name="sinch_import_start_ajax.php" hash="3f34acad1b0618d5350d28fd1acf506d"/><dir name="sql"><dir name="sinchimport_setup"><file name="filter_sinch_products_s.sql" hash="a66330a1c2717091c1752ddd89f63960"/><file name="mysql4-install-0.1.0.php" hash="b79406446cf40050ba29fad4c8057883"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="93a43b01c4ad6eb9c9638dc1d31ca777"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="c8c38201a96d38f84c5c0021148c3f25"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="56aa5dc8f22a7b24b23c9d381e92f6dc"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="ab6aa72ff697db247423911437830795"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="f195a8bf9fbcc31eca6d066ff1bb98f5"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="f4ee53d9644c16c80327b40fec432d1d"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="fbf4d87769c26c1d9d011a180f46b98d"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="aac20d4a587a68e665367d2c1f9d1068"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="de6b560cef7edf7914cc4f135b0678b9"/><file name="mysql4-upgrade-0.1.9-0.2.0.php" hash="33618a810c8b88d28fc1b504eb65c657"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="03b25c8b9c2993723a2995316c22a120"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="0252804da33fc6355bd6369370eed837"/><file name="mysql4-upgrade-3.0.0-3.0.1.php" hash="f0415ff848934fc18f659fae66288100"/><file name="mysql4-upgrade-3.0.1-3.0.2.php" hash="12853ce85af460e0d462fbf3297715c0"/><file name="mysql4-upgrade-3.0.2-3.0.3.php" hash="5f5be3c6c971abcb7a53121545e2f6c5"/><file name="mysql4-upgrade-3.0.3-3.0.4.php" hash="9c3612df0a873fa6e59ae9f98c5de2b0"/></dir></dir><file name="stock_price_sinch_import_start_ajax.php" hash="960ba4cfdb5ea3548a17c2365c0fca80"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bintime_Sinchimport.xml" hash="8d5661b858250eeb154af10ee19300c3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sinchimport.xml" hash="53dd99d9303049f92713aec45c21836f"/></dir><dir name="template"><dir name="sinchimport"><file name="list.phtml" hash="adc46e247797cdad4582792266d381e4"/><file name="media.phtml" hash="af44d0371493235e4d0a5d0e9223bd9e"/><file name="view.phtml" hash="f160f6226d774a82ab1b312ffb30eb3e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sinchimport.xml" hash="84687412f5e731526b0cbb2f82ef6a06"/></dir><dir name="template"><dir name="sinchimport"><dir name="sales"><dir name="items"><dir name="column"><file name="name.phtml" hash="27c9c11cbf99919dfdf819e788281f5f"/></dir></dir></dir><file name="sinchdistributors.phtml" hash="cfda729147fd7b03b9f1bdc582e0d07f"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="sinchimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="sinchimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/></dir></dir></dir></dir></target></contents>
 
19
  <compatible/>
20
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>stockinthechannel2012</name>
4
+ <version>2.0.3</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Import Plugin for the Stock in the Channel Magento Data Feed</summary>
10
  <description>Import Plugin for the Stock in the Channel Magento Data Feed.&#xD;
11
  Requires a Magento Formatted Data feed from http://stockinthechannel.com</description>
12
+ <notes>Version 2.0.3:&#xD;
13
+ * Now uses MySQLi instead of the MySQL plugin&#xD;
14
+ * Updated Server's list to contain every region we support&#xD;
15
+ * International fix is now part of the plugin by default</notes>
16
+ <authors><author><name>stockinchannel</name><user>stockinchannel</user><email>marketing@stockinthechannel.com</email></author><author><name>Nick Anstee</name><user>nicka101</user><email>nick@stockinthechannel.com</email></author></authors>
17
+ <date>2014-11-20</date>
18
+ <time>13:21:30</time>
19
+ <contents><target name="magelocal"><dir name="Bintime"><dir name="Sinchimport"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Sinchdistributors.php" hash="20c2452bfbf7206c72b2402e4eaa1541"/></dir></dir></dir><file name="Importenvironment.php" hash="85ac7cf582ad798fc31d85855319d6e1"/><file name="Importhistory.php" hash="3748b6e5ccdd242fa8a8cdb96a53241e"/><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="239d86cde4cf08f5f50183df26e89eea"/></dir><file name="View.php" hash="60e6aeb7f07e6be9e6202395bf76dfad"/></dir><file name="List.php" hash="db883cb9fb90fc16e4e9cb5db2050937"/><dir name="Product"><dir name="View"><file name="Media.php" hash="401c8afd5af4d0edda0929e8df4d6cd4"/></dir></dir><file name="Startimportbutton.php" hash="7dafc8567377960378db533fc690fc07"/><file name="Startstockpriceimportbutton.php" hash="14f033367ee4df620494f57be8f26719"/></dir><dir name="Helper"><file name="Data.php" hash="c9baa21be5ba345512e5c390b1954c72"/><file name="Getdata.php" hash="dcdf2bd47b01a26ed9400497774c86f8"/><file name="Image.php" hash="4507e0741e1bf094ce558ffb908dbae8"/></dir><dir name="Model"><file name="Api.php" hash="dbcb072fdf2a27766df6aae8213b3e5e"/><file name="Category.php" hash="c3e3410e01e33334b058dd9781f5d84a"/><file name="Image.php" hash="b87da6ed365c3265495afdc2f3b04eb2"/><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="4ab6866b88f6aa5e59a99808b38dc85b"/><file name="Price.php" hash="93a6b62fec1e11bf6af57dd0cb2f063a"/></dir></dir><file name="Layer.php" hash="2c0131265f18450126d7a0988d6ed284"/><file name="Product.php" hash="1e3be2c2c605b3eaf79aea1627ef4d49"/><dir name="Resource"><dir name="Layer"><dir name="Filter"><file name="Price.php" hash="0d1fd59eb80f281ebad11bf15d3007da"/></dir></dir><dir name="Mysql4"><dir name="Layer"><dir name="Filter"><file name="Feature.php" hash="ea9c35e365239bdcc362ff98369cbd87"/></dir></dir><file name="Setup.php" hash="280a1ece3e1bb1f035e2cf265da05b63"/></dir></dir><file name="Sinch.php" hash="ce012e1b5231cc97d368389e1d38c25e"/><file name="Sinch_new_code.php" hash="98a2c5197038404a4de141c647b32b88"/><dir name="System"><dir name="Config"><file name="CatRewrite.php" hash="f54ba849b2342dfb177f4cd4736eaa48"/><file name="ProdRewrite.php" hash="95c993c6ef3258fd0c2745f39f3fcec7"/><file name="ServerList.php" hash="0ce62323bf583551c3c812ba4c656189"/><file name="Subscription.php" hash="985102ab2005f33e017818ef9247b633"/></dir></dir><file name="config.php" hash="89690f17588698f736ff9070d6f947a2"/></dir><dir name="controllers"><file name="AjaxController.php" hash="997ca1a6c79ad85b7eff86e2b3125bf1"/><file name="IndexController.php" hash="910f7a5547e9bad529ea71f3e8cd37e6"/><file name="ProductController.php" hash="a7619ef76a1f48bd7f2c029b7c488385"/><file name="SplitfeaturesController.php" hash="a1c27276bced097e8b2a6667e4b6fdbd"/></dir><dir name="etc"><file name="api.xml" hash="4b9df3ba0ff94824f06a5c14497034cb"/><file name="config.xml" hash="d1aef99f24977f702b6f3f5aaaf1f373"/><file name="system.xml" hash="b725941c89c9695ac9ff6e15e30ffb8e"/></dir><file name="sinch_import_start_ajax.php" hash="3f34acad1b0618d5350d28fd1acf506d"/><dir name="sql"><dir name="sinchimport_setup"><file name="filter_sinch_products_s.sql" hash="a66330a1c2717091c1752ddd89f63960"/><file name="mysql4-install-0.1.0.php" hash="5925ffb8574cb35032b9d2866f4da7be"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="93a43b01c4ad6eb9c9638dc1d31ca777"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="710c4d2873fcbe3061b925072d995d73"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="d2892bb825c7baf2139c136fd96f2f66"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="ab6aa72ff697db247423911437830795"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="f195a8bf9fbcc31eca6d066ff1bb98f5"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="f4ee53d9644c16c80327b40fec432d1d"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="987ed4ca76a263580705ec93e0277120"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="e52bb4ef6f982992fcbfcce710698525"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="de6b560cef7edf7914cc4f135b0678b9"/><file name="mysql4-upgrade-0.1.9-0.2.0.php" hash="33618a810c8b88d28fc1b504eb65c657"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="507b285ba1f3eb98d9fb54a3ae29257c"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="55732b89b294191eaecbe3a5e1c7691e"/><file name="mysql4-upgrade-3.0.0-3.0.1.php" hash="3a7b53cbc0585e04afed64b321771a8a"/><file name="mysql4-upgrade-3.0.1-3.0.2.php" hash="12853ce85af460e0d462fbf3297715c0"/><file name="mysql4-upgrade-3.0.2-3.0.3.php" hash="2c0c1a12c567ecacad6647eeffa4f198"/><file name="mysql4-upgrade-3.0.3-3.0.4.php" hash="9c3612df0a873fa6e59ae9f98c5de2b0"/></dir></dir><file name="stock_price_sinch_import_start_ajax.php" hash="960ba4cfdb5ea3548a17c2365c0fca80"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bintime_Sinchimport.xml" hash="14afd0361958cc31fc57431c4e4c3ba1"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sinchimport.xml" hash="e60b86828e8d9666724311907451d1ba"/></dir><dir name="template"><dir name="sinchimport"><file name="list.phtml" hash="1312f3b0ded996cb820e9c17a434e716"/><file name="media.phtml" hash="a448fd63753f44c86cc091e4da8b9e99"/><file name="view.phtml" hash="7c21e0b3f31cf3eb7d0e2a6e619f58ef"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sinchimport.xml" hash="3ed2e666e7bf9838a63aa31c0c829e9c"/></dir><dir name="template"><dir name="sinchimport"><dir name="sales"><dir name="items"><dir name="column"><file name="name.phtml" hash="7997765254d19e09b30cf1d0090bd4e6"/></dir></dir></dir><file name="sinchdistributors.phtml" hash="d74f3d401b83319c1b42b878afc5ccff"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="sinchimport_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="sinchimport_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>