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. 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
1
<field id="category_page" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
2
<label>Display On Category Page</label>
3
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
4
</field>
5
6
<field id="product_page" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0">
7
<label>Display On Product Page</label>
8
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
9
</field>
Copied!
2. DataProvider.php wrong config path
ScandiPWA/SocialShareGraphQl/Helper/DataProvider.php line 22 - 26
1
const HOME_PAGE = 'home_page';
2
3
const CATEGORY_PAGE = 'category_page';
4
5
const PRODUCT_PAGE = 'product_page';
Copied!
  1. 1.
    CategoryPageComponent.plugin.js and ProductActionComponent.plugin.js wrong condition
CategoryPageComponent.plugin.js
ProductActionComponent.plugin.js
scandipwa-socialshare/src/plugin/CategoryPageComponent.plugin.js line 39 - 41
1
if (!enabled || !categoryPage) {
2
return null;
3
}
Copied!
scandipwa-socialshare/src/plugin/ProductActionComponent.plugin.js line 25 -27
1
2
if (!enabled || !productPage) {
3
return null;
4
}
Copied!
Congrats)))
Copy link