Skip to content

Commit 381c0a2

Browse files
zlikdahcsguy
andauthored
Remove choosing feed methods (#216) (#248)
* remove configs for inventory sync and incremental update; they will be on by default * remove choosing feed method * remove choosing feed method * remove choosing feed method * fix test * remove feed method in config.xml Co-authored-by: Wayne Zhang <[email protected]>
1 parent 128f0e4 commit 381c0a2

File tree

4 files changed

+1
-34
lines changed

4 files changed

+1
-34
lines changed

app/code/Meta/BusinessExtension/Model/System/Config.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class Config
5656
private const XML_PATH_FACEBOOK_BUSINESS_EXTENSION_STORE = 'facebook/business_extension/store';
5757

5858
private const XML_PATH_FACEBOOK_DAILY_PRODUCT_FEED = 'facebook/catalog_management/daily_product_feed';
59-
private const XML_PATH_FACEBOOK_FEED_UPLOAD_METHOD = 'facebook/catalog_management/feed_upload_method';
6059
private const XML_PATH_FACEBOOK_PRODUCT_IDENTIFIER = 'facebook/catalog_management/product_identifier';
6160
private const XML_PATH_FACEBOOK_PRICE_INCL_TAX = 'facebook/catalog_management/price_incl_tax';
6261
private const XML_PATH_FACEBOOK_COLLECTIONS_SYNC_IS_ACTIVE = 'facebook/catalog_management/collections_sync';
@@ -765,18 +764,6 @@ public function isActiveDailyProductFeed($scopeId = null, $scope = ScopeInterfac
765764
return (bool)$this->getConfig(self::XML_PATH_FACEBOOK_DAILY_PRODUCT_FEED, $scopeId, $scope);
766765
}
767766

768-
/**
769-
* Get feed upload method
770-
*
771-
* @param int $scopeId
772-
* @param string $scope
773-
* @return mixed
774-
*/
775-
public function getFeedUploadMethod($scopeId = null, $scope = ScopeInterface::SCOPE_STORES)
776-
{
777-
return $this->getConfig(self::XML_PATH_FACEBOOK_FEED_UPLOAD_METHOD, $scopeId, $scope);
778-
}
779-
780767
/**
781768
* Get feed id
782769
*

app/code/Meta/Catalog/Model/Product/Feed/Uploader.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
namespace Meta\Catalog\Model\Product\Feed;
1919

2020
use Exception;
21-
use Meta\Catalog\Model\Config\Source\FeedUploadMethod;
2221
use Meta\Catalog\Model\Product\Feed\Method\BatchApi as MethodBatchApi;
2322
use Meta\Catalog\Model\Product\Feed\Method\FeedApi as MethodFeedApi;
2423
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
@@ -66,20 +65,7 @@ public function __construct(
6665
*/
6766
public function uploadFullCatalog($storeId = null)
6867
{
69-
$uploadMethod = $this->systemConfig->getFeedUploadMethod($storeId);
70-
71-
if ($uploadMethod === FeedUploadMethod::UPLOAD_METHOD_CATALOG_BATCH_API) {
72-
try {
73-
$response = $this->methodBatchApi->generateProductRequestData($storeId);
74-
} catch (Exception $e) {
75-
throw new LocalizedException(__($e->getMessage()));
76-
}
77-
} elseif ($uploadMethod === FeedUploadMethod::UPLOAD_METHOD_FEED_API) {
78-
$response = $this->methodFeedApi->execute($storeId);
79-
} else {
80-
throw new LocalizedException(__('Unknown feed upload method'));
81-
}
82-
return $response;
68+
return $this->methodFeedApi->execute($storeId);
8369
}
8470

8571
/**

app/code/Meta/Catalog/etc/adminhtml/system.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1515
<comment>Scheduled full catalog upload</comment>
1616
</field>
17-
<field id="feed_upload_method" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="1">
18-
<label>Feed Upload Method</label>
19-
<config_path>facebook/catalog_management/feed_upload_method</config_path>
20-
<source_model>Meta\Catalog\Model\Config\Source\FeedUploadMethod</source_model>
21-
</field>
2217
<field id="product_feed" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="1">
2318
<label>Push Products</label>
2419
<frontend_model>Meta\Catalog\Block\Adminhtml\System\Config\ProductFeed</frontend_model>

app/code/Meta/Catalog/etc/config.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<facebook>
55
<catalog_management>
66
<daily_product_feed>0</daily_product_feed>
7-
<feed_upload_method>feed_api</feed_upload_method>
87
<incremental_product_updates>0</incremental_product_updates>
98
<price_incl_tax>0</price_incl_tax>
109
<collections_sync>0</collections_sync>

0 commit comments

Comments
 (0)