Commit 81e5e74a by lmf

恢复版本

parent 2d6aedf2
...@@ -7,7 +7,6 @@ ...@@ -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"> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body> <body>
<referenceBlock name="page.bottom.container" remove="true"/>
<referenceContainer name="content"> <referenceContainer name="content">
<block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false"> <block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false">
<arguments> <arguments>
...@@ -210,7 +209,6 @@ ...@@ -210,7 +209,6 @@
</item> </item>
</item> </item>
<item name="company" xsi:type="array"> <item name="company" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
<item name="validation" xsi:type="array"> <item name="validation" xsi:type="array">
<item name="min_text_length" xsi:type="number">0</item> <item name="min_text_length" xsi:type="number">0</item>
</item> </item>
......
...@@ -16,7 +16,7 @@ $hasCouponCode = (bool) strlen($block->getCouponCode()); ...@@ -16,7 +16,7 @@ $hasCouponCode = (bool) strlen($block->getCouponCode());
data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}' data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}'
> >
<div class="title" data-role="title"> <div class="title" data-role="title">
<strong id="block-discount-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Apply Discount Code')) ?></strong> <strong id="block-discount-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Apply Discount Code')) ?>11</strong>
</div> </div>
<div class="content" data-role="content" aria-labelledby="block-discount-heading"> <div class="content" data-role="content" aria-labelledby="block-discount-heading">
<form id="discount-coupon-form" <form id="discount-coupon-form"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="payment-option _collapsible opc-payment-additional discount-code" <div class="payment-option _collapsible opc-payment-additional discount-code"
data-bind="mageInit: {'collapsible':{'active':true, 'openedState': '_active'}}" data-collapsible="true"> data-bind="mageInit: {'collapsible':{'active':true, 'openedState': '_active'}}" data-collapsible="true">
<div class="payment-option-title field choice" data-role="title"> <div class="payment-option-title field choice" data-role="title">
<span class="action action-toggle" id="block-discount-heading" role="heading" aria-level="2"> <span class="action action-toggle" id="block-discount-heading" role="heading" aria-level="2">2222
<!-- ko i18n: 'Apply Discount Code'--><!-- /ko --> <!-- ko i18n: 'Apply Discount Code'--><!-- /ko -->
</span> </span>
</div> </div>
......
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="header.container" remove="true"/>
<referenceBlock name="global_notices" remove="true" />
<referenceContainer name="page.bottom.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="content">
<block class="Magento\Theme\Block\Html\Header\Logo" name="logo" before="checkout.cart">
<arguments>
<argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument>
<argument name="logo_size_resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.footer" template="Magento_Checkout::footer.phtml" />
</referenceContainer>
</body>
</page>
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Success Page</title>
</head>
<body>
<referenceBlock name="global_notices" remove="true" />
<referenceContainer name="page.bottom.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="page.messages" remove="true"/>
<referenceBlock name="page.main.title">
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success.print.button" template="Magento_Checkout::button.phtml"/>
<action method="setPageTitle">
<argument translate="true" name="title" xsi:type="string">Thank you for your purchase!</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="Magento_Checkout::success.phtml" cacheable="false">
<container name="order.success.additional.info" label="Order Success Additional Info"/>
</block>
<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="Magento_Checkout::registration.phtml" cacheable="false"/>
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.footer" template="Magento_Checkout::footer.phtml" />
</referenceContainer>
</body>
</page>
/**
* 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.
*/
?>
<style>
.logo {
margin-left: 40%;
margin-top: 10%;
}
a.logo>img{
margin-top: 5%;
width: 155px;
height: auto;
}
.cart-class{
margin-top: 3%;
margin-left: 9%;
margin-bottom: 2%;
}
.activation{
font-size: 20px;
font-width: 600;
margin-right: 20px;
margin-left: 20px;
}
.activation-no{
font-size: 14px;
margin-right: 20px;
margin-left: 20px;
color: #1b1b1b;
}
@media(max-width: 1024px){
.logo {
margin-left: 30%;
}
.cart-container{
margin-top: 0px;
}
span.action.nav-toggle {
display: none;
}
.page-main > .columns{
margin-top: 20px !important;
}
.activation {
color: darkblue;
font-size: 14px;
font-weight: 600;
margin-right: 2px;
margin-left: 2px;
}
.activation-no {
font-size: 10px;
margin-right: 2px;
margin-left: 2px;
color: slategray;
}
.cart-class {
margin-left: 0px;
}
form .actions-toolbar{
margin: 0px !important;
}
.checkout-cart-index .column.main .block:not(.crosssell) .content { padding: 0px !important;}
}
</style>
<div class="cart-class">
<span class="activation">Shopping Cart</span> >
<span class="activation-no">Information </span> >
<span class="activation-no">Shipping </span> >
<span class="activation-no">Payment </span>
</div>
<?php
/**
* Shopping cart template
*
* @var $block \Magento\Checkout\Block\Cart
*/
if ($block->getItemsCount()) {
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
echo $block->getChildHtml('with-items');
} else {
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
echo $block->getChildHtml('no-items');
}
<?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;">
<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" 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 @@ ...@@ -6,7 +6,7 @@
/** @var $block \Magento\Checkout\Block\Cart */ /** @var $block \Magento\Checkout\Block\Cart */
?> ?>
<div class="cart-empty"> <div class="cart-empty" style="min-height: 500px;">
<?= $block->getChildHtml('checkout_cart_empty_widget') ?> <?= $block->getChildHtml('checkout_cart_empty_widget') ?>
<div class="empty-img"><img src="<?= $block->getViewFileUrl('Magento_Checkout::images/empty-cart.svg');?>" /></div> <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> <p class="empty-message"><?= $block->escapeHtml(__('You shopping cart is currently empty.')) ?></p>
......
<style>
.cat-footer{
border-top: 1px solid rgba(var(--base-color), var(--divider-alpha, .1));
width: 100%;
margin-top: 5px;
}
.cat-footer-tk{
margin-top: 10px;
margin-left: 9%;
margin-bottom: 2%;
}
.cat-footer-tk > span {
margin-right: 10px;
margin-left: 10px;
font-size: 14px;
}
</style>
<div class="cat-footer">
<div class="cat-footer-tk">
<span>Refund Policy</span>
<span>Shipping policy</span>
<span>Privacy Policy</span>
<span>Terms of service</span>
</div>
</div>
\ No newline at end of file
...@@ -6,6 +6,24 @@ ...@@ -6,6 +6,24 @@
?> ?>
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?> <?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
<style>
main#maincontent{
width: 80%;
}
.cat-footer{
width: 100% !important;
}
.cat-footer-tk{
margin-left: 0px !important;
}
.opc .actions-toolbar{
justify-content: center !important;
}
#registration{
margin-bottom: 200px;
}
</style>
<div class="checkout-success"> <div class="checkout-success">
<?php if ($block->getOrderId()) :?> <?php if ($block->getOrderId()) :?>
<?php if ($block->getCanViewOrder()) :?> <?php if ($block->getCanViewOrder()) :?>
......
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
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<ul class="opc-progress-bar">
<!-- ko foreach: { data: steps().sort(sortItems), as: 'item' } -->
<li class="opc-progress-bar-item" data-bind="css: item.isVisible() ? '_active' : ($parent.isProcessed(item) ? '_complete' : '')">
<span data-bind="i18n: item.title, click: $parent.navigateTo"></span>
</li>
<!-- /ko -->
</ul>
...@@ -72,8 +72,7 @@ ...@@ -72,8 +72,7 @@
<div class="actions-toolbar" id="shipping-method-buttons-container"> <div class="actions-toolbar" id="shipping-method-buttons-container">
<div class="primary"> <div class="primary">
<button data-role="opc-continue" type="submit" class="button action continue 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+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMyODNDODA2MkIwNTExRUNCNUFCRkFGMzY4RjkyOTdCIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjMyODNDODA3MkIwNTExRUNCNUFCRkFGMzY4RjkyOTdCIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzI4M0M4MDQyQjA1MTFFQ0I1QUJGQUYzNjhGOTI5N0IiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzI4M0M4MDUyQjA1MTFFQ0I1QUJGQUYzNjhGOTI5N0IiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7niMRCAAAEKklEQVR42tSaW0gVQRjHt01SwiyTJKuHiugiEVIUVhBlPRRBN7ppUCT2EGVB0A2SoB6iJ596iPJBLJPM7B5SdDXNyjIxy0iLIsEoNYuu1vb/8DuwnM7OzszZPR7/8FNxZ3b2f+ab2ZlvTj/LsgyPlQhWgvlgNkgAXaAS3ABnQIenLZIJj0gGB8EHSyy6fgCM9KptL24yCOwFbZaaPnG9xN40EQ+2gxYrPL0DO/l+Ws/ST2NMDAM5YBMY42Fkt4BCUADeq1RUMTELrAVZIMnwT1/AKTZU5YWJiWAxWAOmG5HXA1AKroM6WRNxIJ1ZAqaCWKP3RQ9ZDS6AGnAf/LCbSMPvuWAeSAXjjOhXM2jk984tMvEUf0wx+q7qTX6b9mV9Nu2x1Uf1g0z8jsYQAY9AJq+/RPpp8rwcbQYaeEovAfEu5btMz1eU4RugN/Y62/9GuNRpj8GPzigx8Bjs5hebXaNc6nWQidYoMbCReyLUWk2k92TiXRQYoPB54XB9iEv9t6bqitGHMbBdYIBkCq79okgyOZxae8nAYd62Cgeu4NqbQE+08lo+0gbOgWKJsq9dTHSQib/gVYRNvAT7JctWOQx40nN7vNVFeI+QqVj+l8O1WruJ2giGUR7oVqgzQ7BIrbGnbAaCdstfPQVHFBIA48FVrhdKTYGyMezoG7taqPnpdvMsskC02gRbJO+5A2xw2efcCzUH39U0cAtM40brBeXyJe9ZIGGAdDNUBjBNMTQucpfb75HvUL5cMoTOC8LHru8gySl51ijx8NVghcND0Nh6EqLOOAkD1yQNkM7Z6wa/0ktdQqcMzARnHcrQ2CoPCqtKiffQNZCssNcvESWUJwvcD1WYWWptveCWnqxQ6AFSJ+d/HXuigfM7obReYcAXcm9cAV8F5S6D4YrZlqL/dqMhPplMwXh4CHIke4PGToLgepFiDwQ0SSYrPgC8kZiZkl1MjBVcy9c0UKGS2t8qcUOahVZrpOKzNQ2QMlRMxEqc+AR65ZCCgbQwDNzmKVzpkGWbwovvpISBATxOdJUOTFUT/UGzgpHzLibKwzBwTHRv0f71D8iVnPZoihwNrjpc3wPGai7fKS+2S5z4dw+DYsU11eWg+qlhjANLZvKQMTEYdCgaKQtaE+nqksyEESOTOgeb+RxNNrRIR/kwJFkzjGg3ly13jiQ/PR63IqtFfpxjm7zsiITy/DzHTuHMiG6IyIjCNkulgs5hfBqvdON8MEBb5DmqlUyNhqgnlvlgoMnoOTM3ImGCVKGYAHMTpVEzdE+tzDAapi3iKg8MPDN6ztG1k9pmmA9AX8CiQ/w2zfp32EB4ZyQefXGKshn1itPoSSuKvrRlX/UWShrY52G7npoIkMvJrVD6CJZ43aYfJogJ4HSQgRMgxY/2dF52KloOlnKy7YJfjfwTYAD0328CQiS8EQAAAABJRU5ErkJggg=="></span> <span translate="'Next'" />
<span translate="'PLACE ORDER'" style="vertical-align: super;"/>
</button> </button>
</div> </div>
</div> </div>
......
...@@ -920,7 +920,7 @@ footer{ ...@@ -920,7 +920,7 @@ footer{
@media(min-width: 640px){ @media(min-width: 640px){
.switcher.currency{ .switcher.currency{
position: absolute; position: absolute;
top: 30px; top: 20px;
right: 145px; right: 145px;
z-index: 1; z-index: 1;
font-size: 13px; font-size: 13px;
...@@ -2484,4 +2484,7 @@ button.primary.action.create { ...@@ -2484,4 +2484,7 @@ button.primary.action.create {
background: #000; background: #000;
} }
.slick-list.draggable .slick-track {
width: 100% !important;
}
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
"phpseclib/mcrypt_compat": "1.0.8", "phpseclib/mcrypt_compat": "1.0.8",
"phpseclib/phpseclib": "2.0.*", "phpseclib/phpseclib": "2.0.*",
"ramsey/uuid": "~4.1.0", "ramsey/uuid": "~4.1.0",
"sparsh/magento-2-advanced-sorting-extension": "^1.3",
"swissup/breeze-blank": "^1.2", "swissup/breeze-blank": "^1.2",
"symfony/console": "~4.4.0", "symfony/console": "~4.4.0",
"symfony/event-dispatcher": "~4.4.0", "symfony/event-dispatcher": "~4.4.0",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5b32d8725a620fa542a680503d480986", "content-hash": "29cabf37a1ac686d49544a0cb5aaa6e7",
"packages": [ "packages": [
{ {
"name": "airwallex/payments-plugin-magento", "name": "airwallex/payments-plugin-magento",
...@@ -6480,6 +6480,31 @@ ...@@ -6480,6 +6480,31 @@
"time": "2022-08-31T10:31:18+00:00" "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", "name": "spomky-labs/aes-key-wrap",
"version": "v6.0.0", "version": "v6.0.0",
"source": { "source": {
......
...@@ -140,5 +140,6 @@ return array( ...@@ -140,5 +140,6 @@ return array(
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php', '3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => $vendorDir . '/phpseclib/mcrypt_compat/lib/mcrypt.php', 'aa75ea0761a2f40c1f3b32ad314f86c4' => $vendorDir . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php', '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
'550719157da16285530f4f2ca5eee610' => $vendorDir . '/sparsh/magento-2-advanced-sorting-extension/registration.php',
'27a5783f6a5e8d8d1a4f54dff608a187' => $baseDir . '/app/etc/NonComposerComponentRegistration.php', '27a5783f6a5e8d8d1a4f54dff608a187' => $baseDir . '/app/etc/NonComposerComponentRegistration.php',
); );
...@@ -44,6 +44,7 @@ return array( ...@@ -44,6 +44,7 @@ return array(
'Swissup\\Rtl\\' => array($vendorDir . '/swissup/module-rtl'), 'Swissup\\Rtl\\' => array($vendorDir . '/swissup/module-rtl'),
'Swissup\\Breeze\\' => array($vendorDir . '/swissup/module-breeze'), 'Swissup\\Breeze\\' => array($vendorDir . '/swissup/module-breeze'),
'Swissup\\BreezeIntegrations\\' => array($vendorDir . '/swissup/module-breeze-integrations'), '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\\PharUtils\\' => array($vendorDir . '/seld/phar-utils/src'),
'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'), 'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'),
'Safe\\' => array($vendorDir . '/thecodingmachine/safe/lib', $vendorDir . '/thecodingmachine/safe/deprecated', $vendorDir . '/thecodingmachine/safe/generated'), 'Safe\\' => array($vendorDir . '/thecodingmachine/safe/lib', $vendorDir . '/thecodingmachine/safe/deprecated', $vendorDir . '/thecodingmachine/safe/generated'),
......
...@@ -141,6 +141,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf ...@@ -141,6 +141,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
'aa75ea0761a2f40c1f3b32ad314f86c4' => __DIR__ . '/..' . '/phpseclib/mcrypt_compat/lib/mcrypt.php', 'aa75ea0761a2f40c1f3b32ad314f86c4' => __DIR__ . '/..' . '/phpseclib/mcrypt_compat/lib/mcrypt.php',
'9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php', '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
'550719157da16285530f4f2ca5eee610' => __DIR__ . '/..' . '/sparsh/magento-2-advanced-sorting-extension/registration.php',
'27a5783f6a5e8d8d1a4f54dff608a187' => __DIR__ . '/../..' . '/app/etc/NonComposerComponentRegistration.php', '27a5783f6a5e8d8d1a4f54dff608a187' => __DIR__ . '/../..' . '/app/etc/NonComposerComponentRegistration.php',
); );
...@@ -197,6 +198,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf ...@@ -197,6 +198,7 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
'Swissup\\Rtl\\' => 12, 'Swissup\\Rtl\\' => 12,
'Swissup\\Breeze\\' => 15, 'Swissup\\Breeze\\' => 15,
'Swissup\\BreezeIntegrations\\' => 27, 'Swissup\\BreezeIntegrations\\' => 27,
'Sparsh\\AdvancedSorting\\' => 23,
'Seld\\PharUtils\\' => 15, 'Seld\\PharUtils\\' => 15,
'Seld\\JsonLint\\' => 14, 'Seld\\JsonLint\\' => 14,
'Safe\\' => 5, 'Safe\\' => 5,
...@@ -524,6 +526,10 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf ...@@ -524,6 +526,10 @@ class ComposerStaticInitb71ce7c407b65980cf51508f463c8dcf
array ( array (
0 => __DIR__ . '/..' . '/swissup/module-breeze-integrations', 0 => __DIR__ . '/..' . '/swissup/module-breeze-integrations',
), ),
'Sparsh\\AdvancedSorting\\' =>
array (
0 => __DIR__ . '/..' . '/sparsh/magento-2-advanced-sorting-extension',
),
'Seld\\PharUtils\\' => 'Seld\\PharUtils\\' =>
array ( array (
0 => __DIR__ . '/..' . '/seld/phar-utils/src', 0 => __DIR__ . '/..' . '/seld/phar-utils/src',
......
...@@ -11059,6 +11059,34 @@ ...@@ -11059,6 +11059,34 @@
"install-path": "../seld/phar-utils" "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", "name": "spomky-labs/aes-key-wrap",
"version": "v6.0.0", "version": "v6.0.0",
"version_normalized": "6.0.0.0", "version_normalized": "6.0.0.0",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => 'c5782803e86afdd01eda85af4ba6279f106ab8df', 'reference' => 'aa151b3790b9ffbf345a885f0b2152bbb0af129b',
'name' => 'magento/magento2ce', 'name' => 'magento/magento2ce',
'dev' => true, 'dev' => true,
), ),
...@@ -1015,7 +1015,7 @@ ...@@ -1015,7 +1015,7 @@
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => 'c5782803e86afdd01eda85af4ba6279f106ab8df', 'reference' => 'aa151b3790b9ffbf345a885f0b2152bbb0af129b',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'magento/module-admin-analytics' => array( 'magento/module-admin-analytics' => array(
...@@ -2877,6 +2877,15 @@ ...@@ -2877,6 +2877,15 @@
'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c', 'reference' => 'ea2f4014f163c1be4c601b9b7bd6af81ba8d701c',
'dev_requirement' => false, '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( 'spomky-labs/aes-key-wrap' => array(
'pretty_version' => 'v6.0.0', 'pretty_version' => 'v6.0.0',
'version' => '6.0.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