Skip to content

Commit

Permalink
Merge pull request #17 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4 develop
  • Loading branch information
HuyPhuc98 authored Jun 29, 2023
2 parents 7f16917 + 86a4939 commit f4dfd75
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
8 changes: 8 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,12 @@ public function getInlineButtonSize($storeId = null)
{
return $this->getModuleConfig(self::CONFIG_INLINE . 'button_size', $storeId);
}

/**
* @return bool
*/
public function checkDailyDealEnable()
{
return $this->_moduleManager->isOutputEnabled('Mageplaza_DailyDeal');
}
}
4 changes: 3 additions & 1 deletion Model/System/Config/Source/FloatCmsPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function getOptionHash()
$cmsPages = [];

foreach ($pages as $page) {
$cmsPages[$page->getId()] = $page->getTitle();
if ($page->isActive()){
$cmsPages[$page->getId()] = $page->getTitle();
}
}

return $cmsPages;
Expand Down
39 changes: 30 additions & 9 deletions Model/System/Config/Source/InlineApplyFor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace Mageplaza\SocialShare\Model\System\Config\Source;

use Mageplaza\SocialShare\Helper\Data as HelperData;

/**
* Class InlineApplyFor
* @package Mageplaza\SocialShare\Model\System\Config\Source
Expand All @@ -35,19 +37,38 @@ class InlineApplyFor extends OptionArray
const DAILYDEAL_FEATUREDDEALS = 'dailydeal_featureddeals';
const DAILYDEAL_NEWDEALS = 'dailydeal_newdeals';

/**
* @var HelperData
*/
protected $_helperData;

public function __construct(HelperData $helperData)
{
$this->_helperData = $helperData;
}

/**
* @return array
*/
public function getOptionHash()
{
return [
self::HOME_PAGE => __('Home Page'),
self::CATEGORY_PAGE => __('Categories Page'),
self::PRODUCT_PAGE => __('Products Page'),
self::DAILYDEAL_ALLDEALS => __('Daily Deal All Deals Page'),
self::DAILYDEAL_BESTSELLERDEALS => __('Daily Deal Bestseller Deals Page'),
self::DAILYDEAL_FEATUREDDEALS => __('Daily Deal Featured Deals Page'),
self::DAILYDEAL_NEWDEALS => __('Daily Deal New Deals Page'),
];
if (!$this->_helperData->checkDailyDealEnable()) {
$pages = [
self::HOME_PAGE => __('Home Page'),
self::CATEGORY_PAGE => __('Categories Page'),
self::PRODUCT_PAGE => __('Products Page')
];
} else {
$pages = [
self::HOME_PAGE => __('Home Page'),
self::CATEGORY_PAGE => __('Categories Page'),
self::PRODUCT_PAGE => __('Products Page'),
self::DAILYDEAL_ALLDEALS => __('Daily Deal All Deals Page'),
self::DAILYDEAL_BESTSELLERDEALS => __('Daily Deal Bestseller Deals Page'),
self::DAILYDEAL_FEATUREDDEALS => __('Daily Deal Featured Deals Page'),
self::DAILYDEAL_NEWDEALS => __('Daily Deal New Deals Page'),
];
}
return $pages;
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "mageplaza/module-social-share",
"description": "Magento 2 Social Share Extension",
"require": {
"mageplaza/module-core": "^1.5.0"
"mageplaza/module-core": "^1.5.3"
},
"type": "magento2-module",
"version": "4.0.2",
"version": "4.0.3",
"license": "proprietary",
"authors": [
{
Expand Down
8 changes: 6 additions & 2 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Right,Right
"Categories Page","Categories Page"
"Contact Us","Contact Us"
"Home Page","Home Page"
"Daily Deal All Deals Page","Daily Deal All Deals Page"
"Daily Deal Bestseller Deals Page","Daily Deal Bestseller Deals Page"
"Daily Deal Featured Deals Page","Daily Deal Featured Deals Page"
"Daily Deal New Deals Page","Daily Deal New Deals Page"
"Top Content","Top Content"
"Bottom Content","Bottom Content"
Horizontal,Horizontal
Expand All @@ -26,9 +30,9 @@ Vertical,Vertical
Enable,Enable
"Select <b>Yes</b> to enable this module.<br />
1. It helps to reduce abandonment cart with <a href=""https://www.mageplaza.com/magento-2-one-step-checkout-extension/"" target=""_blank"">One Step Checkout</a>. <br />
2. <a href=""https://pages.mageplaza.com/abandoned-cart-email-templates-for-magento/?utm_source=configuration&utm_campaign=m2-bannerslider"" target=""_blank"">How to setup abandoned cart email series</a>","Select <b>Yes</b> to enable this module.<br />
2. Magento stores see upwards of 30% revenue 💰 with AVADA. <a href=""https://go.avada.io/mageplaza"">Learn more</a>","Select <b>Yes</b> to enable this module.<br />
1. It helps to reduce abandonment cart with <a href=""https://www.mageplaza.com/magento-2-one-step-checkout-extension/"" target=""_blank"">One Step Checkout</a>. <br />
2. <a href=""https://pages.mageplaza.com/abandoned-cart-email-templates-for-magento/?utm_source=configuration&utm_campaign=m2-bannerslider"" target=""_blank"">How to setup abandoned cart email series</a>"
2. Magento stores see upwards of 30% revenue 💰 with AVADA. <a href=""https://go.avada.io/mageplaza"">Learn more</a>"
"Icon Color","Icon Color"
"Only apply for default icon","Only apply for default icon"
"Custom Icon Color","Custom Icon Color"
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/socialshare.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<?php endif;?>
<?= /* @noEscape */ $block->getFloatPosition()?>
<?= /* @noEscape */ $block->getBackgroundColor()?>
z-index: 10;
z-index: 9999;
}

<?php if (!$block->isVerticalStyle($block->getFloatStyle())):?>
Expand Down

0 comments on commit f4dfd75

Please sign in to comment.