Version Notes
Version 2.0.2:
* Import now flushes URL rewrites before rebuilding them
* Now calls Magento Event to import Pricerules
Download this release
Release Info
Developer | stockinchannel |
Extension | stockinthechannel2012 |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
app/code/local/Bintime/Sinchimport/Model/Sinch.php
CHANGED
@@ -322,9 +322,19 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
|
|
322 |
$import->addImportStatus('Parse Stock And Prices');
|
323 |
|
324 |
echo "Apply Customer Group Price <br>";
|
325 |
-
|
326 |
-
|
327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
|
329 |
Mage::log("Finish Sinch import", null, $this->_logFile);
|
330 |
echo "Finish Sinch import<br>";
|
@@ -426,9 +436,17 @@ class Bintime_Sinchimport_Model_Sinch extends Mage_Core_Model_Abstract {
|
|
426 |
$import->addImportStatus('Stock Price Parse Products');
|
427 |
|
428 |
echo "Apply Customer Group Price <br>";
|
429 |
-
|
430 |
-
|
431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
|
433 |
Mage::log("Finish Stock & Price Sinch import", null, $this->_logFile);
|
434 |
echo "Finish Stock & Price Sinch import<br>";
|
@@ -2638,6 +2656,7 @@ echo("\n replaceMagentoProductsMultistoreMERGE 3\n");
|
|
2638 |
LEFT JOIN $stINch_products_mapping pm
|
2639 |
ON a.store_product_id = pm.store_product_id
|
2640 |
AND a.sinch_product_id = pm.sinch_product_id
|
|
|
2641 |
)
|
2642 |
ON DUPLICATE KEY UPDATE
|
2643 |
sku = a.product_sku,
|
@@ -2646,6 +2665,33 @@ echo("\n replaceMagentoProductsMultistoreMERGE 3\n");
|
|
2646 |
// store_product_id = a.store_product_id,
|
2647 |
// sinch_product_id = a.sinch_product_id
|
2648 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2649 |
echo("\n replaceMagentoProductsMultistoreMERGE 4\n");
|
2650 |
|
2651 |
|
@@ -3029,12 +3075,14 @@ echo("\n replaceMagentoProductsMultistoreMERGE 20\n");
|
|
3029 |
|
3030 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
3031 |
$this->addDescriptions();
|
|
|
3032 |
if($this->product_file_format == "NEW"){
|
3033 |
$this->addReviews();
|
3034 |
$this->addWeight();
|
3035 |
$this->addSearchCache();
|
3036 |
$this->addPdfUrl();
|
3037 |
$this->addShortDescriptions();
|
|
|
3038 |
}
|
3039 |
$this->addEAN();
|
3040 |
$this->addSpecification();
|
@@ -3569,6 +3617,33 @@ echo("\n replaceMagentoProductsMultistore 3\n");
|
|
3569 |
LEFT JOIN $stINch_products_mapping pm
|
3570 |
ON a.store_product_id = pm.store_product_id
|
3571 |
AND a.sinch_product_id = pm.sinch_product_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3572 |
)
|
3573 |
ON DUPLICATE KEY UPDATE
|
3574 |
sku = a.product_sku,
|
@@ -3929,12 +4004,14 @@ echo("\n replaceMagentoProductsMultistore 20\n");
|
|
3929 |
|
3930 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
3931 |
$this->addDescriptions();
|
|
|
3932 |
if($this->product_file_format == "NEW"){
|
3933 |
$this->addReviews();
|
3934 |
$this->addWeight();
|
3935 |
$this->addSearchCache();
|
3936 |
$this->addPdfUrl();
|
3937 |
$this->addShortDescriptions();
|
|
|
3938 |
}
|
3939 |
$this->addEAN();
|
3940 |
$this->addSpecification();
|
@@ -5703,14 +5780,19 @@ echo("\nParseProducts 7\n");
|
|
5703 |
SET number_of_products=".$row['cnt']."
|
5704 |
WHERE id=".$this->current_import_status_statistic_id);
|
5705 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5706 |
echo("\nParseProducts 8\n");
|
5707 |
$this->addProductsWebsite();
|
5708 |
$this->mapSinchProducts();
|
5709 |
echo("\nParseProducts 9\n");
|
5710 |
|
5711 |
-
if ($replace_merge_product == "REWRITE"){
|
5712 |
-
$this->db_do ("TRUNCATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity'));
|
5713 |
-
}
|
5714 |
if (count($coincidence) == 1)
|
5715 |
{
|
5716 |
$this->replaceMagentoProducts();
|
@@ -6224,6 +6306,42 @@ echo("\nParseProducts 11\n");
|
|
6224 |
LEFT JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')." pm
|
6225 |
ON a.store_product_id=pm.store_product_id
|
6226 |
AND a.sinch_product_id=pm.sinch_product_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6227 |
)
|
6228 |
ON DUPLICATE KEY UPDATE
|
6229 |
sku= a.product_sku,
|
@@ -6521,12 +6639,14 @@ echo("\ndone\n");
|
|
6521 |
|
6522 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
6523 |
$this->addDescriptions();
|
|
|
6524 |
if($this->product_file_format == "NEW"){
|
6525 |
$this->addReviews();
|
6526 |
$this->addWeight();
|
6527 |
$this->addSearchCache();
|
6528 |
$this->addPdfUrl();
|
6529 |
$this->addShortDescriptions();
|
|
|
6530 |
}
|
6531 |
$this->addEAN();
|
6532 |
$this->addSpecification();
|
@@ -7157,6 +7277,85 @@ STP DELETE*/
|
|
7157 |
|
7158 |
}
|
7159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7160 |
|
7161 |
#################################################################################################
|
7162 |
function addShortDescriptions(){
|
@@ -8395,6 +8594,13 @@ STP DELETE*/
|
|
8395 |
}
|
8396 |
#################################################################################################
|
8397 |
public function runIndexer(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8398 |
exec(PHP_RUN_STRING.' '.$this->shellDir.'indexer.php reindexall');
|
8399 |
}
|
8400 |
#################################################################################################
|
322 |
$import->addImportStatus('Parse Stock And Prices');
|
323 |
|
324 |
echo "Apply Customer Group Price <br>";
|
325 |
+
//$import->ParsePriceRules();
|
326 |
+
//$import->AddPriceRules();
|
327 |
+
//$import->ApplyCustomerGroupPrice();
|
328 |
+
|
329 |
+
if(file_exists($this->varDir.FILE_PRICE_RULES)){
|
330 |
+
$ftpCred = Mage::getStoreConfig('sinchimport_root/sinch_ftp');
|
331 |
+
Mage::dispatchEvent('sinch_pricerules_import_ftp', array(
|
332 |
+
'ftp_host' => $ftpCred["ftp_server"],
|
333 |
+
'ftp_username' => $ftpCred["login"],
|
334 |
+
'ftp_password' => $ftpCred["password"]
|
335 |
+
));
|
336 |
+
}
|
337 |
+
|
338 |
|
339 |
Mage::log("Finish Sinch import", null, $this->_logFile);
|
340 |
echo "Finish Sinch import<br>";
|
436 |
$import->addImportStatus('Stock Price Parse Products');
|
437 |
|
438 |
echo "Apply Customer Group Price <br>";
|
439 |
+
//$import->ParsePriceRules();
|
440 |
+
//$import->AddPriceRules();
|
441 |
+
//$import->ApplyCustomerGroupPrice();
|
442 |
+
|
443 |
+
$ftpCred = Mage::getStoreConfig('sinchimport_root/sinch_ftp');
|
444 |
+
Mage::dispatchEvent('sinch_pricerules_import_ftp', array(
|
445 |
+
'ftp_host' => $ftpCred["ftp_server"],
|
446 |
+
'ftp_username' => $ftpCred["login"],
|
447 |
+
'ftp_password' => $ftpCred["password"]
|
448 |
+
));
|
449 |
+
|
450 |
|
451 |
Mage::log("Finish Stock & Price Sinch import", null, $this->_logFile);
|
452 |
echo "Finish Stock & Price Sinch import<br>";
|
2656 |
LEFT JOIN $stINch_products_mapping pm
|
2657 |
ON a.store_product_id = pm.store_product_id
|
2658 |
AND a.sinch_product_id = pm.sinch_product_id
|
2659 |
+
WHERE pm.entity_id IS NOT NULL
|
2660 |
)
|
2661 |
ON DUPLICATE KEY UPDATE
|
2662 |
sku = a.product_sku,
|
2665 |
// store_product_id = a.store_product_id,
|
2666 |
// sinch_product_id = a.sinch_product_id
|
2667 |
|
2668 |
+
$result = $this->db_do("
|
2669 |
+
INSERT INTO $catalog_product_entity
|
2670 |
+
(entity_id, entity_type_id, attribute_set_id, type_id, sku, updated_at, has_options, store_product_id, sinch_product_id)
|
2671 |
+
(SELECT
|
2672 |
+
pm.entity_id,
|
2673 |
+
$_getProductEntityTypeId,
|
2674 |
+
$_defaultAttributeSetId,
|
2675 |
+
'simple',
|
2676 |
+
a.product_sku,
|
2677 |
+
NOW(),
|
2678 |
+
0,
|
2679 |
+
a.store_product_id,
|
2680 |
+
a.sinch_product_id
|
2681 |
+
FROM $products_temp a
|
2682 |
+
LEFT JOIN $stINch_products_mapping pm
|
2683 |
+
ON a.store_product_id = pm.store_product_id
|
2684 |
+
AND a.sinch_product_id = pm.sinch_product_id
|
2685 |
+
WHERE pm.entity_id IS NULL
|
2686 |
+
)
|
2687 |
+
ON DUPLICATE KEY UPDATE
|
2688 |
+
sku = a.product_sku,
|
2689 |
+
store_product_id = a.store_product_id,
|
2690 |
+
sinch_product_id = a.sinch_product_id");
|
2691 |
+
// store_product_id = a.store_product_id,
|
2692 |
+
// sinch_product_id = a.sinch_product_id
|
2693 |
+
|
2694 |
+
|
2695 |
echo("\n replaceMagentoProductsMultistoreMERGE 4\n");
|
2696 |
|
2697 |
|
3075 |
|
3076 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
3077 |
$this->addDescriptions();
|
3078 |
+
$this->cleanProductDistributors();
|
3079 |
if($this->product_file_format == "NEW"){
|
3080 |
$this->addReviews();
|
3081 |
$this->addWeight();
|
3082 |
$this->addSearchCache();
|
3083 |
$this->addPdfUrl();
|
3084 |
$this->addShortDescriptions();
|
3085 |
+
$this->addProductDistributors();
|
3086 |
}
|
3087 |
$this->addEAN();
|
3088 |
$this->addSpecification();
|
3617 |
LEFT JOIN $stINch_products_mapping pm
|
3618 |
ON a.store_product_id = pm.store_product_id
|
3619 |
AND a.sinch_product_id = pm.sinch_product_id
|
3620 |
+
WHERE pm.entity_id IS NULL
|
3621 |
+
)
|
3622 |
+
ON DUPLICATE KEY UPDATE
|
3623 |
+
sku = a.product_sku,
|
3624 |
+
store_product_id = a.store_product_id,
|
3625 |
+
sinch_product_id = a.sinch_product_id");
|
3626 |
+
// store_product_id = a.store_product_id,
|
3627 |
+
// sinch_product_id = a.sinch_product_id
|
3628 |
+
|
3629 |
+
$result = $this->db_do("
|
3630 |
+
INSERT INTO $catalog_product_entity
|
3631 |
+
(entity_id, entity_type_id, attribute_set_id, type_id, sku, updated_at, has_options, store_product_id, sinch_product_id)
|
3632 |
+
(SELECT
|
3633 |
+
pm.entity_id,
|
3634 |
+
$_getProductEntityTypeId,
|
3635 |
+
$_defaultAttributeSetId,
|
3636 |
+
'simple',
|
3637 |
+
a.product_sku,
|
3638 |
+
NOW(),
|
3639 |
+
0,
|
3640 |
+
a.store_product_id,
|
3641 |
+
a.sinch_product_id
|
3642 |
+
FROM $products_temp a
|
3643 |
+
LEFT JOIN $stINch_products_mapping pm
|
3644 |
+
ON a.store_product_id = pm.store_product_id
|
3645 |
+
AND a.sinch_product_id = pm.sinch_product_id
|
3646 |
+
WHERE pm.entity_id IS NOT NULL
|
3647 |
)
|
3648 |
ON DUPLICATE KEY UPDATE
|
3649 |
sku = a.product_sku,
|
4004 |
|
4005 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
4006 |
$this->addDescriptions();
|
4007 |
+
$this->cleanProductDistributors();
|
4008 |
if($this->product_file_format == "NEW"){
|
4009 |
$this->addReviews();
|
4010 |
$this->addWeight();
|
4011 |
$this->addSearchCache();
|
4012 |
$this->addPdfUrl();
|
4013 |
$this->addShortDescriptions();
|
4014 |
+
$this->addProductDistributors();
|
4015 |
}
|
4016 |
$this->addEAN();
|
4017 |
$this->addSpecification();
|
5780 |
SET number_of_products=".$row['cnt']."
|
5781 |
WHERE id=".$this->current_import_status_statistic_id);
|
5782 |
}
|
5783 |
+
|
5784 |
+
if ($replace_merge_product == "REWRITE"){
|
5785 |
+
$this->db_do ("DELETE FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity'));
|
5786 |
+
$this->db_do ("SET FOREIGN_KEY_CHECKS=0");
|
5787 |
+
$this->db_do ("TRUNCATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity'));
|
5788 |
+
$this->db_do ("SET FOREIGN_KEY_CHECKS=1");
|
5789 |
+
}
|
5790 |
+
|
5791 |
echo("\nParseProducts 8\n");
|
5792 |
$this->addProductsWebsite();
|
5793 |
$this->mapSinchProducts();
|
5794 |
echo("\nParseProducts 9\n");
|
5795 |
|
|
|
|
|
|
|
5796 |
if (count($coincidence) == 1)
|
5797 |
{
|
5798 |
$this->replaceMagentoProducts();
|
6306 |
LEFT JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')." pm
|
6307 |
ON a.store_product_id=pm.store_product_id
|
6308 |
AND a.sinch_product_id=pm.sinch_product_id
|
6309 |
+
WHERE pm.entity_id IS NOT NULL
|
6310 |
+
)
|
6311 |
+
ON DUPLICATE KEY UPDATE
|
6312 |
+
sku= a.product_sku,
|
6313 |
+
store_product_id=a.store_product_id,
|
6314 |
+
sinch_product_id=a.sinch_product_id
|
6315 |
+
");
|
6316 |
+
// store_product_id=a.store_product_id,
|
6317 |
+
// sinch_product_id=a.sinch_product_id
|
6318 |
+
|
6319 |
+
$result = $this->db_do("
|
6320 |
+
INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." (
|
6321 |
+
entity_id,
|
6322 |
+
entity_type_id,
|
6323 |
+
attribute_set_id,
|
6324 |
+
type_id,
|
6325 |
+
sku,
|
6326 |
+
updated_at,
|
6327 |
+
has_options,
|
6328 |
+
store_product_id,
|
6329 |
+
sinch_product_id
|
6330 |
+
)(SELECT
|
6331 |
+
pm.entity_id,
|
6332 |
+
" . $this->_getProductEntityTypeId(). ",
|
6333 |
+
$this->defaultAttributeSetId,
|
6334 |
+
'simple',
|
6335 |
+
a.product_sku,
|
6336 |
+
NOW(),
|
6337 |
+
0,
|
6338 |
+
a.store_product_id,
|
6339 |
+
a.sinch_product_id
|
6340 |
+
FROM ".Mage::getSingleton('core/resource')->getTableName('products_temp')." a
|
6341 |
+
LEFT JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_products_mapping')." pm
|
6342 |
+
ON a.store_product_id=pm.store_product_id
|
6343 |
+
AND a.sinch_product_id=pm.sinch_product_id
|
6344 |
+
WHERE pm.entity_id IS NULL
|
6345 |
)
|
6346 |
ON DUPLICATE KEY UPDATE
|
6347 |
sku= a.product_sku,
|
6639 |
|
6640 |
$this->dropHTMLentities($this->_getProductEntityTypeId(), $this->_getProductAttributeId('name'));
|
6641 |
$this->addDescriptions();
|
6642 |
+
$this->cleanProductDistributors();
|
6643 |
if($this->product_file_format == "NEW"){
|
6644 |
$this->addReviews();
|
6645 |
$this->addWeight();
|
6646 |
$this->addSearchCache();
|
6647 |
$this->addPdfUrl();
|
6648 |
$this->addShortDescriptions();
|
6649 |
+
$this->addProductDistributors();
|
6650 |
}
|
6651 |
$this->addEAN();
|
6652 |
$this->addSpecification();
|
7277 |
|
7278 |
}
|
7279 |
|
7280 |
+
#################################################################################################
|
7281 |
+
function cleanProductDistributors(){
|
7282 |
+
for($i=1; $i<=5; $i++){
|
7283 |
+
$this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
|
7284 |
+
SET value = ''
|
7285 |
+
WHERE entity_type_id=".$this->_getProductEntityTypeId()." AND attribute_id=".$this->_getProductAttributeId('supplier_'.$i));
|
7286 |
+
}
|
7287 |
+
}
|
7288 |
+
#################################################################################################
|
7289 |
+
function addProductDistributors(){
|
7290 |
+
$this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary'));
|
7291 |
+
$this->db_do("CREATE TABLE IF NOT EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary')."
|
7292 |
+
LIKE ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price'));
|
7293 |
+
$this->db_do("INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary')." SELECT * FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price'));
|
7294 |
+
for($i=1; $i<=5; $i++){
|
7295 |
+
$this->db_do("DROP TABLE IF EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier'));
|
7296 |
+
$this->db_do("CREATE TABLE IF NOT EXISTS ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier')."
|
7297 |
+
LIKE ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price'));
|
7298 |
+
$this->db_do("INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier')." SELECT * FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary')." GROUP BY store_product_id");
|
7299 |
+
|
7300 |
+
// product Distributors for all web sites
|
7301 |
+
$result = $this->db_do("
|
7302 |
+
INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')." (
|
7303 |
+
entity_type_id,
|
7304 |
+
attribute_id,
|
7305 |
+
store_id,
|
7306 |
+
entity_id,
|
7307 |
+
value
|
7308 |
+
)(
|
7309 |
+
SELECT
|
7310 |
+
" . $this->_getProductEntityTypeId(). ",
|
7311 |
+
" . $this->_getProductAttributeId('supplier_'.$i). ",
|
7312 |
+
w.website,
|
7313 |
+
a.entity_id,
|
7314 |
+
d.distributor_name
|
7315 |
+
FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
|
7316 |
+
INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier')." b
|
7317 |
+
ON a.store_product_id = b.store_product_id
|
7318 |
+
INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors')." d
|
7319 |
+
ON b.distributor_id = d.distributor_id
|
7320 |
+
INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('products_website_temp')." w
|
7321 |
+
ON a.store_product_id=w.store_product_id
|
7322 |
+
)
|
7323 |
+
ON DUPLICATE KEY UPDATE
|
7324 |
+
value = d.distributor_name
|
7325 |
+
");
|
7326 |
+
// product Distributors for all web sites
|
7327 |
+
$result = $this->db_do("
|
7328 |
+
INSERT INTO ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')." (
|
7329 |
+
entity_type_id,
|
7330 |
+
attribute_id,
|
7331 |
+
store_id,
|
7332 |
+
entity_id,
|
7333 |
+
value
|
7334 |
+
)(
|
7335 |
+
SELECT
|
7336 |
+
" . $this->_getProductEntityTypeId(). ",
|
7337 |
+
" . $this->_getProductAttributeId('supplier_'.$i). ",
|
7338 |
+
0,
|
7339 |
+
a.entity_id,
|
7340 |
+
d.distributor_name
|
7341 |
+
FROM ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity')." a
|
7342 |
+
INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier')." b
|
7343 |
+
ON a.store_product_id = b.store_product_id
|
7344 |
+
INNER JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors')." d
|
7345 |
+
ON b.distributor_id = d.distributor_id
|
7346 |
+
)
|
7347 |
+
ON DUPLICATE KEY UPDATE
|
7348 |
+
value = d.distributor_name
|
7349 |
+
");
|
7350 |
+
|
7351 |
+
$this->db_do("DELETE sdsapt FROM ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary')." sdsapt JOIN ".Mage::getSingleton('core/resource')->getTableName('stINch_distributors_stock_and_price_temporary_supplier')." sdsapts ON sdsapt.store_product_id = sdsapts.store_product_id AND sdsapt.distributor_id = sdsapts.distributor_id");
|
7352 |
+
|
7353 |
+
|
7354 |
+
}
|
7355 |
+
|
7356 |
+
}
|
7357 |
+
|
7358 |
+
|
7359 |
|
7360 |
#################################################################################################
|
7361 |
function addShortDescriptions(){
|
8594 |
}
|
8595 |
#################################################################################################
|
8596 |
public function runIndexer(){
|
8597 |
+
$this->db_do("DELETE FROM ".Mage::getSingleton('core/resource')->getTableName('core_url_rewrite'));
|
8598 |
+
$this->db_do ("SET FOREIGN_KEY_CHECKS=0");
|
8599 |
+
$this->db_do("TRUNCATE TABLE ".Mage::getSingleton('core/resource')->getTableName('core_url_rewrite'));
|
8600 |
+
$this->db_do ("SET FOREIGN_KEY_CHECKS=1");
|
8601 |
+
$this->db_do("UPDATE ".Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_varchar')."
|
8602 |
+
SET value = ''
|
8603 |
+
WHERE entity_type_id=".$this->_getProductEntityTypeId()." AND attribute_id=".$this->_getProductAttributeId('url_key'));
|
8604 |
exec(PHP_RUN_STRING.' '.$this->shellDir.'indexer.php reindexall');
|
8605 |
}
|
8606 |
#################################################################################################
|
app/code/local/Bintime/Sinchimport/etc/config.xml
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
<modules>
|
6 |
<Bintime_Sinchimport>
|
7 |
-
<version>3.0.
|
8 |
<depends>
|
9 |
<!-- no dependencies -->
|
10 |
</depends>
|
4 |
|
5 |
<modules>
|
6 |
<Bintime_Sinchimport>
|
7 |
+
<version>3.0.4</version>
|
8 |
<depends>
|
9 |
<!-- no dependencies -->
|
10 |
</depends>
|
app/code/local/Bintime/Sinchimport/sql/sinchimport_setup/mysql4-upgrade-3.0.3-3.0.4.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
|
7 |
+
$attr_varchar=array(
|
8 |
+
'supplier_1' => 'Supplier 1',
|
9 |
+
'supplier_2' => 'Supplier 2',
|
10 |
+
'supplier_3' => 'Supplier 3',
|
11 |
+
'supplier_4' => 'Supplier 4',
|
12 |
+
'supplier_5' => 'Supplier 5'
|
13 |
+
);
|
14 |
+
|
15 |
+
foreach($attr_varchar as $key=>$value){
|
16 |
+
|
17 |
+
$installer->addAttribute('catalog_product', $key,array(
|
18 |
+
'label' => $value,
|
19 |
+
'type' => 'varchar',
|
20 |
+
'input' => 'text',
|
21 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
22 |
+
'frontend' => '',
|
23 |
+
'source' => '',
|
24 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
25 |
+
'visible' => true,
|
26 |
+
'required' => false,
|
27 |
+
'user_defined' => false,
|
28 |
+
'searchable' => false,
|
29 |
+
'filterable' => false,
|
30 |
+
'comparable' => false,
|
31 |
+
'visible_on_front' => true,
|
32 |
+
'visible_in_advanced_search' => false,
|
33 |
+
'unique' => false
|
34 |
+
));
|
35 |
+
|
36 |
+
|
37 |
+
$data=array(
|
38 |
+
'is_visible_on_front' => 0,
|
39 |
+
'is_html_allowed_on_front' => 1
|
40 |
+
);
|
41 |
+
$entityTypeId = $installer->getEntityTypeId('catalog_product');
|
42 |
+
if ($id = $installer->getAttribute($entityTypeId, $key, 'attribute_id')) {
|
43 |
+
$installer->updateAttribute($entityTypeId, $id, $data);
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
$installer->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>stockinthechannel2012</name>
|
4 |
-
<version>2.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GNU GPL v3</license>
|
7 |
<channel>community</channel>
|
@@ -9,12 +9,13 @@
|
|
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.
|
11 |
Requires a Magento Formatted Data feed from http://stockinthechannel.com</description>
|
12 |
-
<notes>Version 2.0.
|
13 |
-
*
|
|
|
14 |
<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>
|
15 |
-
<date>2014-
|
16 |
-
<time>
|
17 |
-
<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="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
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>
|
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.
|
11 |
Requires a Magento Formatted Data feed from http://stockinthechannel.com</description>
|
12 |
+
<notes>Version 2.0.2:
|
13 |
+
* Import now flushes URL rewrites before rebuilding them
|
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>
|