ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
+658
View File
@@ -0,0 +1,658 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Catalog\Block\Product\AbstractProduct;
use Magento\Catalog\Block\Product\Widget\Html\Pager;
use Magento\Catalog\Block\ShortcutButtons\InCatalog\PositionAfter;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Visibility;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Catalog\Pricing\Price\FinalPrice;
use Magento\CatalogInventory\Helper\Stock;
use Magento\CatalogInventory\Model\Configuration;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\App\Http\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Pricing\Render;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Url\Helper\Data;
use Magento\Framework\View\Element\AbstractBlock;
use Magento\Framework\View\Element\RendererList;
use Magento\Framework\View\LayoutFactory;
use Magento\Framework\View\LayoutInterface;
use Magento\Msrp\Block\Popup;
use Magento\Store\Model\ScopeInterface;
use Magento\Widget\Block\BlockInterface;
use Olegnax\Core\Helper\ProductImage;
use Olegnax\ProductSlider\Model\Config\Source\SortOrder;
use Olegnax\ProductSlider\Model\Config\Source\SortOrderCat;
abstract class AbstractShortcode extends AbstractProduct implements BlockInterface, IdentityInterface
{
/**
* @var Context
*/
protected $httpContext;
/**
* Catalog product visibility
*
* @var Visibility
*/
protected $catalogProductVisibility;
/**
* Product collection factory
*
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var Data
*/
protected $urlHelper;
protected $_atributtes = [
'title' => '',
'title_align' => 'center',
'title_side_line' => false,
'title_tag' => 'strong',
//region Pagination
'products_count' => 6,
'show_pager' => false,
'products_per_page' => 10,
//endregion
'columns_desktop' => 4,
'columns_desktop_small' => 3,
'columns_table' => 2,
'columns_mobile' => 1,
'loop' => false,
'arrows' => false,
'dots' => false,
'nav_position' => 'left-right',
'dots_align' => 'left',
'show_title' => true,
'autoplay' => false,
'autoplay_time' => '5000',
'pause_on_hover' => false,
'show_addtocart' => true,
'show_wishlist' => true,
'show_compare' => true,
'show_review' => true,
'show_desc' => false,
'show_in_stock' => true,
'rewind' => false,
'sort_order' => '',
'quickview_position' => '',
'products_layout_centered' => false,
'show_swatches' => false,
'review_count' => false,
'hide_name' => false,
'hide_price' => false,
'custom_class' => '',
];
/**
* @var \Magento\Framework\View\Element\BlockInterface
*/
protected $pager;
/**
* @var LayoutFactory
*/
private $layoutFactory;
/**
* @var RendererList
*/
private $rendererListBlock;
/**
* @var PriceCurrencyInterface
*/
private $priceCurrency;
/**
* Json Serializer Instance
*
* @var Json
*/
private $json;
/**
* AbstractShortcode constructor.
* @param \Magento\Catalog\Block\Product\Context $context
* @param CollectionFactory $productCollectionFactory
* @param Visibility $catalogProductVisibility
* @param Context $httpContext
* @param Data $urlHelper
* @param array $data
* @param Json|null $json
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
CollectionFactory $productCollectionFactory,
Visibility $catalogProductVisibility,
Context $httpContext,
Data $urlHelper,
array $data = [],
LayoutFactory $layoutFactory = null,
Json $json = null
) {
$this->productCollectionFactory = $productCollectionFactory;
$this->catalogProductVisibility = $catalogProductVisibility;
$this->httpContext = $httpContext;
$this->urlHelper = $urlHelper;
$this->layoutFactory = $layoutFactory ?: ObjectManager::getInstance()->get(LayoutFactory::class);
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
parent::__construct($context, $data);
}
/**
* @param array $newval
* @return array
*/
public function getCacheKeyInfo($newval = [])
{
return array_merge([
'OLEGNAX_PRODUCTSLIDER_PRODUCTS_LIST_WIDGET',
$this->getPriceCurrency()->getCurrency()->getCode(),
$this->getStoreId(),
$this->_design->getDesignTheme()->getId(),
$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_GROUP),
(int)$this->getRequest()->getParam($this->getData('page_var_name'), 1),
$this->getProductsPerPage(),
$this->getProductsCount(),
$this->json->serialize($this->getRequest()->getParams()),
$this->json->serialize($this->getData()),
], $newval);
}
/**
* @return PriceCurrencyInterface|mixed
*/
private function getPriceCurrency()
{
if ($this->priceCurrency === null) {
$this->priceCurrency = ObjectManager::getInstance()
->get(PriceCurrencyInterface::class);
}
return $this->priceCurrency;
}
/**
* @return int
* @throws NoSuchEntityException
*/
public function getStoreId()
{
return $this->_storeManager->getStore()->getId();
}
/**
* Retrieve how many products should be displayed
*
* @return int
*/
public function getProductsPerPage()
{
if (!$this->hasData('products_per_page')) {
$this->setData('products_per_page', $this->_atributtes['products_per_page']);
}
return $this->getData('products_per_page');
}
/**
* Retrieve how many products should be displayed
*
* @return int
*/
public function getProductsCount()
{
if ($this->hasData('products_count')) {
return $this->getData('products_count');
}
if (null === $this->getData('products_count')) {
$this->setData('products_count', $this->_atributtes['products_count']);
}
return $this->getData('products_count');
}
/**
* @param string $method
* @param array $args
* @return mixed
* @throws LocalizedException
*/
public function __call($method, $args)
{
if ('get' === substr($method, 0, 3)) {
$key = $this->_underscore(substr($method, 3));
if (array_key_exists($key, $this->_atributtes)) {
$value = $this->_atributtes[$key];
if ($this->hasData($key)) {
$value = $this->getData($key);
if (is_null($value)) {
$value = '';
}
}
return $value;
}
}
return parent::__call($method, $args);
}
/**
* {@inheritdoc}
*/
// protected function _beforeToHtml()
// {
// $this->setProductCollection($this->createCollection());
// return parent::_beforeToHtml();
// }
/**
* @param Product $product
* @param null $priceType
* @param string $renderZone
* @param array $arguments
* @return string
* @throws LocalizedException
*/
public function getProductPriceHtml(
Product $product,
$priceType = null,
$renderZone = Render::ZONE_ITEM_LIST,
array $arguments = []
) {
if (!isset($arguments['zone'])) {
$arguments['zone'] = $renderZone;
}
$arguments['price_id'] = isset($arguments['price_id']) ? $arguments['price_id'] : 'old-price-' . $product->getId() . '-' . $priceType;
$arguments['include_container'] = isset($arguments['include_container']) ? $arguments['include_container'] : true;
$arguments['display_minimal_price'] = isset($arguments['display_minimal_price']) ? $arguments['display_minimal_price'] : true;
/** @var Render $priceRender */
$priceRender = $this->getLayout()->getBlock('product.price.render.default');
$price = '';
if ($priceRender) {
$price = $priceRender->render(
FinalPrice::PRICE_CODE,
$product,
$arguments
);
}
return $price;
}
/**
* @return array|string[]
*/
public function getIdentities()
{
$identities = [];
if ($this->getProductCollection()) {
foreach ($this->getProductCollection() as $product) {
if ($product instanceof IdentityInterface) {
$identities = array_merge($identities, $product->getIdentities());
}
}
}
return $identities ?: [Product::CACHE_TAG];
}
/**
* @return Collection
*/
public function getProductCollection()
{
$page = (int)$this->getRequest()->getParam($this->getData('page_var_name'), 1);
$collection = $this->initProductCollection()
->setCurPage($page);
$productsSize = $this->getPageSize();
$productsCount = $productsSize * $page;
if ($productsCount > $this->getProductsCount()) {
$productsSize += $this->getProductsCount() - $productsCount;
}
if ($productsSize) {
$collection->setPageSize($productsSize);
}
return $collection;
}
/**
* @return Collection
*/
public function initProductCollection()
{
/** @var $collection Collection */
$visibleProducts = $this->catalogProductVisibility->getVisibleInCatalogIds();
$collection = $this->productCollectionFactory->create()->setVisibility($visibleProducts);
$collection->addMinimalPrice()
->addFinalPrice()
->addTaxPercents()
->addAttributeToSelect('*');
if ($this->_scopeConfig->getValue(
Configuration::XML_PATH_SHOW_OUT_OF_STOCK,
ScopeInterface::SCOPE_STORE
) &&
$this->getShowInStock()) {
$this->addInStockFilterToCollection($collection);
}
return $collection;
}
/**
* @param $collection
*/
public function addInStockFilterToCollection($collection)
{
$this->_loadObject(Stock::class)->addInStockFilterToCollection($collection);
}
protected function _loadObject($object)
{
return ObjectManager::getInstance()->get($object);
}
/**
* Retrieve how many products should be displayed on page
*
* @return int
*/
protected function getPageSize()
{
return $this->showPager() ? $this->getProductsPerPage() : $this->getProductsCount();
}
/**
* Return flag whether pager need to be shown or not
*
* @return bool
*/
public function showPager()
{
if (!$this->hasData('show_pager')) {
$this->setData('show_pager', $this->_atributtes['show_pager']);
}
return (bool)$this->getData('show_pager');
}
/**
* @param Collection $collection
* @param string $order_attribute
* @param string $order_dir
*/
public function addAttributeToSort(
Collection $collection,
$order_attribute = "",
$order_dir = Collection::SORT_ORDER_ASC
) {
$sortOrder = $this->getSortOrder();
switch ($sortOrder) {
case SortOrder::FIELD_PRICE_ASC:
$order_attribute = 'price';
$order_dir = Collection::SORT_ORDER_ASC;
break;
case SortOrder::FIELD_PRICE_DESC:
$order_attribute = 'price';
$order_dir = Collection::SORT_ORDER_DESC;
break;
case SortOrder::FIELD_CREATED:
$order_attribute = $sortOrder;
$order_dir = Collection::SORT_ORDER_DESC;
break;
case SortOrderCat::FIELD_POSITION:
case SortOrder::FIELD_NAME:
$order_attribute = $sortOrder;
$order_dir = Collection::SORT_ORDER_ASC;
break;
}
if (!empty($order_attribute)) {
$collection->addAttributeToSort($order_attribute, $order_dir);
}
}
/**
* @param array $options
* @param bool $json
* @return array|bool|false|string
*/
public function getCarouselOptions($options = [], $json = true)
{
$autoplayTime = (int)$this->getAutoplayTime();
if (!$autoplayTime || $autoplayTime < 500) {
$autoplayTime = 500;
}
$options['itemClass'] = 'product-item';
$options['margin'] = (int)$this->getMargin();
$options['loop'] = (bool)$this->getLoop();
$options['dots'] = (bool)$this->getDots();
$options['nav'] = (bool)$this->getNav();
$options['items'] = (int)$this->getColumnsDesktop();
$options['autoplay'] = (bool)$this->getAutoplay();
$options['autoplayTimeout'] = $autoplayTime;
$options['autoplayHoverPause'] = (bool)$this->getPauseOnHover();
$options['lazyLoad'] = true;
$options['rewind'] = (bool)$this->getRewind();
$options['responsive'] = [
'0' => [
'items' => max(1, (int)$this->getColumnsMobile()),
],
'640' => [
'items' => max(1, (int)$this->getColumnsTablet()),
],
'1025' => [
'items' => max(1, (int)$this->getColumnsDesktopSmall()),
],
'1160' => [
'items' => max(1, (int)$this->getColumnsDesktop()),
],
];
if ($json) {
return $this->json->serialize($options);
}
return $options;
}
/**
* @return string|string[]|null
*/
public function getUnderlineNameInLayout()
{
$name = $this->getNameInLayout();
$name = preg_replace('/[^a-zA-Z0-9_]/i', '_', $name);
$name .= substr(md5(microtime()), -5);
return $name;
}
/**
* @param Product $product
* @return string
*/
public function getMSRPHtml(Product $product)
{
if ($this->isMSRP($product)) {
return $this->getMSRP();
}
return '';
}
/**
* @param Product $product
* @return bool
*/
public function isMSRP(Product $product)
{
$msrp = $product->getData('msrp');
return null !== $msrp;
}
/**
* @return string
* @throws LocalizedException
*/
public function getMSRP()
{
$content = '';
$block = $this->getLayout()->getBlock('product.tooltip');
if (!$block && class_exists('\Magento\Catalog\Block\ShortcutButtons\InCatalog\PositionAfter')) {
$block = $this->getLayout()->createBlock(
Popup::class,
'product.tooltip'
)->setTemplate('Magento_Msrp::popup.phtml');
$_block = $this->getLayout()->createBlock(
PositionAfter::class,
'map.shortcut.buttons'
);
$block->setChild($_block->getNameInLayout(), $_block);
$content = $block->toHtml();
}
return $content;
}
//region Pagination
/**
* @param Product $product
* @return array
*/
public function getAddToCartPostParams(Product $product)
{
$url = $this->getAddToCartUrl($product);
return [
'action' => $url,
'data' => [
'product' => $product->getEntityId(),
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
],
];
}
/**
* @param $product
* @param $imageId
* @param array $attributes
* @return mixed
*/
public function getLazyImage($product, $imageId, $attributes = [])
{
return $this->_loadObject(ProductImage::class)->getImage(
$product,
$imageId,
'Olegnax_ProductSlider::product/image_with_borders.phtml',
$attributes
);
}
/**
* Render pagination HTML
*
* @return string
* @throws LocalizedException
*/
public function getPagerHtml()
{
if ($this->showPager() && $this->initProductCollection()->getSize() > $this->getProductsPerPage()) {
if (!$this->pager) {
$this->pager = $this->getLayout()->createBlock(
Pager::class,
$this->getWidgetPagerBlockName()
);
$this->pager->setUseContainer(true)
->setShowAmounts(true)
->setShowPerPage(false)
->setPageVarName($this->getData('page_var_name'))
->setLimit($this->getProductsPerPage())
->setTotalLimit($this->getProductsCount())
->setCollection($this->getProductCollection());
}
if ($this->pager instanceof AbstractBlock) {
return $this->pager->toHtml();
}
}
return '';
}
/**
* Get widget block name
*
* @return string
*/
private function getWidgetPagerBlockName()
{
$namespace = explode('\\', (string)get_class($this));
$class = array_slice($namespace, -2, 1);
$class = strtolower($class[0]);
$pageName = $this->getData('page_var_name');
$pagerBlockName = 'widget.' . $class . '.pager';
if (!$pageName) {
return $pagerBlockName;
}
return $pagerBlockName . '.' . $pageName;
}
/**
* @inheritdoc
*/
protected function getDetailsRendererList()
{
if (empty($this->rendererListBlock)) {
/** @var $layout LayoutInterface */
$layout = $this->layoutFactory->create(['cacheable' => false]);
$layout->getUpdate()->addHandle('catalog_widget_product_list')->load();
$layout->generateXml();
$layout->generateElements();
$this->rendererListBlock = $layout->getBlock('category.product.type.widget.details.renderers');
}
return $this->rendererListBlock;
}
/**
*
*/
protected function _construct()
{
$this->addData([
'cache_lifetime' => 86400,
]);
parent::_construct();
}
//endregion
}
@@ -0,0 +1,109 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
abstract class AbstractShortcodeByIds extends AbstractShortcode
{
protected $_atributtes = [
'title' => '',
'title_align' => 'center',
'title_tag' => 'strong',
'title_side_line' => false,
//region Pagination
'products_count' => 6,
'show_pager' => false,
'products_per_page' => 10,
//endregion
'products_ids' => '',
'columns_desktop' => 4,
'columns_desktop_small' => 3,
'columns_tablet' => 2,
'columns_mobile' => 1,
'loop' => false,
'arrows' => false,
'dots' => false,
'nav_position' => 'left-right',
'dots_align' => 'left',
'show_title' => true,
'autoplay' => false,
'autoplay_time' => '5000',
'pause_on_hover' => false,
'show_addtocart' => true,
'show_wishlist' => true,
'show_compare' => true,
'show_review' => true,
'hide_name' => false,
'hide_price' => false,
'show_desc' => false,
'show_in_stock' => true,
'rewind' => false,
'sort_order' => '',
'quickview_position' => '',
'products_layout_centered' => false,
'show_swatches' => false,
'review_count' => false,
'custom_class' => '',
];
public function initProductCollection()
{
$collection = parent::initProductCollection();
$productIds = array_filter($this->getLoadedProductIds());
$collection->addIdFilter($productIds);
$productsCount = $this->getProductsCount();
if ($productsCount) {
$collection->setPageSize($productsCount);
}
$this->addAttributeToSort($collection);
$collection->distinct(true);
return $collection;
}
public function getLoadedProductIds()
{
$productIds = $this->getProductIds();
if($productIds) {
if (!is_array($productIds) ) {
$productIds = explode(',', (string)$productIds);
}
$productIds = array_map('intval', $productIds);
$productIds = array_map('abs', $productIds);
$productIds = array_filter($productIds);
} else {
$productIds = [];
}
return $productIds;
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo([
'OLEGNAX_PRODUCTSLIDER_PRODUCTS_LIST_BY_ID_WIDGET',
$this->getProductIds(),
]);
}
}
@@ -0,0 +1,51 @@
<?php
/**/
namespace Olegnax\ProductSlider\Block\Adminhtml;
use Magento\Backend\Block\Template;
use Magento\Backend\Block\Template\Context;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Data\Form\Element\Factory;
Class TextField extends Template
{
protected $_elementFactory;
/**
* @param Context $context
* @param Factory $elementFactory
* @param array $data
*/
public function __construct(
Context $context,
Factory $elementFactory,
array $data = []
) {
$this->_elementFactory = $elementFactory;
parent::__construct($context, $data);
}
/**
* Prepare chooser element HTML
*
* @param AbstractElement $element Form Element
* @return AbstractElement
*/
public function prepareElementHtml(AbstractElement $element)
{
$input = $this->_elementFactory->create("textarea", ['data' => $element->getData()]);
$input->setId($element->getId());
$input->setForm($element->getForm());
$input->setClass("widget-option input-textarea admin__control-text");
if ($element->getRequired()) {
$input->addClass('required-entry');
}
$element->setData('after_element_html', $input->getElementHtml());
return $element;
}
}
+210
View File
@@ -0,0 +1,210 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use DateTime;
use Exception;
use Magento\Catalog\Model\Product\Visibility;
use Magento\Catalog\Model\ProductFactory;
use Magento\CatalogInventory\Model\Configuration;
use Magento\Framework\App\Http\Context;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\Url\Helper\Data;
use Magento\Framework\View\LayoutFactory;
use Magento\Sales\Model\ResourceModel\Report\Bestsellers\Collection;
use Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory;
use Magento\Store\Model\ScopeInterface;
class BestSellerProducts extends ProductsByIds
{
/**
* @var ProductFactory
*/
protected $product;
/**
* BestSellerProducts constructor.
* @param \Magento\Catalog\Block\Product\Context $context
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
* @param Visibility $catalogProductVisibility
* @param Context $httpContext
* @param Data $urlHelper
* @param ProductFactory $product
* @param array $data
* @param LayoutFactory|null $layoutFactory
* @param Json|null $json
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
Visibility $catalogProductVisibility,
Context $httpContext,
Data $urlHelper,
ProductFactory $product,
array $data = [],
LayoutFactory $layoutFactory = null,
Json $json = null
) {
$this->product = $product;
parent::__construct($context, $productCollectionFactory, $catalogProductVisibility, $httpContext, $urlHelper,
$data, $layoutFactory, $json);
}
/**
* @return array
* @throws NoSuchEntityException
*/
public function getLoadedProductIds()
{
$productIds = [];
/** @var Collection $collection */
$collection = $this->_loadObject(CollectionFactory::class)->create();
$period = $this->getData('period');
if ($period) {
$collection
->addFieldToFilter(
'period',
[
'date' => true,
'from' => $this->getDateAgo($period),
]
);
if (in_array($period, ['month', 'year'])) {
$collection->setPeriod($period);
}
}
if (method_exists($collection, 'addStoreRestrictions')) {
$collection->addStoreRestrictions([0, $this->getStoreId()]);
}
$bestsellers = $collection
->setOrder('MIN(rating_pos)', \Magento\Framework\Data\Collection::SORT_ORDER_ASC)
->setPageSize(200);
$productsCount = $this->getProductsCount();
foreach ($bestsellers as $_product) {
$id = $_product->getProductId();
if (!in_array($id, $productIds) && $this->categoryStatus($id) && $this->stockStatus($id)) {
$productIds[] = $id;
}
if ($productsCount && count($productIds) >= $productsCount) {
break;
}
}
return $productIds;
}
/**
* @param string $period
* @param int $countPeriod
* @return int
*/
protected function getDateAgo($period = 'year', $countPeriod = 1)
{
if (!in_array($period, ['year', 'month', 'day'])) {
$period = 'year';
}
return (new DateTime())
->modify('-' . $countPeriod . ' ' . $period)
->setTime(0, 0)
->getTimestamp();
}
/**
* @param $id
* @return bool
*/
protected function categoryStatus($id)
{
$categoryIds = $this->getCategoryIds();
if (!empty($categoryIds)) {
try {
$productCategoryIds = $this->product->create()->load($id)->getCategoryIds();
return 0 < count(array_intersect($categoryIds, $productCategoryIds));
} catch (Exception $exception) {
return false;
}
}
return true;
}
/**
* @return array|mixed|null
*/
protected function getCategoryIds()
{
$categoryIds = $this->getData('category_ids');
if (!is_array($categoryIds)) {
if ($categoryIds) {
$categoryIds = is_array($categoryIds) ? $categoryIds : explode(',', (string)$categoryIds);
$categoryIds = array_map('intval', $categoryIds);
$categoryIds = array_filter($categoryIds);
$categoryIds = array_unique($categoryIds);
} else {
$categoryIds = [];
}
$this->setData('category_ids', $categoryIds);
}
return $this->getData('category_ids');
}
/**
* @param $id
* @return bool|int
*/
protected function stockStatus($id)
{
if ($this->_scopeConfig->getValue(
Configuration::XML_PATH_SHOW_OUT_OF_STOCK,
ScopeInterface::SCOPE_STORE
) &&
$this->getShowInStock()) {
try {
return $this->stockRegistry->getProductStockStatus($id);
} catch (Exception $exception) {
return false;
}
}
return true;
}
/**
* @param array $newval
* @return array
*/
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo([
'OLEGNAX_PRODUCTSLIDER_BESTSELLER_PRODUCTS_LIST_WIDGET',
implode(',', $this->getCategoryIds()),
$this->getData('period'),
]);
}
}
+54
View File
@@ -0,0 +1,54 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
class FeaturedProducts extends AbstractShortcode
{
/**
* Prepare and return product collection
*
* @return Collection
*/
public function initProductCollection()
{
$collection = parent::initProductCollection();
$collection->addStoreFilter()
->setPageSize($this->getProductsCount())
->addAttributeToFilter('ox_featured', '1');
$collection->distinct(true);
$this->addAttributeToSort($collection);
return $collection;
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo(['OLEGNAX_PRODUCTSLIDER_FEATURED_PRODUCTS_LIST_WIDGET']);
}
}
@@ -0,0 +1,68 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;
use Olegnax\ProductSlider\Model\ResourceModel\Report\Product\CollectionFactory;
class MostViewedProducts extends ProductsByIds
{
const FLAT_CATALOG_PATH = 'catalog/frontend/flat_catalog_product';
public function initProductCollection()
{
$storeId = $this->getStoreId();
$collection = $this->_loadObject(CollectionFactory::class)->create();
$collection->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addViewsCount()
->setPageSize($this->getProductsCount());
$flatCatalogProduct = $this->_loadObject(ScopeConfigInterface::class)
->getValue(static::FLAT_CATALOG_PATH, ScopeInterface::SCOPE_STORE);
if ($flatCatalogProduct) {
$collection->getSelect()->joinLeft(
['flat' => 'catalog_product_flat_' . $storeId],
"(e.entity_id = flat.entity_id ) ",
[
'flat.name AS name',
'flat.small_image AS small_image',
'flat.img_hover AS img_hover',
'flat.ox_featured AS ox_featured',
'flat.price AS price',
'flat.special_price as special_price',
'flat.special_from_date AS special_from_date',
'flat.special_to_date AS special_to_date'
]
);
}
return $collection;
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo(['OLEGNAX_PRODUCTSLIDER_MOSTVIEWED_PRODUCTS_LIST_WIDGET']);
}
}
+61
View File
@@ -0,0 +1,61 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Zend_Db_Expr;
class NewProducts extends AbstractShortcode
{
public function initProductCollection()
{
$collection = parent::initProductCollection();
$collection->addStoreFilter($this->getStoreId())
->addAttributeToFilter('news_from_date', ['date' => true, 'to' => $this->getDate('23:59:59')], 'left')
->addAttributeToFilter(
'news_to_date', [
'or' => [
0 => ['date' => true, 'from' => $this->getDate()],
1 => ['is' => new Zend_Db_Expr('null')],
]
], 'left')
->setPageSize($this->getProductsCount())
->distinct(true);
$this->addAttributeToSort($collection, 'news_from_date', 'desc');
return $collection;
}
public function getDate($time = '0:0:0')
{
return $this->_loadObject(DateTime::class)->date(null, $time);
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo(['OLEGNAX_PRODUCTSLIDER_NEW_PRODUCTS_LIST_WIDGET']);
}
}
+59
View File
@@ -0,0 +1,59 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Zend_Db_Expr;
class OnSaleProducts extends AbstractShortcode
{
public function initProductCollection()
{
$collection = parent::initProductCollection();
$collection->addStoreFilter($this->getStoreId())
->addAttributeToFilter('special_from_date', ['date' => true, 'to' => $this->getDate('23:59:59')], 'left')
->addAttributeToFilter(
'special_to_date', [
'or' => [
0 => ['date' => true, 'from' => $this->getDate()],
1 => ['is' => new Zend_Db_Expr('null')],
]
], 'left')
->setPageSize($this->getProductsCount())
->distinct(true);
$this->addAttributeToSort($collection, 'special_from_date', 'desc');
return $collection;
}
public function getDate($time = '0:0:0')
{
return $this->_loadObject(DateTime::class)->date(null, $time);
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo(['OLEGNAX_PRODUCTSLIDER_ONSALE_PRODUCTS_LIST_WIDGET']);
}
}
+118
View File
@@ -0,0 +1,118 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Catalog\Model\CategoryFactory;
class ProductsByCategory extends AbstractShortcode
{
protected $_atributtes = [
'title' => '',
'title_align' => 'center',
'title_tag' => 'strong',
'title_side_line' => false,
//region Pagination
'products_count' => 6,
'show_pager' => false,
'products_per_page' => 10,
//endregion
'category_ids' => '',
'columns_desktop' => 4,
'columns_desktop_small' => 3,
'columns_tablet' => 2,
'columns_mobile' => 1,
'loop' => false,
'arrows' => false,
'dots' => false,
'nav_position' => 'left-right',
'dots_align' => 'left',
'show_title' => true,
'autoplay' => false,
'autoplay_time' => '5000',
'pause_on_hover' => false,
'show_addtocart' => true,
'show_wishlist' => true,
'show_compare' => true,
'show_review' => true,
'show_desc' => false,
'show_in_stock' => true,
'rewind' => false,
'sort_order' => '',
'quickview_position' => '',
'products_layout_centered' => false,
'show_swatches' => false,
'review_count' => false,
'hide_name' => false,
'hide_price' => false,
'custom_class' => '',
];
public function initProductCollection()
{
$categoryIds = $this->getCategoryIds();
$collection = parent::initProductCollection();
if (1 == count($categoryIds)) {
$categoryId = array_shift($categoryIds);
$category = $this->_loadObject(CategoryFactory::class)->create()->load($categoryId);
$collection->addCategoryFilter($category);
} else {
$collection->addCategoriesFilter(['eq' => $categoryIds]);
}
$productsCount = $this->getProductsCount();
if ($productsCount) {
$collection->setPageSize($productsCount);
}
$this->addAttributeToSort($collection);
$collection->distinct(true);
return $collection;
}
protected function getCategoryIds(){
$categoryIds = $this->getData('category_ids');
if (!is_array($categoryIds)) {
if ($categoryIds) {
$categoryIds = is_array($categoryIds) ? $categoryIds : explode(',', (string)$categoryIds);
$categoryIds = array_map('intval', $categoryIds);
$categoryIds = array_filter($categoryIds);
$categoryIds = array_unique($categoryIds);
} else {
$categoryIds = [];
}
$this->setData('category_ids', $categoryIds);
}
return $this->getData('category_ids');
}
public function getCacheKeyInfo($newval = [])
{
return parent::getCacheKeyInfo([
'OLEGNAX_PRODUCTSLIDER_CATEGORY_PRODUCTS_LIST_WIDGET',
implode(',', $this->getCategoryIds())
]);
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Olegnax\ProductSlider\Block;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
class ProductsByIds extends AbstractShortcodeByIds
{
public function addAttributeToSort(
Collection $collection,
$order_attribute = "",
$order_dir = Collection::SORT_ORDER_ASC
) {
$sortOrder = $this->getSortOrder();
if (empty($sortOrder)) {
$collection->getSelect()->order(
'FIELD(e.entity_id, ' . implode(
",",
array_filter($this->getLoadedProductIds())
) . ')'
);
} else {
parent::addAttributeToSort($collection, $order_attribute, $order_dir);
}
}
}
+79
View File
@@ -0,0 +1,79 @@
<?php
/*
* @author Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://olegnax.com/). All rights reserved.
* See COPYING.txt for license details.
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\View\Element\Template;
use Magento\Ui\Block\Wrapper;
use Magento\Ui\Model\UiComponentGenerator;
use Magento\Widget\Block\BlockInterface;
class RecentlyViewed extends Wrapper implements BlockInterface
{
/**
* @var Json
*/
protected $json;
public function __construct(
Template\Context $context,
UiComponentGenerator $uiComponentGenerator,
Json $json = null,
array $data = []
) {
parent::__construct($context, $uiComponentGenerator, $data);
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
}
/**
* @param array $options
* @param bool $json
*
* @return array|bool|false|string
*/
public function getCarouselOptions($options = [], $json = true)
{
$autoplayTime = (int)$this->getAutoplayTime();
if (!$autoplayTime || $autoplayTime < 500) {
$autoplayTime = 500;
}
$options['itemClass'] = 'product-item';
$options['margin'] = (int)$this->getMargin();
$options['loop'] = (bool)$this->getLoop();
$options['dots'] = (bool)$this->getDots();
$options['nav'] = (bool)$this->getNav();
$options['items'] = (int)$this->getColumnsDesktop();
$options['autoplay'] = (bool)$this->getAutoplay();
$options['autoplayTimeout'] = $autoplayTime;
$options['autoplayHoverPause'] = (bool)$this->getPauseOnHover();
$options['lazyLoad'] = true;
$options['rewind'] = (bool)$this->getRewind();
$options['responsive'] = [
'0' => [
'items' => max(1, (int)$this->getColumnsMobile()),
],
'640' => [
'items' => max(1, (int)$this->getColumnsTablet()),
],
'1025' => [
'items' => max(1, (int)$this->getColumnsDesktopSmall()),
],
'1160' => [
'items' => max(1, (int)$this->getColumnsDesktop()),
],
];
if ($json) {
return $this->json->serialize(['OXowlCarousel' => $options]);
}
return $options;
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Reports\Block\Product\Viewed;
class ViewedProducts extends AbstractShortcode
{
public function initProductCollection()
{
$collection = $this->_loadObject(Viewed::class)
->getItemsCollection()
->setPageSize($this->getProductsCount());
$collection->distinct(true);
return $collection;
}
}
+46
View File
@@ -0,0 +1,46 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Block;
use Magento\Customer\Model\Session;
use Magento\Wishlist\Model\ResourceModel\Item\CollectionFactory;
class WishlistProducts extends ProductsByIds
{
public function getLoadedProductIds()
{
$productIds = [];
$customerSession = $this->_loadObject(Session::class);
if ($customerSession->isLoggedIn()) {
$_productCollection = $this->_loadObject(CollectionFactory::class)->create()
->addCustomerIdFilter($customerSession->getCustomerId());
foreach ($_productCollection as $_product) {
$productIds[] = $_product->getEntityId();
}
}
return $productIds;
}
}
@@ -0,0 +1,38 @@
<?php
namespace Olegnax\ProductSlider\Model\Config\Source;
use Magento\Framework\Option\ArrayInterface;
class SortOrder implements ArrayInterface
{
public const FIELD_DEFAULT = '';
public const FIELD_NAME = 'name';
public const FIELD_PRICE_ASC = 'price_asc';
public const FIELD_PRICE_DESC = 'price_desc';
public const FIELD_CREATED = 'created_at';
public function toOptionArray()
{
$optionArray = [];
$array = $this->toArray();
foreach ($array as $key => $value) {
$optionArray[] = ['value' => $key, 'label' => $value];
}
return $optionArray;
}
public function toArray()
{
return [
self::FIELD_DEFAULT => __('Default'),
self::FIELD_NAME => __('Name'),
self::FIELD_PRICE_ASC => __('Price: high to low'),
self::FIELD_PRICE_DESC => __('Price: low to high'),
self::FIELD_CREATED => __('Created'),
];
}
}
@@ -0,0 +1,17 @@
<?php
namespace Olegnax\ProductSlider\Model\Config\Source;
class SortOrderCat extends \Olegnax\ProductSlider\Model\Config\Source\SortOrder
{
public const FIELD_POSITION = 'position';
public function toArray()
{
$data = parent::toArray();
$data[self::FIELD_POSITION] = __('Position');
return $data;
}
}
@@ -0,0 +1,72 @@
<?php
/**
* Olegnax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Olegnax.com license that is
* available through the world-wide-web at this URL:
* https://www.olegnax.com/license
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Olegnax
* @package Olegnax_ProductSlider
* @copyright Copyright (c) 2023 Olegnax (http://www.olegnax.com/)
* @license https://www.olegnax.com/license
*/
namespace Olegnax\ProductSlider\Model\ResourceModel\Report\Product;
class Collection extends \Magento\Reports\Model\ResourceModel\Product\Collection
{
/**
* Add views count.
*
* @param string $from
* @param string $to
* @return \Magento\Reports\Model\ResourceModel\Product\Collection
*/
public function addViewsCount($from = '', $to = '')
{
/**
* Getting event type id for catalog_product_view event
*/
$eventTypes = $this->_eventTypeFactory->create()->getCollection();
foreach ($eventTypes as $eventType) {
if ($eventType->getEventName() == 'catalog_product_view') {
$productViewEvent = (int)$eventType->getId();
break;
}
}
$this->getSelect()->reset()->from(
['report_table_views' => $this->getTable('report_event')],
['views' => 'COUNT(report_table_views.event_id)']
)->join(
['e' => $this->getProductEntityTableName()],
'e.entity_id = report_table_views.object_id'
)->where(
'report_table_views.event_type_id = ?',
$productViewEvent
)->group(
'e.entity_id'
)->order(
'views ' . self::SORT_ORDER_DESC
)->having(
'COUNT(report_table_views.event_id) > ?',
0
);
if ($from != '' && $to != '') {
$this->getSelect()->where('logged_at >= ?', $from)->where('logged_at <= ?', $to);
}
return $this;
}
}
+10
View File
@@ -0,0 +1,10 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Olegnax_ProductSlider" setup_version="0.4.0.1">
<sequence>
<module name="Olegnax_Core"/>
<module name="Magento_Theme"/>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
ComponentRegistrar::MODULE,
'Olegnax_ProductSlider',
__DIR__
);
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

@@ -0,0 +1,14 @@
<?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" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.widget.details.renderers">
<block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
</block>
</body>
</page>
@@ -0,0 +1,5 @@
var config = {
paths: {
'loopOwlAddtocart': 'Olegnax_ProductSlider/js/loopaddtocart-owl.carousel',
}
};
@@ -0,0 +1,202 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var ProductsList $block */
use Magento\Catalog\Block\Product\ReviewRendererInterface;
use Magento\CatalogWidget\Block\Product\ProductsList;
use Magento\Framework\App\Action\Action;
?>
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?>
<?php
$theme_helper = $this->helper('Olegnax\Athlete2\Helper\ProductList');
$showTitle = $this->getShowTitle();
$titleTag = 'strong';
$navPosition = $this->getNavPosition();
if ($this->getTitleTag()) {
$titleTag = $this->getTitleTag();
}
$classes = [
'product-columns-' . $this->getColumnsDesktop(),
'product-columns-l-' . $this->getColumnsDesktopSmall(),
'product-columns-m-' . $this->getColumnsTablet(),
'product-columns-s-' . $this->getColumnsMobile(),
'owl-dots--align-' . $this->getDotsAlign(),
'owl-nav--position-' . $navPosition,
'title--align-' . $this->getTitleAlign(),
];
if ($this->getDots()) {
$classes[] = 'owl-dots--show';
}
if ($this->getTitleSideLine()) {
$classes[] = 'title--sideline';
}
$type = 'widget-product-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
$items = $block->getProductCollection()->getItems();
$showWishlist = $this->getShowWishlist();
$showCompare = $this->getShowCompare();
$showCart = $this->getShowAddtocart();
$showQuickview = $this->getShowQuickview() && $theme_helper->isActivePlugin('Olegnax_Quickview');
$showReview = $this->getShowReview();
$templateType = ReviewRendererInterface::DEFAULT_VIEW;
$description = false;
$cartIcon = '<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>';
$compareIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>';
$titleClass = 'no-title';
if ($showTitle) {
$titleClass = 'title-' . $titleTag;
}
?>
<div id="ox_<?= $block->getUnderlineNameInLayout() ?>"
class="block widget products-grid__layout-default block-products-list <?= /* @noEscape */
$mode ?> <?=
implode(' ', $classes)
?>">
<?php if ($showTitle && $block->getTitle() || ($navPosition == 'title' && $this->getNav())): ?>
<div class="block-title <?= $titleClass ?>">
<?php if ($showTitle && $block->getTitle()) { ?>
<<?= $titleTag ?>><?= $block->escapeHtml(__($block->getTitle())) ?></<?= $titleTag ?>>
<?php } ?>
<?php if ($navPosition == 'title') { ?>
<div class="owl-nav ox-owl-nav">
<button type="button" role="presentation" class="owl-prev ox-owl-prev"><span
aria-label="Previous">‹</span></button>
<button type="button" role="presentation" class="owl-next ox-owl-next"><span aria-label="Next">›</span>
</button>
</div>
<?php } ?>
</div>
<?php endif ?>
<div class="block-content">
<div class="products-<?= /* @noEscape */
$mode ?> <?= /* @noEscape */
$mode ?>">
<div class="product-items owl-carousel <?= /* @noEscape */
$type ?>" data-role="product-owlCarousel"
data-mage-init='{"OXowlCarousel":<?= $block->escapeHtml($block->getCarouselOptions()) ?>}'>
<?php $iterator = 1; ?>
<?php foreach ($items as $_item): ?>
<div class="product-item-info">
<div class="product-grid__image-wrapper">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getLazyImage($_item, $image)->toHtml() ?>
</a>
<?php if ($showWishlist || $showCompare || $showCart || $showQuickview): ?>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary">
<?php if ($_item->isSaleable() && $showCart): ?>
<?php $postParams = $block->getAddToCartPostParams($_item); ?>
<form data-role="tocart-form"
data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>"
action="<?= /* @NoEscape */
$postParams['action'] ?>" method="post">
<input type="hidden" name="product"
value="<?= /* @escapeNotVerified */
$postParams['data']['product'] ?>">
<input type="hidden" name="<?= Action::PARAM_NAME_URL_ENCODED ?>"
value="<?= /* @escapeNotVerified */
$postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
class="action tocart primary">
<?= $cartIcon ?><span><?= /* @escapeNotVerified */
__('Add to Cart') ?></span>
</button>
</form>
<?php endif; ?>
<?php if ($showWishlist || $showCompare): ?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#"
data-post='<?= /* @noEscape */
$block->getAddToWishlistParams($_item) ?>'
class="action towishlist" data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
<a href="#" class="action tocompare"
data-post='<?= /* @noEscape */
$compareHelper->getPostDataParams($_item) ?>'
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
<?= $compareIcon ?>
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php
if ($showQuickview) {
echo $this->helper('Olegnax\Quickview\Helper\Helper')->getButton($_item, 'button quick-view');
}
?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="overlay-link"></a>
</div>
<?php endif; ?>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<strong class="product-item-name">
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?php
echo $block->getProductPriceHtml($_item, $type);
echo $block->getMSRPHtml($_item);
?>
<?php if ($templateType && $showReview): ?>
<?= $block->getReviewsSummaryHtml($_item, $templateType)
?>
<?php endif; ?>
</div>
</div>
<?php endforeach ?>
</div>
</div>
<?= $block->getPagerHtml() ?>
</div>
<?php if (isset($_item) && $showCart && !$block->isRedirectToCartEnabled()): ?>
<script type="text/x-magento-init">
{
"[data-role=tocart-form], .form.map.checkout": {
"catalogAddToCart": {
"product_sku": "<?= /* @NoEscape */
$_item->getSku() ?>"
}
},
"[data-role=product-owlCarousel]": {
"loopOwlAddtocart": {}
}
}
</script>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,205 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var ProductsList $block */
use Magento\Catalog\Block\Product\ReviewRendererInterface;
use Magento\CatalogWidget\Block\Product\ProductsList;
use Magento\Framework\App\Action\Action;
?>
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?>
<?php
$theme_helper = $this->helper('Olegnax\Athlete2\Helper\ProductList');
$showTitle = $this->getShowTitle();
$showCategory = $theme_helper->getConfig('athlete2_settings/products_listing/category_name');
$titleTag = 'strong';
$navPosition = $this->getNavPosition();
if ($this->getTitleTag()) {
$titleTag = $this->getTitleTag();
}
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
if ($this->getDots()) {
$classes[] = 'owl-dots--show';
}
if ($this->getTitleSideLine()) {
$classes[] = 'title--sideline';
}
$type = 'widget-product-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
$items = $block->getProductCollection()->getItems();
$showWishlist = $this->getShowWishlist();
$showCompare = $this->getShowCompare();
$showCart = $this->getShowAddtocart();
$showQuickview = $this->getShowQuickview() && $theme_helper->isActivePlugin('Olegnax_Quickview');
$showReview = $this->getShowReview();
$templateType = ReviewRendererInterface::DEFAULT_VIEW;
$description = false;
$cartIcon = '<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>';
$compareIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>';
$titleClass = 'no-title';
if ($showTitle) {
$titleClass = 'title-' . $titleTag;
}
?>
<div id="ox_<?= $block->getUnderlineNameInLayout() ?>"
class="block widget products-grid__layout-2 block-products-list <?= /* @noEscape */
$mode ?> <?=
implode(' ', $classes)
?>">
<?php if ($showTitle && $block->getTitle() || ($navPosition == 'title' && $this->getNav())): ?>
<div class="block-title <?= $titleClass ?>">
<?php if ($showTitle && $block->getTitle()) { ?>
<<?= $titleTag ?>><?= $block->escapeHtml(__($block->getTitle())) ?></<?= $titleTag ?>>
<?php } ?>
<?php if ($navPosition == 'title') { ?>
<div class="owl-nav ox-owl-nav">
<button type="button" role="presentation" class="owl-prev ox-owl-prev"><span
aria-label="Previous">‹</span></button>
<button type="button" role="presentation" class="owl-next ox-owl-next"><span aria-label="Next">›</span>
</button>
</div>
<?php } ?>
</div>
<?php endif ?>
<div class="block-content">
<div class="products-<?= /* @noEscape */
$mode ?> <?= /* @noEscape */
$mode ?>">
<div class="product-items owl-carousel <?= /* @noEscape */
$type ?>" data-role="product-owlCarousel"
data-mage-init='{"OXowlCarousel":<?= $block->escapeHtml($block->getCarouselOptions()) ?>}'>
<?php $iterator = 1; ?>
<?php foreach ($items as $_item): ?>
<div class="product-item-info">
<div class="product-grid__image-wrapper">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getLazyImage($_item, $image)->toHtml() ?>
</a>
<?php if ($showCart || $showQuickview): ?>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary">
<?php if ($_item->isSaleable() && $showCart): ?>
<?php $postParams = $block->getAddToCartPostParams($_item); ?>
<form data-role="tocart-form"
data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>"
action="<?= /* @NoEscape */
$postParams['action'] ?>" method="post">
<input type="hidden" name="product"
value="<?= /* @escapeNotVerified */
$postParams['data']['product'] ?>">
<input type="hidden" name="<?= /* @noEscape */ Action::PARAM_NAME_URL_ENCODED ?>"
value="<?= /* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
class="action tocart primary">
<?= $cartIcon ?><span><?= /* @escapeNotVerified */
__('Add to Cart') ?></span>
</button>
</form>
<?php endif; ?>
</div>
<?php
if ($showQuickview) {
echo $this->helper('Olegnax\Quickview\Helper\Helper')->getButton($_item, 'button quick-view');
}
?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="overlay-link"></a>
</div>
<?php endif; ?>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<?php if ($showCategory && $category = $theme_helper->getLastCategory($_item)) : ?>
<div class="ox-product-grid__categories"><a href="<?= $category->getUrl(); ?>"
class="ox-product-grid__category-link"><?= $category->getName(); ?></a>
</div>
<?php endif; ?>
<?php if ($showWishlist || $showCompare): ?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#"
data-post='<?= /* @noEscape */
$block->getAddToWishlistParams($_item) ?>' class="action towishlist"
data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */
$compareHelper->getPostDataParams($_item) ?>'
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
<?= $compareIcon ?>
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<strong class="product-item-name">
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?php
echo $block->getProductPriceHtml($_item, $type);
echo $block->getMSRPHtml($_item);
?>
<?php if ($templateType && $showReview): ?>
<?= $block->getReviewsSummaryHtml($_item, $templateType)
?>
<?php endif; ?>
</div>
</div>
<?php endforeach ?>
</div>
</div>
<?= $block->getPagerHtml() ?>
</div>
<?php if (isset($_item) && $showCart && !$block->isRedirectToCartEnabled()): ?>
<script type="text/x-magento-init">
{
"[data-role=tocart-form], .form.map.checkout": {
"catalogAddToCart": {
"product_sku": "<?= /* @NoEscape */
$_item->getSku() ?>"
}
},
"[data-role=product-owlCarousel]": {
"loopOwlAddtocart": {}
}
}
</script>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,32 @@
<?php
/**
*
*/
$showTitle = $this->getShowTitle();
$titleTag = 'strong';
$navPosition = $this->getNavPosition();
if ($this->getTitleTag()) {
$titleTag = $this->getTitleTag();
}
?>
<div id="ox_<?= $block->getUnderlineNameInLayout() ?>" class="block widget">
<?php if ($showTitle && $block->getTitle()): ?>
<div class="block-title">
<<?= $titleTag ?>><?= $block->escapeHtml(__($block->getTitle())) ?></<?= $titleTag ?>>
<?php if ($navPosition == 'title') { ?>
<div class="owl-nav ox-owl-nav">
<button type="button" role="presentation" class="owl-prev ox-owl-prev"><span aria-label="Previous">‹</span>
</button>
<button type="button" role="presentation" class="owl-next ox-owl-next"><span aria-label="Next">›</span>
</button>
</div>
<?php } ?>
</div>
<?php endif ?>
<div class="block-content">
<div class="owl-carousel" data-role="custom-owlCarousel"
data-mage-init='{"OXowlCarousel":<?= $block->escapeHtml($block->getCarouselOptions()) ?>}'>
<?= $block->getContent() ?>
</div>
</div>
</div>
@@ -0,0 +1,176 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
use Magento\Catalog\Block\Product\ReviewRendererInterface;
use Magento\CatalogWidget\Block\Product\ProductsList;
use Magento\Framework\App\Action\Action;
/** @var ProductsList $block */
?>
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?>
<?php
$showTitle = $this->getShowTitle();
$titleTag = 'strong';
if ($this->getTitleTag()) {
$titleTag = $this->getTitleTag();
}
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
if ($this->getTitleSideLine()) {
$classes[] = 'title--sideline';
}
$type = 'widget-product-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
$items = $block->getProductCollection()->getItems();
$showWishlist = $this->getShowWishlist();
$showCompare = $this->getShowCompare();
$showCart = $this->getShowAddtocart();
$showQuickview = $this->getShowQuickview();
$showReview = $this->getShowReview();
$templateType = ReviewRendererInterface::DEFAULT_VIEW;
$description = false;
$cartIcon = '<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>';
$compareIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>';
?>
<div id="ox_<?= $block->getNameInLayout() ?>"
class="block widget products-grid__layout-default block-products-list <?= /* @noEscape */
$mode ?> <?= implode(' ',
$classes) ?>">
<?php if ($showTitle && $block->getTitle()): ?>
<div class="block-title">
<<?= $titleTag ?>><?= $block->escapeHtml(__($block->getTitle())) ?></<?= $titleTag ?>>
</div>
<?php endif ?>
<div class="block-content">
<div class="products-<?= /* @noEscape */
$mode ?> <?= /* @noEscape */
$mode ?>">
<ol class="product-items <?= /* @noEscape */
$type ?>">
<?php $iterator = 1; ?>
<?php foreach ($items as $_item): ?>
<?= /* @noEscape */
($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?>
<div class="product-item-info">
<div class="product-grid__image-wrapper">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getImage($_item, $image)->toHtml() ?>
</a>
<?php if ($showWishlist || $showCompare || $showCart || $showQuickview): ?>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary">
<?php if ($_item->isSaleable() && $showCart): ?>
<?php $postParams = $block->getAddToCartPostParams($_item); ?>
<form data-role="tocart-form"
data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>"
action="<?= /* @NoEscape */
$postParams['action'] ?>" method="post">
<input type="hidden" name="product"
value="<?= /* @escapeNotVerified */
$postParams['data']['product'] ?>">
<input type="hidden" name="<?= /* @noEscape */ Action::PARAM_NAME_URL_ENCODED ?>"
value="<?= /* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
class="action tocart primary">
<?= $cartIcon ?><span><?= /* @escapeNotVerified */
__('Add to Cart') ?></span>
</button>
</form>
<?php endif; ?>
<?php if ($showWishlist || $showCompare): ?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#"
data-post='<?= /* @noEscape */
$block->getAddToWishlistParams($_item) ?>'
class="action towishlist" data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
<a href="#" class="action tocompare"
data-post='<?= /* @noEscape */
$compareHelper->getPostDataParams($_item) ?>'
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
<?= $compareIcon ?>
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php if ($showQuickview): ?>
<a class="button quick-view"><span><?= /* @escapeNotVerified */
__('Quick view') ?></span></a>
<?php endif; ?>
</div>
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="overlay-link"></a>
</div>
<?php endif; ?>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<strong class="product-item-name">
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?php
echo $block->getProductPriceHtml($_item, $type);
echo $block->getMSRPHtml($_item);
?>
<?php if ($templateType && $showReview): ?>
<?= $block->getReviewsSummaryHtml($_item,
$templateType) ?>
<?php endif; ?>
</div>
</div>
<?= ($iterator == count($items) + 1) ? '</li>' : '' ?>
<?php endforeach ?>
</ol>
</div>
<?= $block->getPagerHtml() ?>
</div>
<?php if (isset($_item) && $showCart && !$block->isRedirectToCartEnabled()): ?>
<script type="text/x-magento-init">
{
"[data-role=tocart-form], .form.map.checkout": {
"catalogAddToCart": {
"product_sku": "<?= /* @NoEscape */
$_item->getSku() ?>"
}
}
}
</script>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,149 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
use Magento\Catalog\Block\Product\ReviewRendererInterface;
use Magento\CatalogWidget\Block\Product\ProductsList;
use Magento\Framework\App\Action\Action;
/** @var ProductsList $block */
?>
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?>
<?php
$type = 'widget-product-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
$items = $block->getProductCollection()->getItems();
$showWishlist = true;
$showCompare = true;
$showCart = true;
$templateType = ReviewRendererInterface::DEFAULT_VIEW;
$description = false;
$cartIcon = '<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>';
$compareIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>';
?>
<div id="ox_<?= $block->getNameInLayout() ?>" class="block widget block-products-list <?= /* @noEscape */
$mode ?>">
<?php if ($block->getTitle()): ?>
<div class="block-title">
<strong><?= $block->escapeHtml(__($block->getTitle())) ?></strong>
</div>
<?php endif ?>
<div class="block-content">
<div class="products-<?= /* @noEscape */
$mode ?> <?= /* @noEscape */
$mode ?>">
<ol class="product-items <?= /* @noEscape */
$type ?>">
<?php $iterator = 1; ?>
<?php foreach ($items as $_item): ?>
<?= /* @noEscape */
($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?>
<div class="product-item-info">
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-photo">
<?= $block->getImage($_item, $image)->toHtml() ?>
</a>
<div class="product-item-details">
<strong class="product-item-name">
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
class="product-item-link">
<?= $block->escapeHtml($_item->getName()) ?>
</a>
</strong>
<?php
echo $block->getProductPriceHtml($_item, $type);
echo $block->getMSRPHtml($_item);
?>
<?php if ($templateType): ?>
<?= $block->getReviewsSummaryHtml($_item,
$templateType) ?>
<?php endif; ?>
<?php if ($showWishlist || $showCompare || $showCart): ?>
<div class="product-item-actions">
<?php if ($showCart): ?>
<div class="actions-primary">
<?php if ($_item->isSaleable() && $showCart): ?>
<?php $postParams = $block->getAddToCartPostParams($_item); ?>
<form data-role="tocart-form"
data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>"
action="<?= /* @NoEscape */
$postParams['action'] ?>" method="post">
<input type="hidden" name="product"
value="<?= /* @escapeNotVerified */
$postParams['data']['product'] ?>">
<input type="hidden" name="<?= Action::PARAM_NAME_URL_ENCODED ?>"
value="<?= /* @escapeNotVerified */
$postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
class="action tocart primary">
<?= $cartIcon ?><span><?= /* @escapeNotVerified */
__('Add to Cart') ?></span>
</button>
</form>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($showWishlist || $showCompare): ?>
<div class="actions-secondary" data-role="add-to-links">
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
<a href="#"
data-post='<?= /* @noEscape */
$block->getAddToWishlistParams($_item) ?>'
class="action towishlist" data-action="add-to-wishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */
$compareHelper->getPostDataParams($_item) ?>'
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
<?= ($iterator == count($items) + 1) ? '</li>' : '' ?>
<?php endforeach ?>
</ol>
</div>
<?= $block->getPagerHtml() ?>
</div>
<?php if (isset($_item) && $showCart && !$block->isRedirectToCartEnabled()): ?>
<script type="text/x-magento-init">
{
"[data-role=tocart-form], .form.map.checkout": {
"catalogAddToCart": {
"product_sku": "<?= /* @NoEscape */
$_item->getSku() ?>"
}
}
}
</script>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -0,0 +1,33 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Catalog\Block\Product\Image; ?>
<?php /** @var $block Image */ ?>
<span class="product-image-container"
style="width:<?= /* @escapeNotVerified */
$block->getWidth() ?>px;">
<span class="product-image-wrapper"
style="padding-bottom: <?= /* @escapeNotVerified */
($block->getRatio() * 100) ?>%;">
<img class="product-image-photo owl-lazy"
<?php if(is_array($block->getCustomAttributes())): ?>
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
<?php endforeach; ?>
<?php else : ?>
<?= /* @escapeNotVerified */ $block->getCustomAttributes(); ?>
<?php endif; ?>
src="<?= $this->getViewFileUrl('Olegnax_Core/images/preloader-img.svg'); ?>"
data-src="<?= /* @escapeNotVerified */
$block->getImageUrl() ?>"
width="<?= /* @escapeNotVerified */
$block->getWidth() ?>"
height="<?= /* @escapeNotVerified */
$block->getHeight() ?>"
alt="<?= /* @escapeNotVerified */
$block->stripTags($block->getLabel(), null, true) ?>"/></span>
</span>
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$carouselOptions = $this->getCarouselOptions();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$navPosition = $this->getNavPosition();
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getDots() ? 'owl-dots--show' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $this->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
$_nav = false;
$nav = $this->getNav();
if ( $navPosition == 'title' && $nav ){
$_nav = true;
}
$_showTitle = false;
if ( $showTitle && $title){
$_showTitle = true;
}
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/carousel-v1',
'additionalClasses' => $wrapper_classes,
'carouselOptions' => $carouselOptions,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$_showTitle
],
'owl-nav' =>[
'show' => (bool)$_nav
],
'owl-init' =>[
'show' => true,
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$carouselOptions = $this->getCarouselOptions();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$navPosition = $this->getNavPosition();
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getDots() ? 'owl-dots--show' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $this->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-2 block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
$_nav = false;
$nav = $this->getNav();
if ( $navPosition == 'title' && $nav ){
$_nav = true;
}
$_showTitle = false;
if ( $showTitle && $title){
$_showTitle = true;
}
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/carousel-v2',
'additionalClasses' => $wrapper_classes,
'carouselOptions' => $carouselOptions,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$_showTitle
],
'owl-nav' =>[
'show' => (bool)$_nav
],
'owl-init' =>[
'show' => true,
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$carouselOptions = $this->getCarouselOptions();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$navPosition = $this->getNavPosition();
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getDots() ? 'owl-dots--show' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $this->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
$_nav = false;
$nav = $this->getNav();
if ( $navPosition == 'title' && $nav ){
$_nav = true;
}
$_showTitle = false;
if ( $showTitle && $title){
$_showTitle = true;
}
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/carousel-v3',
'additionalClasses' => $wrapper_classes,
'carouselOptions' => $carouselOptions,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$_showTitle
],
'owl-nav' =>[
'show' => (bool)$_nav
],
'owl-init' =>[
'show' => true,
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$carouselOptions = $this->getCarouselOptions();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$navPosition = $this->getNavPosition();
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getDots() ? 'owl-dots--show' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $this->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
$_nav = false;
$nav = $this->getNav();
if ( $navPosition == 'title' && $nav ){
$_nav = true;
}
$_showTitle = false;
if ( $showTitle && $title){
$_showTitle = true;
}
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/carousel-v4',
'additionalClasses' => $wrapper_classes,
'carouselOptions' => $carouselOptions,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$_showTitle
],
'owl-nav' =>[
'show' => (bool)$_nav
],
'owl-init' =>[
'show' => true,
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$carouselOptions = $this->getCarouselOptions();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$navPosition = $this->getNavPosition();
$classes = [];
$classes[] = 'product-columns-' . $this->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $this->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $this->getColumnsTablet();
$classes[] = 'product-columns-s-' . $this->getColumnsMobile();
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = 'owl-dots--align-' . $this->getDotsAlign();
$classes[] = 'owl-nav--position-' . $navPosition;
$classes[] = 'title--align-' . $this->getTitleAlign();
$classes[] = $this->getDots() ? 'owl-dots--show' : '';
$classes[] = $this->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $this->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below secondary-top-right block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
$_nav = false;
$nav = $this->getNav();
if ( $navPosition == 'title' && $nav ){
$_nav = true;
}
$_showTitle = false;
if ( $showTitle && $title){
$_showTitle = true;
}
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/carousel-v5',
'additionalClasses' => $wrapper_classes,
'carouselOptions' => $carouselOptions,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$_showTitle
],
'owl-nav' =>[
'show' => (bool)$_nav
],
'owl-init' =>[
'show' => true,
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$classes = [];
$classes[] = 'product-columns-' . $block->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $block->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $block->getColumnsTablet();
$classes[] = 'product-columns-s-' . $block->getColumnsMobile();
$classes[] = 'title--align-' . $block->getTitleAlign();
$classes[] = $block->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $block->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $block->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/grid-v1',
'additionalClasses' => $wrapper_classes,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$showTitle
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$classes = [];
$classes[] = 'product-columns-' . $block->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $block->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $block->getColumnsTablet();
$classes[] = 'product-columns-s-' . $block->getColumnsMobile();
$classes[] = 'title--align-' . $block->getTitleAlign();
$classes[] = $block->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $block->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $block->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-2 block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/grid-v2',
'additionalClasses' => $wrapper_classes,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$showTitle
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$classes = [];
$classes[] = 'product-columns-' . $block->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $block->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $block->getColumnsTablet();
$classes[] = 'product-columns-s-' . $block->getColumnsMobile();
$classes[] = 'title--align-' . $block->getTitleAlign();
$classes[] = $block->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $block->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $block->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/grid-v3',
'additionalClasses' => $wrapper_classes,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$showTitle
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$classes = [];
$classes[] = 'product-columns-' . $block->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $block->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $block->getColumnsTablet();
$classes[] = 'product-columns-s-' . $block->getColumnsMobile();
$classes[] = 'title--align-' . $block->getTitleAlign();
$classes[] = $block->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $block->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $block->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/grid-v4',
'additionalClasses' => $wrapper_classes,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$showTitle
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Ui\Block\Wrapper;
use Olegnax\Athlete2\Helper\ProductList;
?>
<?php
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
/** @var $block Wrapper */
?>
<?php
$theme_helper = $this->helper( ProductList::class );
$at_settings = $theme_helper->getModuleConfig();
$showTitle = $block->getShowTitle();
$titleTag = $block->getTitleTag() ?: 'strong';
$title = $block->getTitle();
$titleClass = 'no-title';
if ( $showTitle ) {
$titleClass = 'title-' . $titleTag;
}
$titleClass .= ' block-title title';
$classes = [];
$classes[] = 'product-columns-' . $block->getColumnsDesktop();
$classes[] = 'product-columns-l-' . $block->getColumnsDesktopSmall();
$classes[] = 'product-columns-m-' . $block->getColumnsTablet();
$classes[] = 'product-columns-s-' . $block->getColumnsMobile();
$classes[] = 'title--align-' . $block->getTitleAlign();
$classes[] = $block->getProductsLayoutCentered() ? 'align-details-center' : '';
$classes[] = $block->getTitleSideLine() ? 'title--sideline' : '';
$classes[] = $block->getCustomClass();
$type = 'widget-product-grid';
$mode = 'grid';
$wrapper_classes = 'widget block-viewed-products-grid products-grid__layout-default products-grid__buttons-below secondary-top-right block-products-list ' . $mode . ' ' . $block->escapeHtml(implode( ' ', $classes) );
?>
<?php /* @noEscape */ echo $block->renderApp([
'widget_columns' => [
'label' => $title,
'titleClasses' => $titleClass,
'displayMode' => $mode,
'template' => 'Olegnax_ProductSlider/product/list/grid-v5',
'additionalClasses' => $wrapper_classes,
],
'title' => [
'label' => $title,
'tag' => $titleTag,
'show' => (bool)$showTitle
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
]);
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="widget_columns" component="Magento_Catalog/js/product/list/listing" template="Magento_Catalog/product/list/listing">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Recently Viewed</item>
<item name="additionalClasses" xsi:type="string">widget block-viewed-products-grid</item>
<item name="titleClasses" xsi:type="string">block-title title</item>
<item name="listTemplate" xsi:type="string">Magento_Catalog/product/list/listing</item>
<item name="carouselOptions" xsi:type="string">0</item>
</item>
</argument>
<settings>
<displayMode>grid</displayMode>
</settings>
<column name="title" component="Olegnax_ProductSlider/js/product/title" sortOrder="0" displayArea="title-area">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string">Recently Viewed</item>
<item name="tag" xsi:type="string">strong</item>
<item name="show" xsi:type="boolean">true</item>
<item name="sortOrder" xsi:type="number">0</item>
</item>
</argument>
<settings>
<label translate="true">title</label>
<bodyTmpl>Olegnax_ProductSlider/product/title</bodyTmpl>
</settings>
</column>
<column name="owl-init" component="Olegnax_ProductSlider/js/product/owl-init" sortOrder="1" displayArea="wrap-area">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="show" xsi:type="boolean">false</item>
</item>
</argument>
<settings>
<label translate="true">Owl Init</label>
<bodyTmpl>Olegnax_ProductSlider/product/owl-init</bodyTmpl>
</settings>
</column>
<column name="owl-nav" component="Olegnax_ProductSlider/js/product/owl-nav" sortOrder="2" displayArea="title-area">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="show" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="number">2</item>
</item>
</argument>
<settings>
<label translate="true">Owl nav</label>
<bodyTmpl>Olegnax_ProductSlider/product/owl-nav</bodyTmpl>
</settings>
</column>
<column name="image" component="Magento_Catalog/js/product/list/columns/image" sortOrder="0" displayArea="general-area">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="imageCode" xsi:type="string">recently_viewed_products_grid_content_widget</item>
</item>
</argument>
<settings>
<label translate="true">Image</label>
<bodyTmpl>Magento_Catalog/product/list/columns/image_with_borders</bodyTmpl>
</settings>
</column>
<column name="overlay-link" component="Olegnax_ProductSlider/js/product/overlay-link" sortOrder="1" displayArea="product-item-inner-area">
<settings>
<label translate="true">Product Link</label>
<bodyTmpl>Olegnax_ProductSlider/product/overlay-link</bodyTmpl>
</settings>
</column>
<column name="name" component="Magento_Catalog/js/product/name" sortOrder="1" displayArea="details-area">
<settings>
<label translate="true">Name</label>
<bodyTmpl>Magento_Catalog/product/name</bodyTmpl>
</settings>
</column>
<column name="addtocart-button" component="Magento_Catalog/js/product/addtocart-button" displayArea="action-primary-area">
<settings>
<label translate="true">Add To Cart</label>
<bodyTmpl>Olegnax_ProductSlider/product/addtocart-button</bodyTmpl>
</settings>
</column>
<column name="addtocompare-button" component="Magento_Catalog/js/product/addtocompare-button" sortOrder="2" displayArea="action-secondary-area">
<settings>
<label translate="true">Add To Compare</label>
<bodyTmpl>Olegnax_ProductSlider/product/addtocompare-button</bodyTmpl>
</settings>
</column>
<column name="learn-more" component="Magento_Catalog/js/product/learn-more" displayArea="description-area">
<settings>
<label translate="true">Learn more</label>
<bodyTmpl>Olegnax_ProductSlider/product/link</bodyTmpl>
</settings>
</column>
</columns>
</listing>
@@ -0,0 +1,482 @@
//
// Variables
// _____________________________________________
@product-widget-title-side-line-color: rgba(107, 107, 107, 0.18);
//
// Mixins
// _____________________________________________
.grid-col(@col) {
max-width: 100%/@col;
-webkit-flex-basis: 100%/@col;
-ms-flex-preferred-size: 100%/@col;
flex-basis: 100%/@col;
}
.desktop-products-grid() {
&.product-columns-8 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(8);
}
}
&.product-columns-7 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(7);
}
}
&.product-columns-6 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(6);
}
}
&.product-columns-5 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(5);
}
}
&.product-columns-4 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(4);
}
}
&.product-columns-3 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(3);
}
}
&.product-columns-2 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(2);
}
}
}
.small-desktop-products-grid() {
&.product-columns-l-8 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(8);
}
}
&.product-columns-l-7 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(7);
}
}
&.product-columns-l-6 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(6);
}
}
&.product-columns-l-5 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(5);
}
}
&.product-columns-l-4 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(4);
}
}
&.product-columns-l-3 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(3);
}
}
&.product-columns-l-2 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(2);
}
}
}
.tablet-products-grid() {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(3);
}
&.product-columns-m-6 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(6);
}
}
&.product-columns-m-5 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(5);
}
}
&.product-columns-m-4 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(4);
}
}
&.product-columns-m-3 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(3);
}
}
&.product-columns-m-2 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(2);
}
}
}
.mobile-products-grid() {
&.product-columns-s-2 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(2);
}
}
&.product-columns-s-1 {
.owl-carousel:not(.owl-loaded) > .product-item-info,
.products-grid .product-item {
.grid-col(1);
}
}
}
//
// Common
// _____________________________________________
& when (@media-common = true) {
.products-grid .product-items.owl-carousel .product-item {
&,
.page-products &{
max-width: none!important;
}
}
.owl-dots--align-center {
.owl-carousel {
.owl-dots {
width: 100%;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-flex-pack: center;
-ms-justify-content: center;
justify-content: center;
}
}
}
.widget {
&.block-products-list {
.owl-carousel:not(.owl-loaded) {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
> .product-item-info{
opacity:0;
visibility:hidden;
}
}
margin-bottom: 60px;
.products-grid {
.product-items:not(.owl-carousel){
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: row wrap;
-ms-flex-flow: row wrap;
flex-flow: row wrap;
.product-item{
width:100%;
}
}
}
.block-title {
margin-bottom: 15px;
strong, h1, h2, h3, h4, h5, h6 {
max-width: calc(~"100% - 70px");
margin: 0;
line-height: 1;
display: inline-block;
vertical-align: middle;
}
.owl-nav {
margin-left: 20px;
display: inline-block;
vertical-align: middle;
}
&.no-title {
.owl-nav {
margin-left: 0;
}
}
&.title-h1,
&.title-h2,
&.title-h3 {
margin-bottom: 30px;
}
}
&.title--align-center {
.block-title {
text-align: center;
}
}
&.owl-nav--position-title {
.owl-carousel {
.owl-nav {
display: none;
}
}
}
&.title--sideline {
&.title--align-left {
.block-title {
display: flex;
align-items: center;
overflow: hidden;
text-align: left;
&:after {
background-color: @product-widget-title-side-line-color;
content: "";
display: inline-block;
height: 1px;
position: relative;
vertical-align: middle;
width: 100%;
left: 30px;
margin-right: -100%;
}
&.no-title {
&:after {
left: 10px;
}
}
}
}
&.title--align-center {
.block-title {
overflow: hidden;
text-align: center;
&:before,
&:after {
background-color: @product-widget-title-side-line-color;
content: "";
display: inline-block;
height: 1px;
position: relative;
vertical-align: middle;
width: 50%;
}
&:before {
right: 30px;
margin-left: -100%;
}
&:after {
left: 30px;
margin-right: -100%;
}
&.no-title {
&:after {
left: 10px;
}
&:before {
right: 10px;
}
}
}
}
}
}
}
.owl-carousel.widget-product-grid {
.owl-nav {
visibility: hidden;
opacity: 0;
transition: opacity 0.2s, visibility 0.2s;
button {
transition: transform 0.2s ease;
&.owl-next,
&.owl-prev {
position: absolute;
top: 50%;
&.disabled {
opacity: 0.2;
cursor: default;
pointer-events: none;
}
}
&.owl-prev {
transform: translateX(-20px) translateY(-50%);
left: -10px;
}
&.owl-next {
transform: translateX(20px) translateY(-50%);
right: -10px;
span {
transform: rotate(180deg);
}
}
}
}
}
.owl-dots--show {
.owl-carousel {
.owl-nav {
button {
&.owl-next,
&.owl-prev {
margin-top: -25px;
}
}
}
}
}
.block.widget{
.page-layout-1column-fullwidth &,
.page-layout-3columns &,
.page-layout-1column &,
& {
.mobile-products-grid();
}
}
.product-grid__image-wrapper .action:is(.tocompare, .towishlist):after{
content: none;
}
.widget.block-products-list .block-title {
.title-wrap{
max-width: ~"calc(100% - 70px)";
margin: 0;
line-height: 1;
display: inline-block;
vertical-align: middle;
& > *{
max-width: 100%;
}
}
}
}
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) {
.widget.block-products-list {
&.owl-nav--position-title {
.block-title {
.title-wrap, strong, h1, h2, h3, h4, h5, h6 {
max-width: calc(~"100% - 60px");
}
.title-wrap{
& > *{
max-width: 100%;
}
}
.owl-nav {
margin-left: 10px;
}
}
}
}
}
//
// Tablet
// _____________________________________________
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
.block.widget{
.page-layout-1column-fullwidth &,
.page-layout-3columns &,
.page-layout-1column &,
& {
.tablet-products-grid();
}
}
}
//
// Small Desktop
// _____________________________________________
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
.owl-carousel.widget-product-grid {
&:hover {
.owl-nav {
visibility: visible;
opacity: 1;
}
}
}
.block.widget{
.page-layout-1column-fullwidth &,
.page-layout-3columns &,
.page-layout-1column &,
& {
.small-desktop-products-grid();
}
}
.widget {
&.block-products-list {
.block-title {
h1 {
font-size: 58px;
}
}
}
}
}
//
// Desktop
// _____________________________________________
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {
.block.widget{
.page-layout-1column-fullwidth &,
.page-layout-3columns &,
.page-layout-1column &,
& {
.desktop-products-grid();
}
}
}
@@ -0,0 +1,20 @@
define([
'jquery',
'jquery-ui-modules/widget',
'jquery-ui-modules/core',
'catalogAddToCart'
], function ($) {
'use strict';
$.widget('ox.loopOwlAddtocart', {
options: {},
_create: function () {
this.element.find('.cloned [data-role=tocart-form]').catalogAddToCart();
this.element.on('initialize.owl.carousel initialized.owl.carousel', function (e) {
$(this).find('.cloned [data-role=tocart-form]').catalogAddToCart();
});
}
});
return $.ox.loopOwlAddtocart;
});
@@ -0,0 +1,29 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'Magento_Ui/js/grid/columns/column',
'escaper'
], function (Column, escaper) {
'use strict';
return Column.extend({
defaults: {
allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'],
},
getLabel: function (row) {
return row.name;
},
/**
* Get Product name for link.
*
* @param {String} label
* @returns {String}
*/
getNameUnsanitizedHtml: function (label) {
return escaper.escapeHtml(label, this.allowedTags);
}
});
});
@@ -0,0 +1,17 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'Magento_Ui/js/grid/columns/column',
], function ($, Column) {
'use strict';
return Column.extend({
isAllowed: function (show) {
$('body').trigger('contentUpdated');
return !!show;
}
});
});
@@ -0,0 +1,20 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'Magento_Ui/js/grid/columns/column',
], function (Column) {
'use strict';
return Column.extend({
/**
* Depends on this option, "owl nav" can be shown or hide. Depends on backend configuration
*
* @returns {Boolean}
*/
isAllowed: function (show) {
return !!show;
}
});
});
@@ -0,0 +1,26 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'Magento_Ui/js/grid/columns/column',
'escaper'
], function (Column, escaper) {
'use strict';
return Column.extend({
defaults: {
allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'],
},
/**
* Title column.
*
* @param {String} label
* @returns {String}
*/
getNameUnsanitizedHtml: function (label, tag) {
return '<' + tag + ' role="heading" aria-level="2">' + escaper.escapeHtml(label, this.allowedTags) + '</' + tag + '>';
}
});
});
@@ -0,0 +1,27 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<if args="isAllowed()">
<if args="isSalable($row())">
<button class="action tocart primary"
attr="'data-mage-init': getDataMageInit($row()),
'data-post': getDataPost($row()),
title: getLabel()"
type="button">
<svg xmlns="http://www.w3.org/2000/svg" class="minicart-icon-1" width="14" height="16" viewBox="0 0 14 16">
<path d="M11,3V0H3V3H0V16H14V3H11ZM5,2H9V3H5V2Zm7,12H2V5H3V7H5V5H9V7h2V5h1v9Z"></path>
</svg>
<span text="getLabel()"></span>
</button>
</if>
<if args="isAvailable($row()) === false">
<div class="stock unavailable">
<text args="$t('Availability')"></text>
<span translate="'Out of stock'"></span>
</div>
</if>
</if>
@@ -0,0 +1,20 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<if args="isAllowed()">
<button attr="'data-post': $col.getDataPost($row()), title: getLabel()"
class="action tocompare"
data-action="add-to-compare">
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16">
<g>
<polygon points="2 2 8 2 8 0 0 0 0 12 3 12 3 10 2 10 2 2"></polygon>
<rect x="8" y="2" width="2" height="1"></rect>
<polygon points="13 6 13 14 6 14 6 6 13 6 13 4 4 4 4 16 15 16 15 6 13 6"></polygon>
</g>
</svg>
<span text="getLabel()"></span>
</button>
</if>
@@ -0,0 +1,10 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<a if="isAllowed()"
class="action more"
attr="href: $row().url"
text="label"></a>
@@ -0,0 +1,61 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid owl-carousel" data-role="product-owlCarousel" attr="'data-mage-init': carouselOptions">
<div class="product-item-info" repeat="foreach: filteredRows, item: '$row'">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,61 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid owl-carousel" data-role="product-owlCarousel" attr="'data-mage-init': carouselOptions">
<div class="product-item-info" repeat="foreach: filteredRows, item: '$row'">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,63 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid owl-carousel" data-role="product-owlCarousel" attr="'data-mage-init': carouselOptions">
<div class="product-item-info" repeat="foreach: filteredRows, item: '$row'">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,61 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid owl-carousel" data-role="product-owlCarousel" attr="'data-mage-init': carouselOptions">
<div class="product-item-info" repeat="foreach: filteredRows, item: '$row'">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,61 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid owl-carousel" data-role="product-owlCarousel" attr="'data-mage-init': carouselOptions">
<div class="product-item-info" repeat="foreach: filteredRows, item: '$row'">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,64 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid">
<div class="product-item" repeat="foreach: filteredRows, item: '$row'">
<div class="product-item-info">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,64 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid">
<div class="product-item" repeat="foreach: filteredRows, item: '$row'">
<div class="product-item-info">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,66 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid">
<div class="product-item" repeat="foreach: filteredRows, item: '$row'">
<div class="product-item-info">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div class="product-item-actions">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,64 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid">
<div class="product-item" repeat="foreach: filteredRows, item: '$row'">
<div class="product-item-info">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions" if="regionHasElements('action-primary-area') || regionHasElements('action-secondary-area')">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,64 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div if="hasData()"
class="block" css="additionalClasses">
<div if="regionHasElements('title-area')" css="titleClasses">
<fastForEach args="data: getRegion('title-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="block-content">
<div css="'products-' + displayMode + ' ' + displayMode">
<fastForEach args="data: getRegion('wrap-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-items widget-product-grid">
<div class="product-item" repeat="foreach: filteredRows, item: '$row'">
<div class="product-item-info">
<div if="regionHasElements('general-area')" class="product-grid__image-wrapper">
<fastForEach args="data: getRegion('general-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div class="product-item-inner">
<div if="regionHasElements('action-secondary-area')"
class="actions-secondary"
data-role="add-to-links">
<fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<fastForEach args="data: getRegion('product-item-inner-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="product-grid-overlay"></div>
<div class="product-item-details">
<fastForEach args="data: getRegion('details-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
<div if="regionHasElements('description-area')"
class="product description product-item-description">
<fastForEach args="data: getRegion('description-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
<div class="product actions product-item-actions">
<div class="actions-primary" if="regionHasElements('action-primary-area')">
<fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1 @@
<a class="overlay-link" attr="href: $row().url, title: $row().name" html="getNameUnsanitizedHtml($row().name)"></a>
@@ -0,0 +1 @@
<span if="isAllowed(show)"></span>
@@ -0,0 +1,3 @@
<div if="isAllowed(show)" class="owl-nav ox-owl-nav">
<button type="button" role="presentation" class="owl-prev ox-owl-prev"><span aria-label="Previous">‹</span></button><button type="button" role="presentation" class="owl-next ox-owl-next"><span aria-label="Next">›</span></button>
</div>
@@ -0,0 +1,7 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<span if="show" class="title-wrap" html="getNameUnsanitizedHtml(label, tag)"></span>