Commit c8ca81e4 by lmf

评论详情增加图片查看幻灯模式

恢复购物流程
parent 2d6aedf2
......@@ -10,6 +10,6 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Amasty_AdvancedReview::vendor/fancybox/jquery.fancybox.min.css"/>
<css src="Amasty_AdvancedReview::vendor/fancybox/fancybox.css"/>
</head>
</page>
......@@ -39,7 +39,7 @@ $collection = $block->getCollection();
<script>
require([
"jquery",
"Amasty_AdvancedReview/vendor/fancybox/jquery.fancybox.min"
"Amasty_AdvancedReview/vendor/fancybox/fancybox.umd"
], function ($) {
$('[data-amreview-js="review-image"]').fancybox();
});
......
......@@ -11,7 +11,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Amasty_Base::vendor/slick/amslick.min.css"/>
<css src="Amasty_AdvancedReview::vendor/fancybox/jquery.fancybox.min.css"/>
<css src="Amasty_AdvancedReview::vendor/fancybox/fancybox.css"/>
</head>
<body>
<referenceContainer name="content">
......
......@@ -11,6 +11,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Amasty_Base::vendor/slick/amslick.min.css"/>
<css src="Amasty_AdvancedReview::vendor/fancybox/jquery.fancybox.min.css"/>
<css src="Amasty_AdvancedReview::vendor/fancybox/fancybox.css"/>
</head>
</page>
......@@ -16,9 +16,10 @@ $collection = $block->getCollection();
data-amreview-js="review-images">
<?php foreach ($collection as $item): ?>
<div class="amreview-slider-item" data-amreview-js="slider-item">
<a href="<?= $block->escapeHtml($block->getFullImagePath($item)) ?>"
<a data-fancybox="gallery"
data-info="Description#2" href="<?= $block->escapeHtml($block->getFullImagePath($item)) ?>"
class="amreview-image-link fancybox"
data-fancybox="amreview-image-group-<?= /* @noEscape */ $block->getReviewId() ?>">
>
<img class="amreview-image"
src="<?= /* @noEscape */ $block->getResizedImagePath($item);?>"
title="<?= $block->escapeHtml(__('Review image')); ?>"
......@@ -42,3 +43,11 @@ $collection = $block->getCollection();
</style>
<?php endif;?>
<?php endif;?>
<style type="text/css">
.amreview-review-wrapper .amreview-slider-item{
width: 110px;
}
.amreview-review-wrapper .amreview-slider-item .amreview-image{
width: 110px;
}
</style>
......@@ -2,7 +2,7 @@ define([
'jquery',
'Magento_Ui/js/modal/modal',
'Amasty_Base/vendor/slick/slick.min',
'Amasty_AdvancedReview/vendor/fancybox/jquery.fancybox.min',
'Amasty_AdvancedReview/vendor/fancybox/fancybox.umdn',
], function ($) {
'use strict';
......
define([
'jquery',
'Magento_Ui/js/modal/modal',
'Amasty_AdvancedReview/vendor/fancybox/jquery.fancybox.min',
'Amasty_AdvancedReview/vendor/fancybox/fancybox.umd',
'mage/cookies'
], function ($, modal, fancybox) {
'use strict';
......
......@@ -132,7 +132,7 @@ Remove,Remove
"Ship To:","Ship To:"
edit,edit
"Order Summary","Order Summary"
"View and Edit Cart","View and Edit Cart"
"View and Edit Cart","View Cart"
"View Details","View Details"
"Field ","Field "
" is required."," is required."
......
......@@ -7,7 +7,6 @@
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="page.bottom.container" remove="true"/>
<referenceContainer name="content">
<block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false">
<arguments>
......@@ -210,7 +209,6 @@
</item>
</item>
<item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
<item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item>
</item>
......
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
var config = {
config: {
mixins: {
'Magento_Theme/js/view/messages': {
'Magento_Checkout/js/view/messages-mixin': true
},
'Magento_Checkout/js/view/summary/abstract-total': {
'Magento_Checkout/js/view/summary/abstract-total-mixin': true
},
'Magento_Checkout/js/view/shipping': {
'Magento_Checkout/js/view/shipping-mixin': true
}
}
}
};
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var \Magento\Framework\View\Element\AbstractBlock $block
*/
// We should use strlen function because coupon code could be "0", converted to bool will lead to false
$hasCouponCode = (bool) strlen($block->getCouponCode());
?>
<div class="block discount"
id="block-discount"
data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}'
>
<div class="content" data-role="content" aria-labelledby="block-discount-heading" style="display: block;">
<form id="discount-coupon-form"
action="<?= $block->escapeUrl($block->getUrl('checkout/cart/couponPost')) ?>"
method="post"
data-mage-init='{"discountCode":{"couponCodeSelector": "#coupon_code",
"removeCouponSelector": "#remove-coupon",
"applyButton": "button.action.apply",
"cancelButton": "button.action.cancel"}}'>
<div class="fieldset coupon<?= $hasCouponCode ? ' applied' : '' ?>">
<input type="hidden" name="remove" id="remove-coupon" value="0" />
<div class="field" style="width: 65%;">
<label for="coupon_code" class="label"><span><?= $block->escapeHtml(__('Enter discount code')) ?></span></label>
<div class="control" style="float: left;margin-top: 0px;margin-right: 2px;width: 100%;">
<input type="text"
class="input-text"
id="coupon_code"
name="coupon_code"
value="<?= $block->escapeHtmlAttr($block->getCouponCode()) ?>"
placeholder="<?= $block->escapeHtmlAttr(__('Enter discount code')) ?>"
<?php if ($hasCouponCode) :?>
disabled="disabled"
<?php endif; ?>
/>
</div>
</div>
<div class="actions-toolbar" style="clear: none;">
<?php if (!$hasCouponCode) :?>
<div class="primary">
<button class="action apply primary" type="button" value="<?= $block->escapeHtmlAttr(__('Apply Discount')) ?>">
<span><?= $block->escapeHtml(__('Apply Discount')) ?></span>
</button>
</div>
<?php else :?>
<div class="primary">
<button type="button" class="action cancel primary" style="padding: 0.5rem 1rem;" value="<?= $block->escapeHtmlAttr(__('Cancel Coupon')) ?>"><span><?= $block->escapeHtml(__('Cancel Coupon')) ?></span></button>
</div>
<?php endif; ?>
</div>
</div>
<?php if (!$hasCouponCode) : ?>
<?= /* @noEscape */ $block->getChildHtml('captcha') ?>
<?php endif; ?>
</form>
</div>
</div>
<script>
require([
'jquery'
], function ($) {
});
</script>
......@@ -6,7 +6,7 @@
/** @var $block \Magento\Checkout\Block\Cart */
?>
<div class="cart-empty">
<div class="cart-empty" style="min-height: 500px;">
<?= $block->getChildHtml('checkout_cart_empty_widget') ?>
<div class="empty-img"><img src="<?= $block->getViewFileUrl('Magento_Checkout::images/empty-cart.svg');?>" /></div>
<p class="empty-message"><?= $block->escapeHtml(__('You shopping cart is currently empty.')) ?></p>
......
......@@ -24,7 +24,7 @@ use Magento\Framework\Escaper;
class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>"
<?php if ($block->isDisabled()): ?>
disabled="disabled"
<?php endif; ?> style=" background: #0000; height: 50px;font-size: 22px;text-transform: uppercase;font-weight: 400;padding: 14px 0 19px 0;">
<?php endif; ?> style=" background: #0000; height: 40px;font-size: 22px;text-transform: uppercase;font-weight: 400;padding: 14px 0 19px 0;">
<span data-v-20221108="" class="secure"><img data-v-b14bd780="" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAA3CAYAAAClxaIBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZ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oSSuKvrRlX/UWShrY52G7npoIkMvJrVD6CJZ43aYfJogJ4HSQgRMgxY/2dF52KloOlnKy7YJfjfwTYAD0328CQiS8EQAAAABJRU5ErkJggg=="></span>
<span><?= $escaper->escapeHtml(__('Checkout Now')) ?></span>
</button>
......
define([
'jquery',
'uiComponent',
'Magento_Customer/js/customer-data',
'underscore',
'escaper'
], function (customerData) {
'use strict';
return function (target) {
return target.extend({
/**
* Extends Component object by storage observable messages.
*/
initialize: function () {
this._super();
function hideMessage(){
require(['jquery', 'jquery/jquery-storageapi'], function($) {
$.cookieStorage.set('mage-messages', '');
});
}
setTimeout(hideMessage,5000);
jQuery('.messages').delay(5000).fadeOut('slow');
}
});
}
});
\ No newline at end of file
define([
'Magento_Checkout/js/model/cart/estimate-service'
], function (estimateService) {
'use strict';
var mixin = {
initialize: function () {
this._super();
}
};
return function (target) {
return target.extend(mixin);
};
});
\ No newline at end of file
define([
], function () {
'use strict';
return function (Component) {
return Component.extend({
isFullMode: function () {
var result = this._super();
if (!this.getTotals()) {
return false;
}
return true;
}
});
};
});
\ No newline at end of file
......@@ -54,29 +54,7 @@
<each args="getRegion('subtotalContainer')" render=""></each>
</div>
<div class="actions" if="getCartParam('possible_onepage_checkout')">
<div class="primary">
<button
id="top-cart-btn-checkout"
type="button"
class="action primary checkout"
data-action="close"
data-bind="
attr: {
title: $t('Proceed to Checkout')
},
click: closeMinicart()
"
translate="'Proceed to Checkout'" style="background: #ffa800;">
</button>
<div data-bind="html: getCartParamUnsanitizedHtml('extra_actions')" style="display: none;"></div>
</div>
</div>
</if>
<ifnot args="getCartParam('summary_count')">
<strong class="subtitle empty"
translate="'You have no items in your shopping cart.'"></strong>
......@@ -91,10 +69,9 @@
</div>
</if>
</ifnot>
<div class="actions" if="getCartParam('summary_count')">
<div class="secondary">
<a class="action viewcart" data-bind="attr: {href: shoppingCartUrl}">
<div class="secondary" style="background: #ffa800;width: 100%;color: #fff;font-size: 18px;height: 35px;">
<a class="action viewcart" data-bind="attr: {href: shoppingCartUrl}" style="vertical-align: sub;color: #ffff;">
<span translate="'View and Edit Cart'"></span>
</a>
</div>
......
......@@ -72,8 +72,7 @@
<div class="actions-toolbar" id="shipping-method-buttons-container">
<div class="primary">
<button data-role="opc-continue" type="submit" class="button action continue primary">
<span data-v-20221108="" class="secure"><img data-v-b14bd780="" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAA3CAYAAAClxaIBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMyODNDODA2MkIwNTExRUNCNUFCRkFGMzY4RjkyOTdCIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkO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GAdDNUBjBNMTQucpfb75HvUL5cMoTOC8LHru8gySl51ijx8NVghcND0Nh6EqLOOAkD1yQNkM7Z6wa/0ktdQqcMzARnHcrQ2CoPCqtKiffQNZCssNcvESWUJwvcD1WYWWptveCWnqxQ6AFSJ+d/HXuigfM7obReYcAXcm9cAV8F5S6D4YrZlqL/dqMhPplMwXh4CHIke4PGToLgepFiDwQ0SSYrPgC8kZiZkl1MjBVcy9c0UKGS2t8qcUOahVZrpOKzNQ2QMlRMxEqc+AR65ZCCgbQwDNzmKVzpkGWbwovvpISBATxOdJUOTFUT/UGzgpHzLibKwzBwTHRv0f71D8iVnPZoihwNrjpc3wPGai7fKS+2S5z4dw+DYsU11eWg+qlhjANLZvKQMTEYdCgaKQtaE+nqksyEESOTOgeb+RxNNrRIR/kwJFkzjGg3ly13jiQ/PR63IqtFfpxjm7zsiITy/DzHTuHMiG6IyIjCNkulgs5hfBqvdON8MEBb5DmqlUyNhqgnlvlgoMnoOTM3ImGCVKGYAHMTpVEzdE+tzDAapi3iKg8MPDN6ztG1k9pmmA9AX8CiQ/w2zfp32EB4ZyQefXGKshn1itPoSSuKvrRlX/UWShrY52G7npoIkMvJrVD6CJZ43aYfJogJ4HSQgRMgxY/2dF52KloOlnKy7YJfjfwTYAD0328CQiS8EQAAAABJRU5ErkJggg=="></span>
<span translate="'PLACE ORDER'" style="vertical-align: super;"/>
<span translate="'Next'" />
</button>
</div>
</div>
......
......@@ -920,7 +920,7 @@ footer{
@media(min-width: 640px){
.switcher.currency{
position: absolute;
top: 30px;
top: 20px;
right: 145px;
z-index: 1;
font-size: 13px;
......@@ -2287,6 +2287,16 @@ tr.grand.totals {
}
@media(max-width: 1024px) {
.payment-method-content{
font-size: 14px;
color: darkblue;
margin-top: -15px;
}
.amreview-images.slick-slider .slick-slide {
width: 100px !important;
}
.item-options dt.label{margin-right: 10px;}
dl.item-options{font-size: 12px;}
.amreview-review-wrapper.review-item{
padding: 0px;
}
......@@ -2397,6 +2407,9 @@ tr.grand.totals {
@media(min-width: 1024px) {
.amreview-images.slick-slider .slick-slide {
width: 200px !important;
}
.cart.item .item-info td.col.item {
width: 60%;
}
......@@ -2416,6 +2429,10 @@ tr.grand.totals {
margin-left: 10%;
}
.product-reviews-summary{
float: right;
margin-left: 70%;
......@@ -2484,4 +2501,9 @@ button.primary.action.create {
background: #000;
}
.slick-list.draggable .slick-track {
width: 100% !important;
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5b32d8725a620fa542a680503d480986",
"content-hash": "29cabf37a1ac686d49544a0cb5aaa6e7",
"packages": [
{
"name": "airwallex/payments-plugin-magento",
......@@ -6480,6 +6480,31 @@
"time": "2022-08-31T10:31:18+00:00"
},
{
"name": "sparsh/magento-2-advanced-sorting-extension",
"version": "1.3.0",
"dist": {
"type": "zip",
"url": "https://repo.magento.com/archives/sparsh/magento-2-advanced-sorting-extension/sparsh-magento-2-advanced-sorting-extension-1.3.0.0.zip",
"shasum": "e73d7dd19c088f427f72db5bd4c03836202aa304"
},
"require": {
"php": "~7.0.13|~7.1.0|~7.2.0|~7.3.0|~7.4.0|^8.0"
},
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Sparsh\\AdvancedSorting\\": ""
}
},
"license": [
"OSL-3.0"
],
"description": "Sparsh Advanced Sorting for Magento 2"
},
{
"name": "spomky-labs/aes-key-wrap",
"version": "v6.0.0",
"source": {
......
......@@ -140,5 +140,6 @@ return array(
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => $vendorDir . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
'550719157da16285530f4f2ca5eee610' => $vendorDir . '/sparsh/magento-2-advanced-sorting-extension/registration.php',
'27a5783f6a5e8d8d1a4f54dff608a187' => $baseDir . '/app/etc/NonComposerComponentRegistration.php',
);
......@@ -44,6 +44,7 @@ return array(
'Swissup\\Rtl\\' => array($vendorDir . '/swissup/module-rtl'),
'Swissup\\Breeze\\' => array($vendorDir . '/swissup/module-breeze'),
'Swissup\\BreezeIntegrations\\' => array($vendorDir . '/swissup/module-breeze-integrations'),
'Sparsh\\AdvancedSorting\\' => array($vendorDir . '/sparsh/magento-2-advanced-sorting-extension'),
'Seld\\PharUtils\\' => array($vendorDir . '/seld/phar-utils/src'),
'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'),
'Safe\\' => array($vendorDir . '/thecodingmachine/safe/lib', $vendorDir . '/thecodingmachine/safe/deprecated', $vendorDir . '/thecodingmachine/safe/generated'),
......
......@@ -141,6 +141,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => __DIR__ . '/..' . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
'550719157da16285530f4f2ca5eee610' => __DIR__ . '/..' . '/sparsh/magento-2-advanced-sorting-extension/registration.php',
'27a5783f6a5e8d8d1a4f54dff608a187' => __DIR__ . '/../..' . '/app/etc/NonComposerComponentRegistration.php',
);
......@@ -197,6 +198,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'Swissup\\Rtl\\' => 12,
'Swissup\\Breeze\\' => 15,
'Swissup\\BreezeIntegrations\\' => 27,
'Sparsh\\AdvancedSorting\\' => 23,
'Seld\\PharUtils\\' => 15,
'Seld\\JsonLint\\' => 14,
'Safe\\' => 5,
......@@ -524,6 +526,10 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
array (
0 => __DIR__ . '/..' . '/swissup/module-breeze-integrations',
),
'Sparsh\\AdvancedSorting\\' =>
array (
0 => __DIR__ . '/..' . '/sparsh/magento-2-advanced-sorting-extension',
),
'Seld\\PharUtils\\' =>
array (
0 => __DIR__ . '/..' . '/seld/phar-utils/src',
......
......@@ -11059,6 +11059,34 @@
"install-path": "../seld/phar-utils"
},
{
"name": "sparsh/magento-2-advanced-sorting-extension",
"version": "1.3.0",
"version_normalized": "1.3.0.0",
"dist": {
"type": "zip",
"url": "https://repo.magento.com/archives/sparsh/magento-2-advanced-sorting-extension/sparsh-magento-2-advanced-sorting-extension-1.3.0.0.zip",
"shasum": "e73d7dd19c088f427f72db5bd4c03836202aa304"
},
"require": {
"php": "~7.0.13|~7.1.0|~7.2.0|~7.3.0|~7.4.0|^8.0"
},
"type": "magento2-module",
"installation-source": "dist",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Sparsh\\AdvancedSorting\\": ""
}
},
"license": [
"OSL-3.0"
],
"description": "Sparsh Advanced Sorting for Magento 2",
"install-path": "../sparsh/magento-2-advanced-sorting-extension"
},
{
"name": "spomky-labs/aes-key-wrap",
"version": "v6.0.0",
"version_normalized": "6.0.0.0",
......
......@@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'c5782803e86afdd01eda85af4ba6279f106ab8df',
'reference' => 'aa151b3790b9ffbf345a885f0b2152bbb0af129b',
'name' => 'magento/magento2ce',
'dev' => true,
),
......@@ -1015,7 +1015,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'c5782803e86afdd01eda85af4ba6279f106ab8df',
'reference' => 'aa151b3790b9ffbf345a885f0b2152bbb0af129b',
'dev_requirement' => false,
),
'magento/module-admin-analytics' => array(
......@@ -2877,6 +2877,15 @@
'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c',
'dev_requirement' => false,
),
'sparsh/magento-2-advanced-sorting-extension' => array(
'pretty_version' => '1.3.0',
'version' => '1.3.0.0',
'type' => 'magento2-module',
'install_path' => __DIR__ . '/../sparsh/magento-2-advanced-sorting-extension',
'aliases' => array(),
'reference' => NULL,
'dev_requirement' => false,
),
'spomky-labs/aes-key-wrap' => array(
'pretty_version' => 'v6.0.0',
'version' => '6.0.0.0',
......
<?php
/**
* Class Toolbar
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
namespace Sparsh\AdvancedSorting\Block\Product\ProductList;
/**
* Class Toolbar
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar
{
/**
* Set collection to sorting option
*
* @param \Magento\Framework\Data\Collection $collection
*
* @return $this
*/
public function setCollection($collection)
{
$this->_collection = $collection;
$this->_collection->setCurPage($this->getCurrentPage());
$limit = (int)$this->getLimit();
if ($limit) {
$this->_collection->setPageSize($limit);
}
if ($this->getCurrentOrder()) {
switch ($this->getCurrentOrder()) {
case 'created_at':
$this->_collection->setOrder('created_at', $this->getCurrentDirectionReverse());
break;
case 'best_seller':
$this->_collection->setOrder('best_seller', $this->getCurrentDirectionReverse());
break;
case 'most_viewed':
$this->_collection->setOrder('top_rated', $this->getCurrentDirectionReverse());
break;
default:
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
break;
}
}
return $this;
}
/**
* Return Reverse direction of current direction
*
* @return string
*/
public function getCurrentDirectionReverse()
{
if ($this->getCurrentDirection() == 'asc') {
return 'desc';
} elseif ($this->getCurrentDirection() == 'desc') {
return 'asc';
} else {
return $this->getCurrentDirection();
}
}
}
<?php
/**
* Class Indexer
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
namespace Sparsh\AdvancedSorting\Model\Indexer;
/**
* Class Index
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
class Index implements \Magento\Framework\Indexer\ActionInterface, \Magento\Framework\Mview\ActionInterface
{
/**
* @var \Magento\Framework\App\ResourceConnection
*/
protected $_resource;
/**
* @var \Magento\Catalog\Model\ResourceModel\Product\Action
*/
private $action;
/**
* @var \Magento\Framework\DB\Adapter\AdapterInterface
*/
protected $_connection;
/**
* Index constructor.
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Catalog\Model\ResourceModel\Product\Action $action
*/
public function __construct(
\Magento\Framework\App\ResourceConnection $resource,
\Magento\Catalog\Model\ResourceModel\Product\Action $action
)
{
$this->_resource = $resource;
$this->action = $action;
}
/*
* Used by mview, allows process indexer in the "Update on schedule" mode
*/
public function execute($ids){
$this->executeFull();
}
/*
* Will take all of the data and reindex
* Will run when reindex via command line
*/
public function executeFull(){
$connection = $this->_getConnection();
$select = $connection->select()
->from(
['soi' => $this->_resource->getTableName('sales_order_item')],
[
'product_id' => 'product_id',
'best_seller' => 'SUM(qty_ordered)'
]
)
->join(
['cpe' => $this->_resource->getTableName('catalog_product_entity')],
'cpe.entity_id = soi.product_id'
)
->group('soi.product_id');
$data = $connection->fetchAll($select);
foreach ($data as $item) {
$this->action->updateAttributes(
[$item['product_id']],
['best_seller' => $item['best_seller']],
0);
}
$select = $connection->select()
->from(
['res' => $this->_resource->getTableName('review_entity_summary')],
[
'product_id' => 'entity_pk_value',
'top_rated' => 'rating_summary'
]
)
->join(
['cpe' => $this->_resource->getTableName('catalog_product_entity')],
'cpe.entity_id = res.entity_pk_value'
)
->group('res.entity_pk_value');
$data = $connection->fetchAll($select);
foreach ($data as $item) {
$this->action->updateAttributes(
[$item['product_id']],
['top_rated' => $item['top_rated']],
0);
}
$select = $connection->select()
->from(
['rvpi' => $this->_resource->getTableName('report_viewed_product_index')],
[
'product_id' => 'product_id',
'most_viewed' => 'COUNT(rvpi.product_id)'
]
)
->join(
['cpe' => $this->_resource->getTableName('catalog_product_entity')],
'cpe.entity_id = rvpi.product_id'
)
->group('rvpi.product_id');
$data = $connection->fetchAll($select);
foreach ($data as $item) {
$this->action->updateAttributes(
[$item['product_id']],
['most_viewed' => $item['most_viewed']],
0);
}
$select = $connection->select()
->from(
['res' => $this->_resource->getTableName('review_entity_summary')],
[
'product_id' => 'entity_pk_value',
'review_count' => 'reviews_count'
]
)
->join(
['cpe' => $this->_resource->getTableName('catalog_product_entity')],
'cpe.entity_id = res.entity_pk_value'
)
->group('res.entity_pk_value');
$data = $connection->fetchAll($select);
foreach ($data as $item) {
$this->action->updateAttributes(
[$item['product_id']],
['review_count' => $item['review_count']],
0);
}
}
/**
* Retrieve connection instance
*
* @return bool|\Magento\Framework\DB\Adapter\AdapterInterface
*/
protected function _getConnection()
{
if (null === $this->_connection) {
$this->_connection = $this->_resource->getConnection();
}
return $this->_connection;
}
/*
* Works with a set of entity changed (may be massaction)
*/
public function executeList(array $ids){
$this->executeFull();
}
/*
* Works in runtime for a single entity using plugins
*/
public function executeRow($id){
$this->executeFull();
}
}
<?php
/**
* Class SortType
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
namespace Sparsh\AdvancedSorting\Model\System;
use Magento\Framework\Option\ArrayInterface;
/**
* Class SortType
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
class SortType implements ArrayInterface
{
const BEST_SELLER = "best_seller";
const TOP_RATED = "top_rated";
const NEW_ARRIVALS = "created_at";
const MOST_VIEWED = "most_viewed";
const REVIEW_COUNT = "review_count";
/**
* Return array of options as value-label pairs
*
* @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
*/
public function toOptionArray()
{
$options = [];
foreach ($this->getOptionHash() as $value => $label) {
$options[] = [
'value' => $value,
'label' => $label
];
}
return $options;
}
/**
* Return options
*
* @return array
*/
public function getOptionHash()
{
return [
self::BEST_SELLER => __('Best Seller'),
self::TOP_RATED => __('Top Rated'),
self::NEW_ARRIVALS => __('New Arrivals'),
self::MOST_VIEWED => __('Most Viewed'),
self::REVIEW_COUNT => __('Review Count'),
];
}
}
<?php
/**
* Class AddSortOption
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
namespace Sparsh\AdvancedSorting\Plugin;
use Sparsh\AdvancedSorting\Model\System\SortType;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\StoreManagerInterface;
/**
* Class AddSortOption
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
class AddSortOption extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
* StoreManager
*
* @var StoreManagerInterface
*/
public $storeManager;
/**
* SortType
*
* @var array
*/
public $SortType;
/**
* AddSortOption constructor.
*
* @param Context $context
* @param StoreManagerInterface $storeManager
* @param SortType $SortType
*/
public function __construct(
Context $context,
StoreManagerInterface $storeManager,
SortType $SortType
) {
$this->storeManager = $storeManager;
$this->SortType = $SortType->toOptionArray();
parent::__construct($context);
}
/**
* Add sort order option created_at to frontend
*
* @param \Magento\Catalog\Model\Config $configmodel
* @param array $options
*
* @return mixed
*/
public function afterGetAttributeUsedForSortByArray($configmodel, $options)
{
$isEnabled = $this->scopeConfig->getValue(
'sparshadvancedsorting/general/enabled',
ScopeInterface::SCOPE_STORE,
null
);
if ($isEnabled) {
$SortByList = $this->scopeConfig->getValue(
'sparshadvancedsorting/general/selectsort',
ScopeInterface::SCOPE_STORE,
null
);
foreach ($this->SortType as $optionlist) {
if (isset($options[$optionlist['value']])) {
unset($options[$optionlist['value']]);
}
}
unset($options['created_at']);
foreach (explode(',', $SortByList) as $items) {
foreach ($this->SortType as $optionlist) {
if (in_array($items, $optionlist)) {
$options[$optionlist['value']] = $optionlist['label']->getText();
}
}
}
}
return $options;
}
}
##Sparsh Advanced Sorting Extension
Advanced Sorting extension allows customers to sort products by Best Sellers, Top Rated, New Arrivals, Most Viewed, and Reviews Count options on catalog listing page.
##Support:
version - 2.3.x, 2.4.x
##How to install Extension
1. Download the archive file.
2. Unzip the files
3. Create a folder [Magento_Root]/app/code/Sparsh/AdvancedSorting
4. Drop/move the unzipped files to directory '[Magento_Root]/app/code/Sparsh/AdvancedSorting'
#Enable Extension:
- php bin/magento module:enable Sparsh_AdvancedSorting
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento setup:static-content:deploy
- php bin/magento cache:flush
#Disable Extension:
- php bin/magento module:disable Sparsh_AdvancedSorting
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento setup:static-content:deploy
- php bin/magento cache:flush
<?php
/**
* Class AddEavAttribute
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
namespace Sparsh\AdvancedSorting\Setup\Patch\Data;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchRevertableInterface;
use Magento\Eav\Setup\EavSetupFactory;
class AddEavAttribute
implements DataPatchInterface,
PatchRevertableInterface
{
/**
* Eav setup factory
*
* @var EavSetupFactory
*/
private $eavSetupFactory;
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
/**
* @param ModuleDataSetupInterface $moduleDataSetup
*/
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
EavSetupFactory $eavSetupFactory
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->eavSetupFactory = $eavSetupFactory;
}
/**
* @inheritdoc
*/
public function apply()
{
$this->moduleDataSetup->getConnection()->startSetup();
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'review_count',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Review Count',
'input' => 'text',
'class' => '',
'source' => '',
'global'=> \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => false,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_for_sort_by' => true,
'unique' => false,
'apply_to' => ''
]
);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'best_seller',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Best Seller',
'input' => 'text',
'class' => '',
'source' => '',
'global'=> \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => false,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_for_sort_by' => true,
'unique' => false,
'apply_to' => ''
]
);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'top_rated',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Top Rated',
'input' => 'text',
'class' => '',
'source' => '',
'global'=> \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => false,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_for_sort_by' => true,
'unique' => false,
'apply_to' => ''
]
);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'most_viewed',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Most Viewed',
'input' => 'text',
'class' => '',
'source' => '',
'global'=> \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => false,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_for_sort_by' => true,
'unique' => false,
'apply_to' => ''
]
);
$eavSetup->updateAttribute( \Magento\Catalog\Model\Product::ENTITY, 'created_at', 'used_for_sort_by', 1);
$this->moduleDataSetup->getConnection()->endSetup();
}
/**
* @inheritdoc
*/
public static function getDependencies()
{
return [
];
}
/**
* @inheritdoc
*/
public function revert()
{
$this->moduleDataSetup->getConnection()->startSetup();
$this->moduleDataSetup->getConnection()->endSetup();
}
/**
* @inheritdoc
*/
public function getAliases()
{
/**
* This internal Magento method, that means that some patches with time can change their names,
* but changing name should not affect installation process, that's why if we will change name of the patch
* we will add alias here
*/
return [];
}
}
\ No newline at end of file
{
"name": "sparsh/magento-2-advanced-sorting-extension",
"description": "Sparsh Advanced Sorting for Magento 2",
"type": "magento2-module",
"version": "1.3.0",
"license": "OSL-3.0",
"require": {
"php": "~7.0.13|~7.1.0|~7.2.0|~7.3.0|~7.4.0|^8.0"
},
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Sparsh\\AdvancedSorting\\": ""
}
}
}
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="sparsh" translate="label" sortOrder="500">
<label>Sparsh Extensions</label>
</tab>
<section id="sparshadvancedsorting" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Advanced Sorting</label>
<tab>sparsh</tab>
<resource>Sparsh_AdvancedSorting::configuration</resource>
<group id="general" translate="label comment" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General Configuration</label>
<field id="enabled" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Select <strong>Yes</strong> to enable this module]]></comment>
</field>
<field id="selectsort" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<source_model>Sparsh\AdvancedSorting\Model\System\SortType</source_model>
<label>Select Catalog Sort Type</label>
<depends>
<field id="enabled">1</field>
</depends>
</field>
</group>
</section>
</system>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<sparshadvancedsorting>
<general>
<enabled>1</enabled>
<selectsort>best_seller,top_rated,created_at,most_viewed,review_count</selectsort>
</general>
</sparshadvancedsorting>
</default>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Config">
<plugin name="sortoption" type="Sparsh\AdvancedSorting\Plugin\AddSortOption" />
</type>
<preference for="Magento\Catalog\Block\Product\ProductList\Toolbar" type="Sparsh\AdvancedSorting\Block\Product\ProductList\Toolbar" />
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
<indexer id="sparsh_advanced_sorting_indexer" view_id="sparsh_advanced_sorting_indexer" class="Sparsh\AdvancedSorting\Model\Indexer\Index">
<title translate="true">Sparsh Advanced Sorting</title>
<description translate="true">Advanced Sorting Indexer</description>
</indexer>
</config>
<?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="Sparsh_AdvancedSorting" setup_version="1.3.0">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Mview/etc/mview.xsd">
<view id="sparsh_advanced_sorting_indexer" class="Sparsh\AdvancedSorting\Model\Indexer\Index" group="indexer" />
</config>
<?php
/**
* Sparsh AdvancedSorting
*
* PHP version 7
*
* @category Sparsh
* @package Sparsh_AdvancedSorting
* @author Sparsh <magento@sparsh-technologies.com>
* @license https://www.sparsh-technologies.com Open Software License (OSL 3.0)
* @link https://www.sparsh-technologies.com
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Sparsh_AdvancedSorting',
__DIR__
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment