Skip to content

Commit fd02155

Browse files
authored
Merge branch 'main' into remove-dependency
2 parents df5c0f9 + b701c46 commit fd02155

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

app/code/Meta/Catalog/Model/Category/CategoryCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ private function updateCategoryWithFBRequestJson(
435435
'method' => 'POST',
436436
'relative_url' => $setId,
437437
'body' => http_build_query([
438-
'name' => $this->categoryUtilities->getCategoryPathName($category, $storeId, $isVisibleOnMeta),
438+
'name' => $category->getName(),
439439
'filter' => $this->categoryUtilities->getCategoryProductFilter($products),
440440
'metadata' => $this->categoryUtilities->getCategoryMetaData($category),
441441
'retailer_id' => $category->getId(),

app/code/Meta/Catalog/Model/Product/Feed/ProductRetriever/Configurable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace Meta\Catalog\Model\Product\Feed\ProductRetriever;
2222

2323
use Magento\Catalog\Api\ProductRepositoryInterface;
24-
use Magento\Catalog\Model\Product\Visibility;
24+
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;
2525
use Magento\Framework\Api\SearchCriteriaBuilder;
2626
use Meta\BusinessExtension\Helper\FBEHelper;
2727
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
@@ -119,6 +119,7 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
119119
{
120120
$storeId = $this->storeId ?? $this->fbeHelper->getStore()->getId();
121121

122+
/** @var ProductCollection $configurableCollection */
122123
$configurableCollection = $this->productCollectionFactory->create();
123124
$configurableCollection->addAttributeToSelect('*')
124125
->addAttributeToFilter([
@@ -132,6 +133,7 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
132133
]
133134
], null, 'left')
134135
->addAttributeToFilter('type_id', ConfigurableType::TYPE_CODE)
136+
->addMediaGalleryData()
135137
->addStoreFilter($storeId)
136138
->setStoreId($storeId);
137139

app/code/Meta/Catalog/Model/Product/Feed/ProductRetriever/Other.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
use Magento\Catalog\Api\ProductRepositoryInterface;
2424
use Magento\Catalog\Model\Product\Visibility;
25+
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;
2526
use Magento\Framework\Api\SearchCriteriaBuilder;
2627
use Meta\BusinessExtension\Helper\FBEHelper;
2728
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
@@ -114,6 +115,7 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
114115

115116
$storeId = $this->storeId ?? $this->fbeHelper->getStore()->getId();
116117

118+
/** @var ProductCollection $collection */
117119
$collection = $this->productCollectionFactory->create();
118120
$collection->addAttributeToSelect('*')
119121
->addAttributeToFilter('visibility', ['neq' => Visibility::VISIBILITY_NOT_VISIBLE])
@@ -139,6 +141,7 @@ public function retrieve($offset = 1, $limit = self::LIMIT): array
139141
'neq' => SimpleType::TYPE_SIMPLE
140142
],
141143
], null, 'left')
144+
->addMediaGalleryData()
142145
->addStoreFilter($storeId)
143146
->setStoreId($storeId);
144147

app/code/Meta/Catalog/Model/Product/Feed/ProductRetriever/Simple.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace Meta\Catalog\Model\Product\Feed\ProductRetriever;
2222

2323
use Magento\Catalog\Api\ProductRepositoryInterface;
24-
use Magento\Catalog\Model\Product\Visibility;
24+
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;
2525
use Magento\Framework\Api\SearchCriteriaBuilder;
2626
use Meta\BusinessExtension\Helper\FBEHelper;
2727
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
@@ -113,6 +113,7 @@ public function retrieve($offset = 1, $limit = null): array
113113
}
114114
$storeId = $this->storeId ?? $this->fbeHelper->getStore()->getId();
115115

116+
/** @var ProductCollection $collection */
116117
$collection = $this->productCollectionFactory->create();
117118
$collection->addAttributeToSelect('*')
118119
->addAttributeToFilter([
@@ -126,6 +127,7 @@ public function retrieve($offset = 1, $limit = null): array
126127
]
127128
], null, 'left')
128129
->addAttributeToFilter('type_id', ProductType::TYPE_SIMPLE)
130+
->addMediaGalleryData()
129131
->addStoreFilter($storeId)
130132
->setStoreId($storeId);
131133

app/code/Meta/Conversion/Observer/Common.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Meta\Conversion\Observer;
56

67
use Magento\Framework\Json\Helper\Data as JsonHelper;
78
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
89
use Magento\Framework\Stdlib\CookieManagerInterface;
10+
use Magento\Cookie\Helper\Cookie as CookieHelper;
911

1012
/**
1113
* Set cookie with payload data for event pixel
@@ -29,21 +31,29 @@ class Common
2931
*/
3032
private CookieManagerInterface $cookieManager;
3133

34+
/**
35+
* @var CookieHelper
36+
*/
37+
private CookieHelper $cookieHelper;
38+
3239
/**
3340
* Constructor common
3441
*
3542
* @param CookieManagerInterface $cookieManager
3643
* @param CookieMetadataFactory $cookieMetadataFactory
3744
* @param JsonHelper $jsonHelper
45+
* @param CookieHelper $cookieHelper
3846
*/
3947
public function __construct(
4048
CookieManagerInterface $cookieManager,
4149
CookieMetadataFactory $cookieMetadataFactory,
42-
JsonHelper $jsonHelper
50+
JsonHelper $jsonHelper,
51+
CookieHelper $cookieHelper
4352
) {
4453
$this->cookieManager = $cookieManager;
4554
$this->cookieMetadataFactory = $cookieMetadataFactory;
4655
$this->jsonHelper = $jsonHelper;
56+
$this->cookieHelper = $cookieHelper;
4757
}
4858

4959
/**
@@ -58,6 +68,12 @@ public function __construct(
5868
*/
5969
public function setCookieForMetaPixel($cookieName, $dataForMetaPixel)
6070
{
71+
if ($this->cookieHelper->isCookieRestrictionModeEnabled()
72+
&& $this->cookieHelper->isUserNotAllowSaveCookie()
73+
) {
74+
return;
75+
}
76+
6177
$publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
6278
->setDuration(3600)
6379
->setPath('/')

0 commit comments

Comments
 (0)