Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code styling fixes #112

Open
wants to merge 5 commits into
base: master
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
2 changes: 1 addition & 1 deletion Model/Config/Source/ListOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function toOptionArray()
}, $result['lists']);

$default_value = [
self::LABEL => 'Select a list...',
self::LABEL => __('Select a list...'),
self::VALUE => 0
];
array_unshift($options, $default_value);
Expand Down
10 changes: 5 additions & 5 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<label>Custom Media URL</label>
<validate>validate-url</validate>
</field>
<field id="logger" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="logger" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Klaviyo Logger</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Log file is located under the standard log directory for your Magento app install. By default this will be {magento-root-directory}/var/log/klaviyo.log</comment>
Expand All @@ -46,7 +46,7 @@
<source_model>Klaviyo\Reclaim\Model\Config\Source\ListOptions</source_model>
<frontend_model>Klaviyo\Reclaim\Block\System\Config\Form\Field\Newsletter</frontend_model>
</field>
<field id="using_klaviyo_list_opt_in" translate="label" type="radios" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="using_klaviyo_list_opt_in" translate="label comment" type="radios" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Use Klaviyo Opt-In Settings For This List?</label>
<source_model>Klaviyo\Reclaim\Model\Config\Source\Radiobtn</source_model>
<comment>NOTE: There is a separate Magento opt-in setting for this list that can also send opt-in emails</comment>
Expand All @@ -60,7 +60,7 @@
<resource>Klaviyo_Reclaim::klaviyo_reclaim</resource>
<group id="email_consent" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Email</label>
<field id="is_active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="is_active" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Subscribe contacts to email marketing at checkout</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Adds a checkbox to the checkout page for email opt in</comment>
Expand Down Expand Up @@ -91,7 +91,7 @@
</group>
<group id="sms_consent" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>SMS</label>
<field id="is_active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="is_active" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Subscribe contacts to SMS marketing at checkout</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Adds a checkbox to the checkout page for SMS opt in. <a target="_blank" href="https://help.klaviyo.com/hc/en-us/articles/360039190611-On-Demand-Training-Getting-Started-with-Klaviyo-SMS">Set up SMS in Klaviyo</a>]]></comment>
Expand Down Expand Up @@ -153,7 +153,7 @@
<label>Webhook Secret</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="using_product_delete_before_webhook" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="using_product_delete_before_webhook" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Use Product Delete Webhook?</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>This will remove deleted products from the Klaviyo catalog.</comment>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/catalog_product_view.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="product.info.main">
<block name="klaviyo_reclaim.viewedproduct" class="Klaviyo\Reclaim\Block\Catalog\Product\ViewedProduct" before="-" template="product/viewed.phtml" />
<block name="klaviyo_reclaim.viewedproduct" class="Klaviyo\Reclaim\Block\Catalog\Product\ViewedProduct" before="-" template="Klaviyo_Reclaim::product/viewed.phtml" />
</referenceContainer>
</body>
</page>
2 changes: 1 addition & 1 deletion view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container">
<block class="Klaviyo\Reclaim\Block\Initialize" template="analytics/initialize.phtml" />
<block class="Klaviyo\Reclaim\Block\Initialize" template="Klaviyo_Reclaim::analytics/initialize.phtml" />
</referenceContainer>
</body>
</page>
4 changes: 2 additions & 2 deletions view/frontend/templates/analytics/initialize.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php $klaviyoKey = $this->getPublicApiKey(); ?>
<?php if ( $this->isKlaviyoEnabled() && $klaviyoKey ): ?>
<?php $klaviyoKey = $block->getPublicApiKey(); ?>
<?php if ( $block->isKlaviyoEnabled() && $klaviyoKey ): ?>
<script type="application/javascript" async
src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=<?= $block->escapeHtml($klaviyoKey); ?>"></script>

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/checkout/cart.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if ( $this->isKlaviyoEnabled() && $this->getPublicApiKey() ): ?>
<?php if ( $block->isKlaviyoEnabled() && $block->getPublicApiKey() ): ?>
<script>
require([
'jquery',
Expand Down