Skip to content

Commit

Permalink
Version 100.1.54 for magento 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Aug 28, 2023
1 parent 22b27ed commit 538018d
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,47 +197,5 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
$config->getResource()->delete($config);
}
}
if (version_compare($context->getVersion(), '100.1.53') < 0) {
$setup->startSetup();
$connection = $this->_resource->getConnectionByName('default');
try {
$tableOrders = $setup->getTable('sales_order');
$tableEcommerce = $setup->getTable('mailchimp_sync_ecommerce');
$query = "UPDATE `$tableOrders` as A ";
$query .= "INNER JOIN `$tableEcommerce` as B ON A.`entity_id` = B.`related_id` ";
$query .= "SET A.`mailchimp_sync_error` = B.`mailchimp_sync_error`, A.`mailchimp_sent` = B.`mailchimp_sent` ";
$query .= "WHERE B.`type` = 'ORD'";
$connection->query($query);

} catch(\Exception $e) {
$this->_helper->log($e->getMessage());
throw new \Exception($e->getMessage());
}
try {
$tableOrdersGrid = $setup->getTable('sales_order_grid');
$tableEcommerce = $setup->getTable('mailchimp_sync_ecommerce');
$query = "UPDATE `$tableOrdersGrid` as A ";
$query .= "INNER JOIN `$tableEcommerce` as B ON A.`entity_id` = B.`related_id` ";
$query .= "SET A.`mailchimp_sync_error` = B.`mailchimp_sync_error`, A.`mailchimp_sent` = B.`mailchimp_sent` ";
$query .= "WHERE B.`type` = 'ORD'";
$connection->query($query);

} catch(\Exception $e) {
$this->_helper->log($e->getMessage());
throw new \Exception($e->getMessage());
}
try {
$tableProducts = $setup->getTable('catalog_product_entity');
$tableEcommerce = $setup->getTable('mailchimp_sync_ecommerce');
$query = "UPDATE `$tableProducts` as A ";
$query .= "INNER JOIN `$tableEcommerce` as B ON A.`entity_id` = B.`related_id` ";
$query .= "SET A.`mailchimp_sync_error` = B.`mailchimp_sync_error`, A.`mailchimp_sent` = B.`mailchimp_sent` ";
$query .= "WHERE B.`type` = 'PRO'";
$connection->query($query);
} catch(\Exception $e) {
$this->_helper->log($e->getMessage());
throw new \Exception($e->getMessage());
}
}
}
}

0 comments on commit 538018d

Please sign in to comment.