The createDataFeedForSalesChannelId
method in the Future of Social Shipping
feature explicitly supports only Facebook/Instagram and Google Shopping. The relevant code is as follows:
public function createDataFeedForSalesChannelId(string $socialShoppingSalesChannelId, Context $context): void
{
$criteria = new Criteria([$socialShoppingSalesChannelId]);
$criteria->addAssociation('salesChannel');
$socialShoppingSalesChannel = $this->socialShoppingSalesChannelRepository->search($criteria, $context)->first();
if ($socialShoppingSalesChannel === null) {
throw new SocialShoppingSalesChannelNotFoundException($socialShoppingSalesChannelId);
}
$network = $socialShoppingSalesChannel->getNetwork();
switch ($network) {
case Facebook::class:
case Instagram::class:
$this->upsertFacebookDataFeed([], $context, $socialShoppingSalesChannel);
break;
case GoogleShopping::class:
$this->upsertGoogleShoppingDataFeed([], $context, $socialShoppingSalesChannel);
break;
}
}
The switch
statement does not include cases for Product comparison. This results in the scheduled task generating feeds only for Facebook/Instagram or Google Shopping, leaving other platforms unsupported.
Steps to Reproduce:
- Set up a sales channel for a network other than Facebook/Instagram or Google Shopping.
- Run the scheduled task to generate feeds.
- Observe that no feed is generated for the unsupported network.
Expected Behavior: Feeds should be generated for all configured networks, provided the necessary implementation exists for those networks.
Actual Behavior: Feeds are generated only for Facebook/Instagram and Google Shopping.
Suggested Fix: Add cases for Product comparison in the switch
statement, similar to how Facebook and Google Shopping are handled. Alternatively, throw a clear exception for unsupported networks to inform users that the functionality is currently limited.