Skip to content

Commit

Permalink
select only necessary fields for products #1391 for magento 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed May 19, 2022
1 parent 5c0edf3 commit e2fd4c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Model/Api/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function _sendProducts($magentoStoreId)
$collection = $this->_getCollection();
$collection->addFieldToFilter("type_id", ["nin"=>[\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, "grouped"]]);
$collection->addStoreFilter($magentoStoreId);
$collection->getSelect()->reset(\Zend_Db_Select::COLUMNS)->columns(['entity_id']);
$collection->getSelect()->joinLeft(
['m4m' => $this->_helper->getTableName('mailchimp_sync_ecommerce')],
"m4m.related_id = e.entity_id and m4m.type = '".\Ebizmarts\MailChimp\Helper\Data::IS_PRODUCT.
Expand All @@ -139,6 +140,7 @@ public function _sendProducts($magentoStoreId)
$this->_helper->getMCMinSyncDateFlag().
"' and m4m.mailchimp_sync_modified = 1)");
$collection->getSelect()->limit(self::MAX);

foreach ($collection as $item) {
/**
* @var $product \Magento\Catalog\Model\Product
Expand Down

0 comments on commit e2fd4c9

Please sign in to comment.