STEP-13 Final, bugfixes

Finalizing Extension

STEP-13

During the development, I made several mistakes. If you haven't noticed, it is not possible to disable social sharing on pages, let’s fix it, toghether with labels miss match issue in configurations.

  1. social_share.xml let’s put labels accordingly to id’s at the correct order

ScandiPWA/SocialShareGraphQl/etc/adminhtml/system/social_share.xml line 31 - 39
<field id="category_page" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Display On Category Page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="product_page" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Display On Product Page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>

2. DataProvider.php wrong config path

ScandiPWA/SocialShareGraphQl/Helper/DataProvider.php line 22 - 26
const HOME_PAGE = 'home_page';
const CATEGORY_PAGE = 'category_page';
const PRODUCT_PAGE = 'product_page';
  1. CategoryPageComponent.plugin.js and ProductActionComponent.plugin.js wrong condition

CategoryPageComponent.plugin.js
ProductActionComponent.plugin.js
CategoryPageComponent.plugin.js
scandipwa-socialshare/src/plugin/CategoryPageComponent.plugin.js line 39 - 41
if (!enabled || !categoryPage) {
return null;
}
ProductActionComponent.plugin.js
scandipwa-socialshare/src/plugin/ProductActionComponent.plugin.js line 25 -27
if (!enabled || !productPage) {
return null;
}

Congrats)))