Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Added option to disable facebook tracking on selected stores #142

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Helper/LogOrganization.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public static function organizeLogs() {
}

$countCrit = 0;

fclose($fp);
}
fclose($fp);

$amuLogs = self::tailCustom("var/log/facebook-business-extension.log", 100);
$amuLogsArr = explode("\n", $amuLogs);
Expand Down
8 changes: 8 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<label>Business Extension</label>
<tab>facebook</tab>
<resource>Facebook_BusinessExtension::system_config</resource>
<group id="general" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General</label>
<field id="enable" translate="label comment" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Module</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Disables ProductInfoForAddToCart call</comment>
</field>
</group>
<group id="catalog_management" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Catalog Management</label>
<field id="product_feed" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
2 changes: 2 additions & 0 deletions view/frontend/layout/catalog_category_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
<body>
<referenceBlock name="head.additional">
<block class="Facebook\BusinessExtension\Block\Pixel\AddToCart"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.add_to_cart"
template="Facebook_BusinessExtension::pixel/add_to_cart.phtml"
before="-" />
</referenceBlock>
<referenceContainer name="before.body.end">
<block class="Facebook\BusinessExtension\Block\Pixel\ViewCategory"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.view_category"
template="Facebook_BusinessExtension::pixel/view_category.phtml"
before="-" />
Expand Down
2 changes: 2 additions & 0 deletions view/frontend/layout/catalog_product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<body>
<referenceBlock name="head.additional">
<block class="Facebook\BusinessExtension\Block\Pixel\AddToCart"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.add_to_cart"
template="Facebook_BusinessExtension::pixel/add_to_cart.phtml"
before="-" />
</referenceBlock>
<referenceContainer name="before.body.end">
<block class="Facebook\BusinessExtension\Block\Pixel\ViewContent"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.view_content"
template="Facebook_BusinessExtension::pixel/view_content.phtml"
before="-" />
Expand Down
1 change: 1 addition & 0 deletions view/frontend/layout/catalogsearch_result_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<body>
<referenceContainer name="before.body.end">
<block class="Facebook\BusinessExtension\Block\Pixel\Search"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.search"
template="Facebook_BusinessExtension::pixel/search.phtml"
before="-" />
Expand Down
1 change: 1 addition & 0 deletions view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<body>
<referenceContainer name="before.body.end">
<block class="Facebook\BusinessExtension\Block\Pixel\InitiateCheckout"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.initate_checkout"
template="Facebook_BusinessExtension::pixel/initiate_checkout.phtml"
before="-" />
Expand Down
1 change: 1 addition & 0 deletions view/frontend/layout/checkout_onepage_success.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<body>
<referenceContainer name="before.body.end">
<block class="Facebook\BusinessExtension\Block\Pixel\Purchase"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.purchase"
template="Facebook_BusinessExtension::pixel/purchase.phtml"
before="-" />
Expand Down
1 change: 1 addition & 0 deletions view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<body>
<referenceBlock name="head.additional">
<block class="Facebook\BusinessExtension\Block\Pixel\Head"
ifconfig="facebook_business_extension/general/enable"
name="fbe.pixel.header"
template="Facebook_BusinessExtension::pixel/head.phtml"
before="-" />
Expand Down