Skip to content

Commit

Permalink
Merge pull request #12 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
Merge branch '2.4-develop' into '2.4'
  • Loading branch information
bdtrung authored Mar 23, 2021
2 parents b8a5d20 + 277624a commit 130f2df
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Block/SocialShare.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function isAddMoreShare()
*/
public function getShareCounter($service)
{
$supportServices = ['facebook', 'pinterest', 'tumblr', 'a2a_dd'];
$supportServices = ['pinterest', 'tumblr', 'a2a_dd'];
if ($this->_helperData->isShareCounter() && in_array($service, $supportServices, true)) {
return 'a2a_counter';
}
Expand Down
52 changes: 26 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "mageplaza/module-social-share",
"description": "Magento 2 Social Share Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "1.0.2",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\SocialShare\\": ""
}
}
}
{
"name": "mageplaza/module-social-share",
"description": "Magento 2 Social Share Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "4.0.0",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\SocialShare\\": ""
}
}
}
6 changes: 5 additions & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Vertical,Vertical
"Social Share","Social Share"
"General Configuration","General Configuration"
Enable,Enable
"Select <strong>Yes</strong> to enable this module","Select <strong>Yes</strong> to enable this module"
"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 />
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>"
"Icon Color","Icon Color"
"Only apply for default icon","Only apply for default icon"
"Custom Icon Color","Custom Icon Color"
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 @@ -23,6 +23,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="https://static.addtoany.com/menu/page.js" src_type="url"/>
<script src="Mageplaza_SocialShare::js/thankskit.js"/>
</head>
<body>
<referenceContainer name="after.body.start">
Expand Down
22 changes: 12 additions & 10 deletions view/frontend/templates/socialshare.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

<?php /** @var \Mageplaza\SocialShare\Block\SocialShare $block */ ?>

<?php if ($block->isEnable()) : ?>
<?php if ($block->isThisPageEnable() && $block->isThisPositionEnable()) : ?>
<?php if ($block->isEnable()): ?>
<?php if ($block->isThisPageEnable() && $block->isThisPositionEnable()): ?>
<style type="text/css">
.a2a_svg, .a2a_count {
border-radius: <?= /* @noEscape */ $block->getBorderRadius()?> !important;
}

<?php if ($block->isDisplayInline()) :?>
<?php if ($block->isDisplayInline()):?>
.mp_social_share_inline, .mp_social_share_inline_under_cart {
display: flex;
border-radius: 7px;
Expand All @@ -40,24 +40,26 @@
.mp_social_share_inline {
width: fit-content;
justify-content: flex-end;
margin-top: -25px;
margin-bottom: 15px;
<?= $block->getPosition() === 'bottom_content' ? 'float: right;' : 'float: left;' ?>
}

.mp_social_share_inline_under_cart {
justify-content: flex-start;
float: left;
}
<?php else : ?>
<?php else: ?>
.mp_social_share_float {
<?php if ($block->isVerticalStyle($block->getFloatStyle())) : ?>
<?php if ($block->isVerticalStyle($block->getFloatStyle())): ?>
<?= /* @noEscape */ $block->getFloatMargin('top')?>
<?php endif;?>
<?= /* @noEscape */ $block->getFloatPosition()?>
<?= /* @noEscape */ $block->getBackgroundColor()?>
z-index: 10;
}

<?php if (!$block->isVerticalStyle($block->getFloatStyle())) :?>
<?php if (!$block->isVerticalStyle($block->getFloatStyle())):?>
.a2a_floating_style.a2a_default_style {
<?= /* @noEscape */ $block->getFloatMargin('bottom')?>
}
Expand All @@ -74,21 +76,21 @@
<?= /* @noEscape */ $block->getButtonSize() ?>
<?= /* @noEscape */ $block->getFloatStyle() ?>">

<?php foreach ($block->getEnableService() as $enableService) : ?>
<?php if ($block->isImageEnable($enableService)) : ?>
<?php foreach ($block->getEnableService() as $enableService): ?>
<?php if ($block->isImageEnable($enableService)): ?>
<a class="a2a_button_<?= /* @noEscape */ $enableService ?>
<?= /* @noEscape */ $block->getShareCounter($enableService) ?>">
<img src="<?= /* @noEscape */ $block->getImageUrl($enableService) ?>"
<?= /* @noEscape */ $block->setImageSize($block->getButtonSize()) ?>
alt="<?= /* @noEscape */ $enableService ?>">
</a>
<?php else : ?>
<?php else: ?>
<a class="a2a_button_<?= /* @noEscape */ $enableService ?>
<?= /* @noEscape */ $block->getShareCounter($enableService) ?>"></a>
<?php endif; ?>
<?php endforeach; ?>

<?php if ($block->isAddMoreShare()) : ?>
<?php if ($block->isAddMoreShare()): ?>
<a class="a2a_dd <?= /* @noEscape */ $block->getShareCounter('a2a_dd') ?>"
href="https://www.addtoany.com/share"></a>
<?php endif; ?>
Expand Down
62 changes: 62 additions & 0 deletions view/frontend/web/js/thankskit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_SocialShare
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

require([
'jquery'
], function ($) {
$(document).ready(function () {

var existCondition = setInterval(
function () {
if ($('#a2a_modal').css('display') === 'block') {
if ($('.a2a_button_facebook').length !== 0) {
$('#a2a_thanks_kit .a2a_button_facebook .a2a_s_facebook svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_facebook img').attr('src') + '" width="32" height="32" alt="facebook">');
$('#a2a_thanks_kit .a2a_button_facebook').css('height', '32px');
}

if ($('.a2a_button_twitter').length !== 0) {
$('#a2a_thanks_kit .a2a_button_twitter .a2a_s_twitter svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_twitter img').attr('src') + '" width="32" height="32" alt="twitter">');
$('#a2a_thanks_kit .a2a_button_twitter').css('height', '32px');
}

if ($('.a2a_button_facebook_messenger').length !== 0) {
$('#a2a_thanks_kit .a2a_button_facebook_messenger .a2a_s_facebook_messenger svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_facebook_messenger img').attr('src') + '" width="32" height="32" alt="facebook_messenger">');
$('#a2a_thanks_kit .a2a_button_facebook_messenger').css('height', '32px');
}

if ($('.a2a_button_pinterest').length !== 0) {
$('#a2a_thanks_kit .a2a_button_pinterest .a2a_s_pinterest svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_pinterest img').attr('src') + '" width="32" height="32" alt="pinterest">');
$('#a2a_thanks_kit .a2a_button_pinterest').css('height', '32px');
}

if ($('.a2a_button_linkedin').length !== 0) {
$('#a2a_thanks_kit .a2a_button_linkedin .a2a_s_linkedin svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_linkedin img').attr('src') + '" width="32" height="32" alt="linkedin">');
$('#a2a_thanks_kit .a2a_button_linkedin').css('height', '32px');
}

if ($('.a2a_button_tumblr').length !== 0) {
$('#a2a_thanks_kit .a2a_button_tumblr .a2a_s_tumblr svg').replaceWith('<img src="' + $('.a2a_kit .a2a_button_tumblr img').attr('src') + '" width="32" height="32" alt="tumblr">');
$('#a2a_thanks_kit .a2a_button_tumblr').css('height', '32px');
}
}
}, 400
);
});
});

0 comments on commit 130f2df

Please sign in to comment.