From 67b9c61b0ebea7a3f59a95b9f6d226171f59ab85 Mon Sep 17 00:00:00 2001 From: linhnv Date: Mon, 9 May 2022 10:36:07 +0700 Subject: [PATCH 1/8] -- Clear Code --- view/frontend/templates/cart/button.phtml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/view/frontend/templates/cart/button.phtml b/view/frontend/templates/cart/button.phtml index a7033f7..d1ebead 100644 --- a/view/frontend/templates/cart/button.phtml +++ b/view/frontend/templates/cart/button.phtml @@ -42,8 +42,7 @@ From 69d71522f8b8905a26f5482b3879a80e5a970ffc Mon Sep 17 00:00:00 2001 From: linhnv Date: Wed, 11 May 2022 15:26:05 +0700 Subject: [PATCH 2/8] --Clear Code --- view/frontend/templates/cart/button.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/frontend/templates/cart/button.phtml b/view/frontend/templates/cart/button.phtml index d1ebead..c53dc06 100644 --- a/view/frontend/templates/cart/button.phtml +++ b/view/frontend/templates/cart/button.phtml @@ -41,7 +41,7 @@ From 0676521a93ce5fc077d5ef79d5101683d2c891d9 Mon Sep 17 00:00:00 2001 From: linhnv Date: Tue, 28 Jun 2022 13:55:17 +0700 Subject: [PATCH 3/8] --Css responsive --- view/frontend/web/css/style.css | 206 ++++++++++++++++---------------- 1 file changed, 104 insertions(+), 102 deletions(-) diff --git a/view/frontend/web/css/style.css b/view/frontend/web/css/style.css index 67fb31d..533f3bb 100644 --- a/view/frontend/web/css/style.css +++ b/view/frontend/web/css/style.css @@ -1,102 +1,104 @@ -/** - * 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_ShareCart - * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) - * @license https://www.mageplaza.com/LICENSE.txt - */ -.actions .primary.sharecart { - margin: 0 10px 15px; -} - -button.action.primary.sharecart { - display: block; - width: 100%; - line-height: 2.2rem; - padding: 14px 17px; - font-size: 1.8rem; - margin: unset; -} - -.mp-sharecart-popup .modal-title { - border: none; - padding-bottom: 25px; -} - -.mp-sharecart-popup .modal-inner-wrap { - width: 600px; -} - -.mp-popup-cart { - display: none; -} - -#mp_show_download_share { - display: inline-block; -} - -.mp-tooltipped { - position: relative; -} - -.mp-tooltipped:before { - position: absolute; - z-index: 1000001; - display: none; - width: 0; - height: 0; - color: rgba(0, 0, 0, .8); - pointer-events: none; - content: ""; - border: 5px solid transparent; - top: auto; - right: 50%; - bottom: -5px; - margin-right: -5px; - border-bottom-color: rgba(0, 0, 0, .8) -} - -.mp-tooltipped:after { - position: absolute; - z-index: 1000000; - display: none; - padding: 5px 8px; - font: normal normal 11px/1.5 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; - color: #fff; - text-align: center; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-wrap: break-word; - white-space: pre; - pointer-events: none; - content: attr(aria-label); - background: rgba(0, 0, 0, .8); - border-radius: 3px; - -webkit-font-smoothing: subpixel-antialiased; - top: 100%; - right: 50%; - margin-top: 5px; - -webkit-transform: translateX(50%); - -ms-transform: translateX(50%); - transform: translateX(50%) -} - -.mp-tooltipped:hover:before, .mp-tooltipped:active:before, .mp-tooltipped:focus:before, -.mp-tooltipped:hover:after, .mp-tooltipped:active:after, .mp-tooltipped:focus:after { - display: inline-block; - text-decoration: none -} \ No newline at end of file +/** + * 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_ShareCart + * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) + * @license https://www.mageplaza.com/LICENSE.txt + */ +.actions .primary.sharecart { + margin: 0 10px 15px; +} +button, a.action.primary { + margin: 2px; +} +button.action.primary.sharecart { + display: block; + width: 100%; + line-height: 2.2rem; + padding: 14px 17px; + font-size: 1.8rem; + margin: unset; +} + +.mp-sharecart-popup .modal-title { + border: none; + padding-bottom: 25px; +} + +.mp-sharecart-popup .modal-inner-wrap { + width: 600px; +} + +.mp-popup-cart { + display: none; +} + +#mp_show_download_share { + display: inline-block; +} + +.mp-tooltipped { + position: relative; +} + +.mp-tooltipped:before { + position: absolute; + z-index: 1000001; + display: none; + width: 0; + height: 0; + color: rgba(0, 0, 0, .8); + pointer-events: none; + content: ""; + border: 5px solid transparent; + top: auto; + right: 50%; + bottom: -5px; + margin-right: -5px; + border-bottom-color: rgba(0, 0, 0, .8) +} + +.mp-tooltipped:after { + position: absolute; + z-index: 1000000; + display: none; + padding: 5px 8px; + font: normal normal 11px/1.5 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; + color: #fff; + text-align: center; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-wrap: break-word; + white-space: pre; + pointer-events: none; + content: attr(aria-label); + background: rgba(0, 0, 0, .8); + border-radius: 3px; + -webkit-font-smoothing: subpixel-antialiased; + top: 100%; + right: 50%; + margin-top: 5px; + -webkit-transform: translateX(50%); + -ms-transform: translateX(50%); + transform: translateX(50%) +} + +.mp-tooltipped:hover:before, .mp-tooltipped:active:before, .mp-tooltipped:focus:before, +.mp-tooltipped:hover:after, .mp-tooltipped:active:after, .mp-tooltipped:focus:after { + display: inline-block; + text-decoration: none +} From 8c2823551fb4b66f04116f7adbcbb8ba4b74fa8f Mon Sep 17 00:00:00 2001 From: linhnv Date: Tue, 28 Jun 2022 14:01:57 +0700 Subject: [PATCH 4/8] --remove tax in the price item product --- view/frontend/templates/cart/button.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/frontend/templates/cart/button.phtml b/view/frontend/templates/cart/button.phtml index c53dc06..e2651be 100644 --- a/view/frontend/templates/cart/button.phtml +++ b/view/frontend/templates/cart/button.phtml @@ -52,7 +52,7 @@ getProductType() === 'configurable'): ?> getQty() . ' x ' . $block->getNameConfigurable($item) . ' - ' . - $block->formatPrice($item->getBasePriceInclTax())) + $block->formatPrice($item->getBasePrice())) ?> getParentItemId() && $block->checkConfigurableProduct($item)): ?> @@ -61,7 +61,7 @@ getProductType() !== 'configurable'): ?> getQty() . ' x ' . $item->getName() . ' - ' . - $block->formatPrice($item->getBasePriceInclTax())) ?> + $block->formatPrice($item->getBasePrice())) ?>
From 990a3ff14821ce11e4a7878d3720205f43e22dc0 Mon Sep 17 00:00:00 2001 From: linhnv Date: Tue, 28 Jun 2022 14:11:33 +0700 Subject: [PATCH 5/8] --remove tax in the price item product --- view/frontend/templates/cart/items.phtml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/view/frontend/templates/cart/items.phtml b/view/frontend/templates/cart/items.phtml index 9d7f5b3..ec99468 100644 --- a/view/frontend/templates/cart/items.phtml +++ b/view/frontend/templates/cart/items.phtml @@ -38,8 +38,8 @@ $quote = $block->getData('quote'); getQty() ?> getSku() ?> getNameConfigurable($item) ?> - formatPrice($item->getBasePriceInclTax()) ?> - formatPrice($item->getBaseRowTotalInclTax()) ?> + formatPrice($item->getBasePrice()) ?> + formatPrice($item->getBaseRowTotal()) ?> getParentItemId() && $block->checkConfigurableProduct($item)): ?> @@ -50,8 +50,8 @@ $quote = $block->getData('quote'); getQty() ?> getSku() ?> getName() ?> - formatPrice($item->getBasePriceInclTax()) ?> - formatPrice($item->getBaseRowTotalInclTax()) ?> + formatPrice($item->getBasePrice()) ?> + formatPrice($item->getBaseRowTotal()) ?> From d157869b74754e79f57338c8a2f31b628b02e63a Mon Sep 17 00:00:00 2001 From: linhnv Date: Tue, 28 Jun 2022 14:39:55 +0700 Subject: [PATCH 6/8] --fix bug when disable module --- Controller/Index/Download.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Controller/Index/Download.php b/Controller/Index/Download.php index 3a4988c..f9b77c0 100644 --- a/Controller/Index/Download.php +++ b/Controller/Index/Download.php @@ -26,11 +26,13 @@ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Mageplaza\ShareCart\Api\ShareCartRepositoryInterface; +use Mageplaza\ShareCart\Helper\Data; use Mpdf\MpdfException; /** @@ -49,20 +51,28 @@ class Download extends Action */ protected $checkoutSession; + /** + * @var Data + */ + protected $helper; + /** * Download constructor. * * @param Context $context * @param ShareCartRepositoryInterface $printProcess * @param Session $checkoutSession + * @param Data $helper */ public function __construct( Context $context, ShareCartRepositoryInterface $printProcess, - Session $checkoutSession + Session $checkoutSession, + Data $helper ) { $this->printProcess = $printProcess; $this->checkoutSession = $checkoutSession; + $this->helper = $helper; parent::__construct($context); } @@ -76,6 +86,12 @@ public function __construct( */ public function execute() { + /** @var Redirect $resultRedirect */ + $resultRedirect = $this->resultRedirectFactory->create(); + if (!$this->helper->isEnabled()) { + $this->messageManager->addErrorMessage(__('The Share Cart extension is disable')); + return $resultRedirect->setPath('checkout/cart'); + } $mpShareCartToken = $this->checkoutSession->getQuote()->getMpShareCartToken(); $this->printProcess->downloadPdf($mpShareCartToken); From bebad846f5fc1eae1e677182f5519a4525c9e133 Mon Sep 17 00:00:00 2001 From: linhnv Date: Tue, 28 Jun 2022 15:05:23 +0700 Subject: [PATCH 7/8] --fix print Pdf --- Model/Template/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Template/Processor.php b/Model/Template/Processor.php index 6b6b9a6..6def552 100644 --- a/Model/Template/Processor.php +++ b/Model/Template/Processor.php @@ -117,7 +117,7 @@ public function processTemplate() $this->setUseAbsoluteLinks(true); $html = $processor->setStoreId($storeId) ->setDesignParams([0]) - ->filter(__($this->getTemplateHtml())); + ->filter((string)__($this->getTemplateHtml())); if ($isDesignApplied) { $this->cancelDesignConfig(); From f37f7eb4634b0e364d335859eea9e33c6048f82d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 6 Jul 2022 15:04:48 +0700 Subject: [PATCH 8/8] Clean code --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bc9cfaa..985efb5 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,10 @@ "description": "Magento 2 Share Cart extension", "type": "magento2-module", "require": { - "mageplaza/module-core": "^1.4.5", + "mageplaza/module-core": "^1.4.12", "mpdf/mpdf": "^7.1.0 | ^8.0.0" }, - "version": "4.0.3", + "version": "4.0.4", "license": "proprietary", "authors": [ {