Skip to content

Commit

Permalink
closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Mar 18, 2017
1 parent f30c78e commit b9eecb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
*/
private $_mailChimpSyncEcommerce;
/**
* @var \Magento\Catalog\Model\ResourceModel\Product\Collection
* @var \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce
*/
private $_productCollection;
private $_mailChimpSyncE;

/**
* Data constructor.
Expand All @@ -106,7 +106,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
* @param \Magento\Customer\Model\ResourceModel\CustomerRepository $customer
* @param \Ebizmarts\MailChimp\Model\MailChimpErrors $mailChimpErrors
* @param \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerceFactory $mailChimpSyncEcommerce
* @param \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection
* @param \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce $mailChimpSyncE
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
Expand All @@ -119,7 +119,7 @@ public function __construct(
\Magento\Customer\Model\ResourceModel\CustomerRepository $customer,
\Ebizmarts\MailChimp\Model\MailChimpErrors $mailChimpErrors,
\Ebizmarts\MailChimp\Model\MailChimpSyncEcommerceFactory $mailChimpSyncEcommerce,
\Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection
\Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce $mailChimpSyncE
) {

$this->_storeManager = $storeManager;
Expand All @@ -133,7 +133,7 @@ public function __construct(
$this->_customer = $customer;
$this->_mailChimpErrors = $mailChimpErrors;
$this->_mailChimpSyncEcommerce = $mailChimpSyncEcommerce;
$this->_productCollection = $productCollection;
$this->_mailChimpSyncE = $mailChimpSyncE;
parent::__construct($context);
}

Expand Down Expand Up @@ -474,10 +474,9 @@ public function resetErrors()
$tableName = $this->_mailChimpErrors->getResource()->getMainTable();
$connection->truncateTable($tableName);
// clean the syncecommerce table with errors
$connection = $this->_mailChimpSyncEcommerce->getResource()->getConnection();
$tableName = $this->_mailChimpSyncEcommerce->getResource()->getMainTable();
$connection = $this->_mailChimpSyncE->getResource()->getConnection();
$tableName = $this->_mailChimpSyncE->getResource()->getMainTable();
$connection->truncateTable($tableName);
// clean the error in eav for customers
} catch(\Zend_Db_Exception $e) {
throw new ValidatorException(__($e->getMessage()));
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"description": "Connect MailChimp with Magento",
"type": "magento2-module",
"version": "1.0.2",
"version": "1.0.3",
"authors": [
{
"name": "Ebizmarts Corp",
Expand Down

0 comments on commit b9eecb3

Please sign in to comment.