Skip to content

Commit

Permalink
Merge pull request #1068 from mailchimp/Issue1065-2.3
Browse files Browse the repository at this point in the history
closes #1065 for magento 2.3
  • Loading branch information
gonzaloebiz authored Oct 12, 2020
2 parents ef6d3e2 + 841dfe8 commit 8fe0f3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Controller/Cart/Loadquote.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function execute()
),
['mc_cid'=> $params['mc_cid']]
);
$quote->setData('mailchimp_campaign_id', $params['mc_cid']);
} else {
$url = $this->_urlHelper->getUrl(
$this->_helper->getConfigValue(
Expand All @@ -132,6 +133,7 @@ public function execute()
);
}
$quote->setData('mailchimp_abandonedcart_flag', true);

$quote->getResource()->save($quote);
if (!$quote->getCustomerId()) {
$this->_checkoutSession->setQuoteId($quote->getId());
Expand Down
2 changes: 1 addition & 1 deletion Model/Api/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected function _getModifiedQuotes($mailchimpStoreId, $magentoStoreId)
// be sure that the quotes are already in mailchimp and not deleted
$modifiedCarts->getSelect()->where(
"(m4m.mailchimp_sync_deleted is null or m4m.mailchimp_sync_deleted = 0)".
" AND m4m.mailchimp_sync_delta < main_table.updated_at"
" AND m4m.mailchimp_sync_modified = 1"
);
// limit the collection
$modifiedCarts->getSelect()->limit(self::BATCH_LIMIT);
Expand Down
14 changes: 14 additions & 0 deletions Model/Plugin/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,19 @@ public function beforeBeforeSave(\Magento\Quote\Model\Quote $quote)
if ($mailchimp_landing_page) {
$quote->setData('mailchimp_landing_page', $mailchimp_landing_page);
}
$mailchimpStoreId = $this->_helper->getConfigValue(
\Ebizmarts\MailChimp\Helper\Data::XML_MAILCHIMP_STORE,
$quote->getStoreId()
);
$this->_helper->saveEcommerceData(
$mailchimpStoreId,
$quote->getId(),
\Ebizmarts\MailChimp\Helper\Data::IS_QUOTE,
null,
0,
1,
0,
null
);
}
}

0 comments on commit 8fe0f3c

Please sign in to comment.