ltsecurityinc安防产品在线商城代码
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
|
||||
use Olegnax\LayeredNavigation\Block\Template;
|
||||
|
||||
/** @var Template $block */
|
||||
?>
|
||||
|
||||
<script>
|
||||
requirejs(['jquery', 'OXAjaxNav'],
|
||||
function ($) {
|
||||
"use strict";
|
||||
|
||||
$(function () {
|
||||
$('body').OXAjaxNav(<?= $block->getNavConfig(); ?>);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
|
||||
use Magento\Catalog\Model\Layer\Filter\AbstractFilter;
|
||||
use Magento\CatalogSearch\Model\Layer\Filter\Category;
|
||||
use Magento\CatalogSearch\Model\Layer\Filter\Price;
|
||||
use Magento\LayeredNavigation\Block\Navigation\FilterRenderer;
|
||||
use Olegnax\LayeredNavigation\Helper\Filter;
|
||||
use Olegnax\LayeredNavigation\Helper\Helper;
|
||||
use Olegnax\LayeredNavigation\Model\Config\Source\FiltersType;
|
||||
|
||||
/**
|
||||
* Template for filter items block
|
||||
*
|
||||
* @var $block FilterRenderer
|
||||
* @var $filter AbstractFilter
|
||||
*/
|
||||
|
||||
/** @var Filter $helperFilter */
|
||||
$helperFilter = $this->helper(Filter::class);
|
||||
$showCheckbox = $this->helper(Helper::class)->getModuleConfig('general/filters_type');
|
||||
$isCategorie = $filter instanceof Category;
|
||||
$requestVar = $filter->getRequestVar();
|
||||
|
||||
if ($filter instanceof Price && $filter->getIsSlider()): ?>
|
||||
<div class="item item-price-slider" data-mage-init='{"OXPriceSlider":<?php echo $filter->getSliderConfig(); ?>}'>
|
||||
<div class="ox-price-slider" style="display:none;"></div>
|
||||
<div class="ox-price-filter__values">
|
||||
<span class="ox-slider-min"></span>
|
||||
<span class="ox-slider-max"></span>
|
||||
<input<?= $showCheckbox !== FiltersType::TYPE_CHECKBOX ? ' class="ox-nav-use-url"' : '' ?> type="text" name="filter[<?= $requestVar ?>]"
|
||||
value="<?= $helperFilter->getSelectedSlider($filter); ?>" placeholder="<?= $filter->getLabel() ?>"/>
|
||||
<span class="ox-price-filter__selected" style="display:none;">
|
||||
<?= $filter->getLabel() ? $filter->getLabel() . ': ' : '' ?>
|
||||
<span class="ox-slider-from"></span> <span class="separator">–</span>
|
||||
<span class="ox-slider-to"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<ol class="items <?php if ($showCheckbox == FiltersType::TYPE_CHECKBOX) {
|
||||
echo 'ox-layered__items--checkbox';
|
||||
} ?> ">
|
||||
<?php foreach ($filterItems as $filterItem): ?>
|
||||
<li class="item<?= $helperFilter->checkedFilter($filterItem, ' ox-seleted-item') . $filterItem->getData('item_level')? ' ox-item-level-'.$filterItem->getData('item_level'):''; ?>">
|
||||
<?php if ($filterItem->getCount() > 0): ?>
|
||||
<?php if ($filter->getIsDisableAjax($filterItem) && ($filter instanceof Category)): ?>
|
||||
<?php if ($showCheckbox == FiltersType::TYPE_CHECKBOX): ?>
|
||||
<label for="filter_item_<?= $requestVar . '_' . $filterItem->getValue(); ?>">
|
||||
<span class="ox-checkbox"></span>
|
||||
<a class="label ox-disable-ajax" rel="nofollow"
|
||||
href="<?= $filter->getUrlItem($filterItem) ?>">
|
||||
<?= /* @noEscape */
|
||||
$filterItem->getLabel() ?>
|
||||
</a>
|
||||
</label>
|
||||
<?php else: ?>
|
||||
<a class="ox-disable-ajax" rel="nofollow" href="<?= $filter->getUrlItem($filterItem) ?>">
|
||||
<?= /* @noEscape */
|
||||
$filterItem->getLabel() ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($showCheckbox == FiltersType::TYPE_CHECKBOX): ?>
|
||||
<input id="filter_item_<?= $requestVar . '_' . $filterItem->getValue(); ?>"
|
||||
type="checkbox" name="filter[<?= $requestVar ?>][]"
|
||||
value="<?= $filterItem->getValue(); ?>" <?= !$filterItem->getCount() ? 'disabled' : ''; ?><?= $helperFilter->checkedFilter($filterItem); ?> />
|
||||
<label for="filter_item_<?= $requestVar . '_' . $filterItem->getValue(); ?>">
|
||||
<span class="ox-checkbox"></span>
|
||||
<span class="label"><?= /* @noEscape */
|
||||
$filterItem->getLabel() ?></span>
|
||||
</label>
|
||||
<?php else: ?>
|
||||
<a href="<?= $block->escapeUrl($filterItem->getUrl()) ?>" rel="nofollow">
|
||||
<?= /* @noEscape */
|
||||
$filterItem->getLabel() ?>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<strong><?= /* @noEscape */
|
||||
$filterItem->getLabel() ?></strong>
|
||||
<?php endif; ?>
|
||||
<?php /* show counter */ ?>
|
||||
<?php if ($this->helper(\Magento\Catalog\Helper\Data::class)->shouldDisplayProductCountOnLayer()) : ?>
|
||||
<span class="count"><?= /* @noEscape */
|
||||
(int)$filterItem->getCount()?:'' ?><span class="filter-count-label">
|
||||
<?php if ($filterItem->getCount() == 1) :
|
||||
?> <?= $block->escapeHtml(__('item')) ?><?php
|
||||
elseif ($filterItem->getCount() > 0) :
|
||||
?> <?= $block->escapeHtml(__('items')) ?><?php
|
||||
endif; ?></span></span>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
|
||||
use Magento\LayeredNavigation\Block\Navigation\State;
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Category layered navigation state
|
||||
*
|
||||
* @var $block State
|
||||
*/
|
||||
?>
|
||||
<?php $_filters = $block->getActiveFilters() ?>
|
||||
<?php if (!empty($_filters)): ?>
|
||||
<div class="filter-current">
|
||||
<strong class="block-subtitle filter-current-subtitle"
|
||||
role="heading"
|
||||
aria-level="2"
|
||||
data-count="<?= count($_filters) ?>"><?= /* @escapeNotVerified */
|
||||
__('Now Shopping by') ?></strong>
|
||||
<ol class="items">
|
||||
<?php
|
||||
foreach ($_filters as $_filter):
|
||||
$requestVar = $_filter->getFilter()->getRequestVar();
|
||||
$filterItemVal = (is_array($_filter->getValue())) ? implode('-',
|
||||
$_filter->getValue()) : $_filter->getValue();
|
||||
?>
|
||||
<li class="item">
|
||||
<span class="filter-label"><?= $block->escapeHtml(__($_filter->getName())) ?></span>
|
||||
<span class="filter-value"><?= /* @escapeNotVerified */
|
||||
$block->stripTags($_filter->getLabel()) ?></span>
|
||||
<?php
|
||||
$clearLinkUrl = $_filter->getClearLinkUrl();
|
||||
$currentFilterName = $block->escapeHtml(__($_filter->getName())) . " " . $block->stripTags($_filter->getLabel());
|
||||
if ($clearLinkUrl):
|
||||
?>
|
||||
<a class="action previous" href="<?= /* @escapeNotVerified */
|
||||
$_filter->getRemoveUrl() ?>"
|
||||
title="<?= /* @escapeNotVerified */
|
||||
__('Previous') ?>" data-current-var="<?= /* @escapeNotVerified */
|
||||
$requestVar ?>" data-current-val="<?= /* @escapeNotVerified */
|
||||
$filterItemVal ?>">
|
||||
<span><?= /* @escapeNotVerified */
|
||||
__('Previous') ?></span>
|
||||
</a>
|
||||
<a class="action remove"
|
||||
title="<?= $block->escapeHtml($_filter->getFilter()->getClearLinkText()) ?>"
|
||||
href="<?= /* @escapeNotVerified */
|
||||
$clearLinkUrl ?>" data-current-var="<?= /* @escapeNotVerified */
|
||||
$requestVar ?>" data-current-val="<?= /* @escapeNotVerified */
|
||||
$filterItemVal ?>">
|
||||
<span><?= $block->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></span>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<a class="action remove" href="<?= /* @escapeNotVerified */
|
||||
$_filter->getRemoveUrl() ?>" data-current-var="<?= /* @escapeNotVerified */
|
||||
$requestVar ?>" data-current-val="<?= /* @escapeNotVerified */
|
||||
$filterItemVal ?>"
|
||||
title="<?= /* @escapeNotVerified */
|
||||
$block->escapeHtml(__('Remove')) . " " . $currentFilterName ?>">
|
||||
<span><?= /* @escapeNotVerified */
|
||||
__('Remove This Item') ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->canShowBlock()): ?>
|
||||
<div class="block filter">
|
||||
<div class="block-title filter-title">
|
||||
<strong><?= /* @escapeNotVerified */
|
||||
__('Shop By') ?></strong>
|
||||
</div>
|
||||
|
||||
<div class="block-content filter-content">
|
||||
<?= $block->getChildHtml('state') ?>
|
||||
|
||||
<?php if ($block->getLayer()->getState()->getFilters()): ?>
|
||||
<div class="block-actions filter-actions">
|
||||
<a href="<?= /* @escapeNotVerified */
|
||||
$block->getClearUrl() ?>" class="action clear filter-clear"><span><?= /* @escapeNotVerified */
|
||||
__('Clear All') ?></span></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $wrapOptions = false; ?>
|
||||
<?php foreach ($block->getFilters() as $filter): ?>
|
||||
<?php if (!$wrapOptions): ?>
|
||||
<strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?= /* @escapeNotVerified */
|
||||
__('Shopping Options') ?></strong>
|
||||
<dl class="filter-options" id="narrow-by-list">
|
||||
<?php $wrapOptions = true;
|
||||
endif; ?>
|
||||
<?php if ($filter->getItemsCount()): ?>
|
||||
<dt role="heading" aria-level="3"
|
||||
class="filter-options-title"><?= $block->escapeHtml(__($filter->getName())) ?></dt>
|
||||
<dd class="filter-options-content"><?= /* @escapeNotVerified */
|
||||
$block->getChildBlock('renderer')->render($filter) ?></dd>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($wrapOptions): ?>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
|
||||
use Olegnax\LayeredNavigation\Helper\Helper;
|
||||
use Olegnax\LayeredNavigation\Model\Config\Source\LoaderType;
|
||||
|
||||
/** @var Helper $_helper */
|
||||
$config = $this->helper(Helper::class)->getModuleConfig('general');
|
||||
$configLoaders = $this->helper(Helper::class)->getModuleConfig('loaders');
|
||||
|
||||
if ('' !== $configLoaders['loader_type_filters'] && $config['enable']): ?>
|
||||
<script data-role="ox-nav-loader-filter" type="text/x-magento-template">
|
||||
<div class="ox-product-nav ox-product-nav-filter ox-product-nav__loader--<?= $configLoaders['loader_type_filters']; ?>">
|
||||
<div class="ox-product-nav__loader">
|
||||
<?php if (LoaderType::TYPE_IMAGE == $configLoaders['loader_type_filters']): ?>
|
||||
<img src="<?= $this->getViewFileUrl($configLoaders['loader_filters']) ?>"
|
||||
class="ox-product-nav__loader-image"/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<?php endif;
|
||||
if ('' !== $configLoaders['loader_type_content'] && $config['enable']): ?>
|
||||
<script data-role="ox-nav-loader-content" type="text/x-magento-template">
|
||||
<div class="ox-product-nav ox-product-nav-content ox-product-nav__loader--<?= $configLoaders['loader_type_content']; ?>">
|
||||
<div class="ox-product-nav__loader">
|
||||
<?php if (LoaderType::TYPE_IMAGE == $configLoaders['loader_type_content']): ?>
|
||||
<img src="<?= $this->getViewFileUrl($configLoaders['loader_content']) ?>"
|
||||
class="ox-product-nav__loader-image"/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<?php endif;
|
||||
if ('' !== $configLoaders['loader_type_page'] && $config['enable']): ?>
|
||||
<script data-role="ox-nav-loader-page" type="text/x-magento-template">
|
||||
<div class="ox-product-nav ox-product-nav-page ox-product-nav__loader--<?= $configLoaders['loader_type_page']; ?>">
|
||||
<div class="ox-product-nav__loader">
|
||||
<?php if (LoaderType::TYPE_IMAGE == $configLoaders['loader_type_page']): ?>
|
||||
<img src="<?= $this->getViewFileUrl($configLoaders['loader_page']) ?>"
|
||||
class="ox-product-nav__loader-image"/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<?php endif;
|
||||
Executable
+109
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_LayeredNavigation
|
||||
* @copyright Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* @license Proprietary License https://olegnax.com/license/
|
||||
*/
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
/** @var $block RenderLayered */
|
||||
|
||||
use Magento\Swatches\Block\LayeredNavigation\RenderLayered; ?>
|
||||
<?php $swatchData = $block->getSwatchData(); ?>
|
||||
<div class="swatch-attribute swatch-layered <?= /* @escapeNotVerified */
|
||||
$swatchData['attribute_code'] ?>"
|
||||
attribute-code="<?= /* @escapeNotVerified */
|
||||
$swatchData['attribute_code'] ?>"
|
||||
attribute-id="<?= /* @escapeNotVerified */
|
||||
$swatchData['attribute_id'] ?>">
|
||||
<div class="swatch-attribute-options clearfix">
|
||||
<?php foreach ($swatchData['options'] as $option => $label): ?>
|
||||
<a href="<?= /* @escapeNotVerified */
|
||||
$label['link'] ?>"
|
||||
aria-label="<?= /* @escapeNotVerified */
|
||||
$label['label'] ?>"
|
||||
class="swatch-option-link-layered">
|
||||
<?php if (isset($swatchData['swatches'][$option]['type'])) { ?>
|
||||
<?php switch ($swatchData['swatches'][$option]['type']) {
|
||||
case '3':
|
||||
?>
|
||||
<div class="swatch-option <?= /* @escapeNotVerified */
|
||||
$label['custom_style'] ?>"
|
||||
tabindex="-1"
|
||||
data-option-type="3"
|
||||
data-option-id="<?= /* @escapeNotVerified */
|
||||
$option ?>"
|
||||
data-option-label="<?= /* @escapeNotVerified */
|
||||
$label['label'] ?>"
|
||||
data-option-tooltip-thumb=""
|
||||
data-option-tooltip-value=""
|
||||
></div>
|
||||
<?php break;
|
||||
case '2':
|
||||
?>
|
||||
<?php $swatchThumbPath = $block->getSwatchPath('swatch_thumb',
|
||||
$swatchData['swatches'][$option]['value']); ?>
|
||||
<?php $swatchImagePath = $block->getSwatchPath('swatch_image',
|
||||
$swatchData['swatches'][$option]['value']); ?>
|
||||
<div class="swatch-option image <?= /* @escapeNotVerified */
|
||||
$label['custom_style'] ?>"
|
||||
tabindex="-1"
|
||||
data-option-type="2"
|
||||
data-option-id="<?= /* @escapeNotVerified */
|
||||
$option ?>"
|
||||
data-option-label="<?= /* @escapeNotVerified */
|
||||
$label['label'] ?>"
|
||||
data-option-tooltip-thumb="<?= /* @escapeNotVerified */
|
||||
$swatchThumbPath ?>"
|
||||
data-option-tooltip-value=""
|
||||
style="background: url(<?= /* @escapeNotVerified */
|
||||
$swatchImagePath ?>) no-repeat center; background-size: initial;"></div>
|
||||
<?php break;
|
||||
case '1':
|
||||
?>
|
||||
<div class="swatch-option color <?= /* @escapeNotVerified */
|
||||
$label['custom_style'] ?>"
|
||||
tabindex="-1"
|
||||
data-option-type="1"
|
||||
data-option-id="<?= /* @escapeNotVerified */
|
||||
$option ?>"
|
||||
data-option-label="<?= /* @escapeNotVerified */
|
||||
$label['label'] ?>"
|
||||
data-option-tooltip-thumb=""
|
||||
data-option-tooltip-value="<?= /* @escapeNotVerified */
|
||||
$swatchData['swatches'][$option]['value'] ?>"
|
||||
style="background: <?= /* @escapeNotVerified */
|
||||
$swatchData['swatches'][$option]['value'] ?> no-repeat center; background-size: initial;"></div>
|
||||
<?php break;
|
||||
case '0':
|
||||
default:
|
||||
?>
|
||||
<div class="swatch-option text <?= /* @escapeNotVerified */
|
||||
$label['custom_style'] ?>"
|
||||
tabindex="-1"
|
||||
data-option-type="0"
|
||||
data-option-id="<?= /* @escapeNotVerified */
|
||||
$option ?>"
|
||||
data-option-label="<?= /* @escapeNotVerified */
|
||||
$label['label'] ?>"
|
||||
data-option-tooltip-thumb=""
|
||||
data-option-tooltip-value=""
|
||||
><?= /* @escapeNotVerified */
|
||||
$swatchData['swatches'][$option]['value'] ?></div>
|
||||
<?php break;
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
require(["jquery", "jquery-ui-modules/widget", "Magento_Swatches/js/swatch-renderer"], function ($) {
|
||||
$('.swatch-layered.<?= /* @escapeNotVerified */ $swatchData['attribute_code'] ?>')
|
||||
.find('[data-option-type="1"], [data-option-type="2"], [data-option-type="0"], [data-option-type="3"]')
|
||||
.SwatchRendererTooltip();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user