Skip to content

Commit

Permalink
Merge pull request #56 from manaftryzens/fix/new-version-4016
Browse files Browse the repository at this point in the history
New version 4.0.16 with fixes for post installation check
  • Loading branch information
LiorGingi authored Jan 30, 2022
2 parents 4c974dd + 5fd8917 commit 6b2b4bb
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Config extends CoreConfig
*/
protected $smsBumpConfig = [
'checkout_sync_active' => ['path' => 'yotpo_core/sync_settings/checkout_sync/enable'],
'checkout_sync_allowed_urls' => ['path' => 'yotpo_core/sync_settings/checkout_sync/allowed_urls'],
'checkout_last_sync_time' => ['path' =>
'yotpo_core/sync_settings/checkout_sync/last_sync_time',
'read_from_db' => true
Expand Down
6 changes: 6 additions & 0 deletions Plugin/Quote/Model/Cart/CartTotalRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public function afterGet(
) {
$currentUrl = $this->urlInterface->getCurrentUrl();
$allowedUrls = ['/shipping-information','/totals'];
$allowedUrlsFromConfig = $this->yotpoSmsConfig->getConfig('checkout_sync_allowed_urls');
if ($allowedUrlsFromConfig) {
$allowedUrlConfigValues = explode(',', $allowedUrlsFromConfig);
$allowedUrlConfigValues = array_map('trim', $allowedUrlConfigValues);
$allowedUrls = array_merge($allowedUrls, $allowedUrlConfigValues);
}
$disAllowedUrls = ['/totals-information', '/checkout/cart/'];
$urlFound = false;
foreach ($disAllowedUrls as $disAllowedUrl) {
Expand Down
3 changes: 2 additions & 1 deletion Setup/Patch/Data/CustomCustomerAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Yotpo\SmsBump\Setup\Patch\Data;

use Yotpo\Core\Model\CustomCustomerAttribute as CoreCustomCustomerAttribute;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
Expand All @@ -12,7 +13,7 @@
* Class CustomCustomerAttribute
* Add custom attribute to customer
*/
class CustomCustomerAttribute implements DataPatchInterface
class CustomCustomerAttribute extends CoreCustomCustomerAttribute implements DataPatchInterface
{
/**
* @var ModuleDataSetupInterface
Expand Down
3 changes: 2 additions & 1 deletion Setup/Patch/Data/CustomCustomerAttributeSmsMarketing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Yotpo\SmsBump\Setup\Patch\Data;

use Yotpo\Core\Model\CustomCustomerAttributeSmsMarketing as CoreCustomCustomerAttributeSmsMarketing;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
Expand All @@ -12,7 +13,7 @@
* Class CustomCustomerAttributeMarketing
* Add custom attribute to customer
*/
class CustomCustomerAttributeSmsMarketing implements DataPatchInterface
class CustomCustomerAttributeSmsMarketing extends CoreCustomCustomerAttributeSmsMarketing implements DataPatchInterface
{
/**
* @var ModuleDataSetupInterface
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "yotpo/module-yotpo-messaging",
"description": "Yotpo Sms extension for Magento2",
"version": "4.0.15",
"version": "4.0.16",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~5.6.0|^7.0",
"magento/framework": ">=102.0.0",
"yotpo/module-yotpo-core": "4.0.15"
"yotpo/module-yotpo-core": "4.0.16"
},
"type": "magento2-module",
"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
<label>Enable sync:</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="allowed_urls" translate="label" type="text" sortOrder="695" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Allowed URLs</label>
<comment><![CDATA[Add any customized checkout url, if checkout sync is not triggering as expected. E.g, /save-shipping, /shipping-address]]></comment>
</field>
<field id="download_logs" translate="label" type="label" sortOrder="700" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Yotpo\SmsBump\Block\Adminhtml\System\Config\Form\Field\Link\DownloadCheckoutLogs</frontend_model>
</field>
Expand Down
6 changes: 6 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@
<argument name="customersProcessor" xsi:type="object">Yotpo\SmsBump\Model\Sync\Customers\Processor</argument>
</arguments>
</type>
<type name="Yotpo\Core\Model\System\Message\CustomSystemMessage">
<arguments>
<argument name="customCustomerAttribute" xsi:type="object">Yotpo\SmsBump\Setup\Patch\Data\CustomCustomerAttribute</argument>
<argument name="customCustomerAttributeSmsMarketing" xsi:type="object">Yotpo\SmsBump\Setup\Patch\Data\CustomCustomerAttributeSmsMarketing</argument>
</arguments>
</type>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Yotpo_SmsBump" setup_version="4.0.15">
<module name="Yotpo_SmsBump" setup_version="4.0.16">
<sequence>
<Yotpo_Core/>
</sequence>
Expand Down

0 comments on commit 6b2b4bb

Please sign in to comment.