ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Olegnax
|
||||
* @package Olegnax_Quickview
|
||||
* @copyright Copyright (c) 2023 Olegnax (http://olegnax.com/). All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Olegnax\Quickview\Block\Adminhtml\System\Config\Form;
|
||||
|
||||
use Olegnax\Core\Block\Adminhtml\System\Config\Form\InfoTheme;
|
||||
|
||||
class Info extends InfoTheme
|
||||
{
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* A Magento 2 module named Olegnax/Quickview
|
||||
* Copyright (C) 2023
|
||||
*
|
||||
* This file is part of Olegnax/Quickview.
|
||||
*
|
||||
* 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 Block
|
||||
* @package Olegnax_Quickview
|
||||
* @copyright Copyright (c) 2010-2021 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
namespace Olegnax\Quickview\Block;
|
||||
|
||||
|
||||
use Olegnax\Core\Block\SimpleTemplate as coreTemplate;
|
||||
|
||||
class Template extends coreTemplate {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Controller\Catalog\Product;
|
||||
|
||||
use Magento\Framework\App\Action\Context;
|
||||
use Magento\Framework\View\Result\PageFactory;
|
||||
|
||||
class View extends \Magento\Catalog\Controller\Product\View
|
||||
{
|
||||
|
||||
}
|
||||
Executable
+122
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* A Magento 2 module named Olegnax/Quickview
|
||||
* Copyright (C) 2021
|
||||
*
|
||||
* This file is part of Olegnax/Quickview.
|
||||
*
|
||||
* 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 Helper
|
||||
* @package Quickview
|
||||
* @copyright Copyright (c) 2010-2021 Olegnax (http://www.olegnax.com/)
|
||||
* @license https://www.olegnax.com/license
|
||||
*/
|
||||
|
||||
namespace Olegnax\Quickview\Helper;
|
||||
|
||||
use Magento\Framework\App\ActionInterface;
|
||||
use Magento\Framework\App\Helper\AbstractHelper;
|
||||
use Magento\Framework\App\ObjectManager;
|
||||
use Magento\Framework\Registry;
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
|
||||
class Helper extends AbstractHelper
|
||||
{
|
||||
const XML_ENABLED = 'olegnax_quickview/general/enable';
|
||||
|
||||
public function getSystemValue($path, $storeCode = null)
|
||||
{
|
||||
$value = $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeCode);
|
||||
if (is_null($value)) {
|
||||
$value = '';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getPostDataParams($product)
|
||||
{
|
||||
$data['product'] = $product->getId();
|
||||
if ($this->_getRequest()->getServer('HTTP_REFERER')) {
|
||||
$data[ActionInterface::PARAM_NAME_URL_ENCODED] = base64_encode($this->_getRequest()->getServer('HTTP_REFERER'));
|
||||
} else {
|
||||
$data[ActionInterface::PARAM_NAME_URL_ENCODED] = base64_encode($this->_getUrl(''));
|
||||
}
|
||||
return json_encode(['action' => $this->_getUrl('catalog/product_compare/add'), 'data' => $data]);
|
||||
}
|
||||
|
||||
public function getButton($product = null, $customClasses = '', $template = '')
|
||||
{
|
||||
if(!$this-> isEnabled()){
|
||||
return '';
|
||||
}
|
||||
|
||||
$productUrl = $this->getUrl($product);
|
||||
if (!empty($productUrl)) {
|
||||
$customClasses = trim($customClasses);
|
||||
$customClasses = !empty($customClasses) ? $customClasses . ' ' : '';
|
||||
if (empty($template)) {
|
||||
$template = '<a class="{{customClasses}}ox-quickview-button" data-quickview-url="{{productUrl}}" href="#"><span>' . __("Quickview") . '</span></a>';
|
||||
}
|
||||
return str_replace(['{{customClasses}}', '{{productUrl}}'], [$customClasses, $productUrl], $template);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getUrl($product = null)
|
||||
{
|
||||
if (empty($product)) {
|
||||
$product = $this->getProduct();
|
||||
}
|
||||
$isEnabled = $this-> isEnabled() && !empty($product);
|
||||
if ($isEnabled) {
|
||||
$urlInterface = $this->_loadObject(UrlInterface::class);
|
||||
return $urlInterface->getUrl('ox_quickview/catalog_product/view', array('id' => $product->getId()));
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getProduct()
|
||||
{
|
||||
$register = $this->_loadObject(Registry::class);
|
||||
$product = $register->registry('product');
|
||||
if ($product) {
|
||||
return $product;
|
||||
}
|
||||
$product = $register->registry('current_product');
|
||||
if ($product) {
|
||||
return $product;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function _getObjectManager()
|
||||
{
|
||||
return ObjectManager::getInstance();
|
||||
}
|
||||
|
||||
protected function _loadObject( $object ) {
|
||||
return $this->_getObjectManager()->get( $object );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isEnabled()
|
||||
{
|
||||
return (bool)$this->getSystemValue(static::XML_ENABLED);
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Observer;
|
||||
|
||||
use Magento\Catalog\Api\ProductRepositoryInterface;
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
use Magento\Framework\App\Request\Http;
|
||||
use Magento\Framework\Event\Observer;
|
||||
use Magento\Framework\Event\ObserverInterface;
|
||||
use Magento\Framework\Exception\NoSuchEntityException;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
use Magento\Store\Model\StoreManagerInterface;
|
||||
|
||||
class addHandle implements ObserverInterface
|
||||
{
|
||||
protected $scopeConfig;
|
||||
|
||||
protected $request;
|
||||
|
||||
protected $storeManager;
|
||||
|
||||
protected $productRepository;
|
||||
|
||||
public function __construct(
|
||||
ScopeConfigInterface $scopeConfig,
|
||||
Http $request,
|
||||
StoreManagerInterface $storeManager,
|
||||
ProductRepositoryInterface $productRepository
|
||||
)
|
||||
{
|
||||
$this->scopeConfig = $scopeConfig;
|
||||
$this->request = $request;
|
||||
$this->storeManager = $storeManager;
|
||||
$this->productRepository = $productRepository;
|
||||
}
|
||||
|
||||
public function execute(Observer $observer)
|
||||
{
|
||||
$layout = $observer->getData('layout');
|
||||
$fullActionName = $observer->getData('full_action_name');
|
||||
|
||||
if ($fullActionName != 'ox_quickview_catalog_product_view') {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$productId = $this->request->getParam('id');
|
||||
if (isset($productId)) {
|
||||
try {
|
||||
$product = $this->productRepository->getById($productId, false, $this->storeManager->getStore()->getId());
|
||||
} catch (NoSuchEntityException $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$productType = $product->getTypeId();
|
||||
|
||||
$layout->getUpdate()->addHandle('ox_quickview_catalog_product_view_type_' . $productType);
|
||||
$tabsInInfo = $this->getSystemValue('athlete2_settings/product/product_tabs_position');
|
||||
/*
|
||||
$reviewsInTab = $this->getSystemValue('athlete2_settings/product/reviews_position');
|
||||
if ($reviewsInTab == 'oxbottom' && $reviewsInTab == 'bottom') {
|
||||
$layout->getUpdate()->addHandle('ox_quickview_catalog_product_view_move_review');
|
||||
}*/
|
||||
if ($tabsInInfo != 'info') {
|
||||
$layout->getUpdate()->addHandle('ox_quickview_catalog_product_view_remove_tabs');
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSystemValue($path, $storeCode = null)
|
||||
{
|
||||
$value = $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeCode);
|
||||
if (is_null($value)) {
|
||||
$value = '';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Magento\Framework\App\Request\Http;
|
||||
|
||||
class AbstractProduct
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Http
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* ResultPage constructor.
|
||||
*
|
||||
* @param Http $request
|
||||
*/
|
||||
public function __construct(Http $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Magento\Catalog\Block\Product\AbstractProduct $subject
|
||||
* @param $result
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function afterIsRedirectToCartEnabled(
|
||||
\Magento\Catalog\Block\Product\AbstractProduct $subject,
|
||||
$result
|
||||
) {
|
||||
$requestUri = (string)$this->request->getRequestUri();
|
||||
if (strpos($requestUri, 'ox_quickview/catalog_product/view') !== false) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Closure;
|
||||
use Magento\Catalog\Block\Product\View\Gallery;
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
use Magento\Framework\App\Request\Http;
|
||||
use Magento\Framework\Json\DecoderInterface;
|
||||
use Magento\Framework\Json\EncoderInterface;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
|
||||
class BlockProductViewGalleryMagnifier
|
||||
{
|
||||
|
||||
/**
|
||||
* @var ScopeConfigInterface
|
||||
*/
|
||||
protected $scopeConfig;
|
||||
|
||||
/**
|
||||
* @var Http
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EncoderInterface
|
||||
*/
|
||||
protected $jsonEncoder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var DecoderInterface
|
||||
*/
|
||||
protected $jsonDecoder;
|
||||
|
||||
/**
|
||||
* ResultPage constructor.
|
||||
*
|
||||
* @param ScopeConfigInterface $scopeConfig
|
||||
* @param Http $request
|
||||
* @param EncoderInterface $jsonEncoder
|
||||
* @param DecoderInterface $jsonDecoder
|
||||
*/
|
||||
public function __construct(
|
||||
ScopeConfigInterface $scopeConfig,
|
||||
Http $request,
|
||||
EncoderInterface $jsonEncoder,
|
||||
DecoderInterface $jsonDecoder
|
||||
) {
|
||||
$this->request = $request;
|
||||
$this->scopeConfig = $scopeConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Gallery $subject
|
||||
* @param Closure $proceed
|
||||
* @param string $name
|
||||
* @param string|null $module
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
public function aroundGetVar(
|
||||
Gallery $subject,
|
||||
Closure $proceed,
|
||||
$name,
|
||||
$module = null
|
||||
) {
|
||||
$result = $proceed($name, $module);
|
||||
$isEnabled = $this->getSystemValue('olegnax_quickview/general/enable');
|
||||
|
||||
if (!$isEnabled || $this->request->getFullActionName() != 'ox_quickview_catalog_product_view') {
|
||||
return $result;
|
||||
}
|
||||
|
||||
switch ($name) {
|
||||
case "gallery/navdir" :
|
||||
$result = 'horizontal';
|
||||
break;
|
||||
/* Disable the image fullscreen on quickview*/
|
||||
case "gallery/allowfullscreen" :
|
||||
$result = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getSystemValue($path, $storeCode = null)
|
||||
{
|
||||
return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Magento\Checkout\Controller\Cart\Add;
|
||||
use Magento\Framework\App\Request\Http;
|
||||
use Magento\Framework\Json\EncoderInterface;
|
||||
|
||||
class CartAdd
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Http
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EncoderInterface
|
||||
*/
|
||||
protected $jsonEncoder;
|
||||
|
||||
/**
|
||||
* ResultPage constructor.
|
||||
*
|
||||
* @param Http $request
|
||||
* @param EncoderInterface $jsonEncoder
|
||||
*/
|
||||
public function __construct(
|
||||
Http $request,
|
||||
EncoderInterface $jsonEncoder
|
||||
) {
|
||||
$this->request = $request;
|
||||
$this->jsonEncoder = $jsonEncoder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Add $subject
|
||||
* @param $result
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function afterExecute(
|
||||
Add $subject,
|
||||
$result
|
||||
) {
|
||||
/** Fix for product redirects, ex. when quantity is out of stock */
|
||||
$refererUrl = (string)$this->request->getServer('HTTP_REFERER');
|
||||
if (strpos($refererUrl, 'ox_quickview/catalog_product/view') !== false) {
|
||||
return $subject->getResponse()->representJson($this->jsonEncoder->encode([]));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Closure;
|
||||
use Magento\Catalog\Model\Product;
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
|
||||
class ListProduct
|
||||
{
|
||||
|
||||
/**
|
||||
* @var UrlInterface
|
||||
*/
|
||||
protected $urlInterface;
|
||||
|
||||
/**
|
||||
* @var ScopeConfigInterface
|
||||
*/
|
||||
protected $scopeConfig;
|
||||
|
||||
/**
|
||||
* @param UrlInterface $urlInterface
|
||||
* @param ScopeConfigInterface $scopeConfig
|
||||
*/
|
||||
public function __construct(
|
||||
UrlInterface $urlInterface,
|
||||
ScopeConfigInterface $scopeConfig
|
||||
) {
|
||||
$this->urlInterface = $urlInterface;
|
||||
$this->scopeConfig = $scopeConfig;
|
||||
}
|
||||
|
||||
public function aroundGetProductDetailsHtml(
|
||||
\Magento\Catalog\Block\Product\ListProduct $subject,
|
||||
Closure $proceed,
|
||||
Product $product
|
||||
) {
|
||||
$result = $proceed($product);
|
||||
$isEnabled = $this->getConfig('olegnax_quickview/general/enable');
|
||||
if ($isEnabled) {
|
||||
$productUrl = $this->urlInterface->getUrl('ox_quickview/catalog_product/view',
|
||||
array('id' => $product->getId()));
|
||||
return $result . '<a class="ox-quickview-button" data-quickview-url="' . $productUrl . '" href="#"><span>' . __("Quickview") . '</span></a>';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getConfig($path, $storeCode = null)
|
||||
{
|
||||
return $this->getSystemValue($path, $storeCode);
|
||||
}
|
||||
|
||||
public function getSystemValue($path, $storeCode = null)
|
||||
{
|
||||
return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeCode);
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Magento\Framework\App\Request\Http;
|
||||
use Magento\Framework\View\Layout;
|
||||
use Magento\Framework\View\Result\Page;
|
||||
|
||||
class ResultPage
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Http
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* @var Layout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
/**
|
||||
* ResultPage constructor.
|
||||
*
|
||||
* @param Http $request
|
||||
* @param Layout $layout
|
||||
*/
|
||||
public function __construct(
|
||||
Http $request,
|
||||
Layout $layout
|
||||
) {
|
||||
$this->request = $request;
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adding the default catalog_product_view_type_ handles as well
|
||||
*
|
||||
* @param Page $subject
|
||||
* @param array $parameters
|
||||
* @param mixed $defaultHandle
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function beforeAddPageLayoutHandles(
|
||||
Page $subject,
|
||||
array $parameters = [],
|
||||
$defaultHandle = null
|
||||
) {
|
||||
if ($this->request->getFullActionName() == 'ox_quickview_catalog_product_view') {
|
||||
return [$parameters, 'catalog_product_view'];
|
||||
} else {
|
||||
return [$parameters, $defaultHandle];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Olegnax\Quickview\Plugin;
|
||||
|
||||
use Closure;
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
use Magento\Framework\App\Request\Http;
|
||||
|
||||
class ScopeConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Http
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* ResultPage constructor.
|
||||
*
|
||||
* @param Http $request
|
||||
*/
|
||||
public function __construct(Http $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ScopeConfigInterface $subject
|
||||
* @param Closure $proceed
|
||||
* @param $path
|
||||
* @param $scopeType
|
||||
* @param null $scopeCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function aroundGetValue(
|
||||
ScopeConfigInterface $subject,
|
||||
Closure $proceed,
|
||||
$path = '',
|
||||
$scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
|
||||
$scopeCode = null
|
||||
) {
|
||||
$result = $proceed($path, $scopeType, $scopeCode);
|
||||
|
||||
if (($path == 'checkout/cart/redirect_to_cart')) {
|
||||
$refererUrl = (string)$this->request->getServer('HTTP_REFERER');
|
||||
if (strpos($refererUrl, 'ox_quickview/catalog_product/view') !== false) {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
|
||||
<acl>
|
||||
<resources>
|
||||
<resource id="Magento_Backend::admin">
|
||||
<resource id="Olegnax_Core::Olegnax_Core">
|
||||
<resource id="Olegnax_Quickview::quickview" sortOrder="10" title="QuickView"/>
|
||||
</resource>
|
||||
</resource>
|
||||
</resources>
|
||||
</acl>
|
||||
</config>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
|
||||
<menu>
|
||||
<add id="Olegnax_Quickview::quickview" title="Quickview" translate="title" module="Olegnax_Quickview" sortOrder="999" parent="Olegnax_Core::Olegnax_Core" resource="Olegnax_Quickview::quickview"/>
|
||||
<add id="Olegnax_Quickview::config" title="Configuration" translate="title" module="Olegnax_Quickview" sortOrder="20" action="adminhtml/system_config/edit/section/olegnax_quickview" parent="Olegnax_Quickview::quickview" resource="Olegnax_Quickview::quickview"/>
|
||||
</menu>
|
||||
</config>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
|
||||
<system>
|
||||
<tab id="olegnax" translate="label" sortOrder="15">
|
||||
<label>Olegnax</label>
|
||||
</tab>
|
||||
<section id="olegnax_quickview" translate="label" type="text" sortOrder="170" showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>Quick View</label>
|
||||
<tab>olegnax</tab>
|
||||
<resource>Olegnax_Quickview::quickview</resource>
|
||||
<group id="info" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="0" translate="label">
|
||||
<frontend_model>Olegnax\Quickview\Block\Adminhtml\System\Config\Form\Info</frontend_model>
|
||||
</group>
|
||||
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>Quick View General Settings</label>
|
||||
<field id="enable_product_listing" translate="label" type="select" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>Enable on product listing</label>
|
||||
<comment>Enable/Disable Quick View on Category pages.</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
<frontend_class>on-off-trigger</frontend_class>
|
||||
</field>
|
||||
</group>
|
||||
</section>
|
||||
</system>
|
||||
</config>
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
|
||||
<default>
|
||||
<olegnax_quickview>
|
||||
<general>
|
||||
<enable>1</enable>
|
||||
</general>
|
||||
</olegnax_quickview>
|
||||
</default>
|
||||
</config>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<!--<type name="Magento\Catalog\Block\Product\ListProduct">
|
||||
<plugin disabled="false" name="Olegnax_Quickview_Plugin_ListProduct" sortOrder="10" type="Olegnax\Quickview\Plugin\ListProduct"/>
|
||||
</type>-->
|
||||
|
||||
<type name="Magento\Catalog\Block\Product\AbstractProduct">
|
||||
<plugin name="Olegnax_Quickview_Plugin_AbstractProduct"
|
||||
type="Olegnax\Quickview\Plugin\AbstractProduct" sortOrder="5"/>
|
||||
</type>
|
||||
<type name="Magento\Checkout\Controller\Cart\Add">
|
||||
<plugin name="Olegnax_Quickview_Plugin_CartAdd"
|
||||
type="Olegnax\Quickview\Plugin\CartAdd" sortOrder="5"/>
|
||||
</type>
|
||||
<type name="Magento\Framework\View\Result\Page">
|
||||
<plugin name="Olegnax_Quickview_Plugin_ResultPage"
|
||||
type="Olegnax\Quickview\Plugin\ResultPage" sortOrder="1"/>
|
||||
</type>
|
||||
<type name="Magento\Framework\App\Config\ScopeConfigInterface">
|
||||
<plugin name="Olegnax_Quickview_Plugin_ScopeConfig"
|
||||
type="Olegnax\Quickview\Plugin\ScopeConfig" sortOrder="5"/>
|
||||
</type>
|
||||
|
||||
<type name="Magento\Catalog\Block\Product\View\Gallery">
|
||||
<plugin name="Olegnax_Quickview_Plugin_BlockProductViewGalleryMagnifier"
|
||||
type="Olegnax\Quickview\Plugin\BlockProductViewGalleryMagnifier" sortOrder="15"/>
|
||||
</type>
|
||||
</config>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
|
||||
<event name="layout_load_before">
|
||||
<observer name="ox_quickview" instance="Olegnax\Quickview\Observer\addHandle" />
|
||||
</event>
|
||||
</config>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
|
||||
<router id="standard">
|
||||
<route id="ox_quickview" frontName="ox_quickview">
|
||||
<module name="Olegnax_Quickview" />
|
||||
</route>
|
||||
</router>
|
||||
</config>
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Olegnax_Quickview" setup_version="0.0.11" >
|
||||
<sequence>
|
||||
<module name="Olegnax_Core"/>
|
||||
<module name="Magento_Catalog"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::MODULE,
|
||||
'Olegnax_Quickview',
|
||||
__DIR__
|
||||
);
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="before.body.end">
|
||||
<block ifconfig="olegnax_quickview/general/enable" class="Olegnax\Quickview\Block\Template" name="ox_quickview_initialize" template="Olegnax_Quickview::initialize.phtml" />
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="catalog_product_view"/>
|
||||
<body>
|
||||
<referenceBlock name="yotpo_widget_script" remove="true"/>
|
||||
<referenceBlock name="ox_newsletter_popup" remove="true"/>
|
||||
<referenceBlock name="yotpo_widget_div" remove="true"/>
|
||||
<referenceBlock name="yotpo_bottomline" remove="true"/>
|
||||
<referenceBlock name="product.info.blog.relatedposts" remove="true"/>
|
||||
<referenceBlock name="breadcrumbs" remove="true"/>
|
||||
<referenceBlock name="reviews.tab" remove="true"/>
|
||||
<referenceBlock name="product_additional_data" remove="true"/>
|
||||
<referenceBlock name="product.review.form" remove="true"/>
|
||||
<referenceBlock name="athlete2_header" remove="true"/>
|
||||
<referenceBlock name="athlete2_navigation" remove="true"/>
|
||||
<referenceBlock name="catalog.product.related" remove="true"/>
|
||||
<referenceBlock name="product.info.upsell" remove="true"/>
|
||||
<referenceBlock name="header.container" remove="true"/>
|
||||
<referenceBlock name="footer-container" remove="true"/>
|
||||
<referenceBlock name="page.top" remove="true" />
|
||||
<referenceBlock name="copyright" remove="true" />
|
||||
<referenceBlock name="authentication-popup" remove="true" />
|
||||
<referenceBlock name="totop" remove="true" />
|
||||
<referenceBlock name="header_banner" remove="true" />
|
||||
<referenceBlock name="ox_prev_product" remove="true" />
|
||||
<referenceBlock name="ox_next_product" remove="true" />
|
||||
<referenceBlock name="product_view_ox_block" remove="true" />
|
||||
<referenceBlock name="sidebar.slideout" remove="true" />
|
||||
<referenceBlock name="product.info.mailto" remove="true"/>
|
||||
<referenceBlock name="product_view_ox_social2" remove="true"/>
|
||||
<referenceBlock name="product_view_ox_social2.additional" remove="true"/>
|
||||
<referenceBlock name="product_view_ox_social" remove="true"/>
|
||||
<referenceContainer name="page.messages" remove="true" />
|
||||
<referenceContainer name="div.sidebar.additional" remove="true" />
|
||||
<referenceContainer name="above_footer" remove="true" />
|
||||
<referenceContainer name="athlete-reviews-wrapper" remove="true"/>
|
||||
<referenceContainer name="page.bottom.container" remove="true"/>
|
||||
<referenceContainer name="cookie_notices" remove="true"/>
|
||||
<referenceBlock name="page.main.title">
|
||||
<action method="setTemplate">
|
||||
<argument name="template" xsi:type="string">Olegnax_Quickview::product/view/title.phtml</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="product.info.sku">
|
||||
<action method="setTemplate">
|
||||
<argument name="template" xsi:type="string"></argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
<referenceContainer name="before.body.end">
|
||||
<block class="Olegnax\Quickview\Block\Template" name="ox_quickview_beforebodyend" template="Olegnax_Quickview::beforebodyend.phtml" />
|
||||
<block class="Magento\Checkout\Block\Cart\Sidebar" name="ox_checkout_js"
|
||||
template="Olegnax_Quickview::product/view/checkout_js.phtml" />
|
||||
</referenceContainer>
|
||||
|
||||
<!-- <referenceBlock name="product.info.addtocart">-->
|
||||
<!-- <action method="setTemplate">-->
|
||||
<!-- <argument name="template" xsi:type="string">Olegnax_Quickview::product/view/addtocart.phtml</argument>-->
|
||||
<!-- </action>-->
|
||||
<!-- </referenceBlock>-->
|
||||
<!-- <referenceBlock name="product.info.addtocart.additional">-->
|
||||
<!-- <action method="setTemplate">-->
|
||||
<!-- <argument name="template" xsi:type="string">Olegnax_Quickview::product/view/addtocart.phtml</argument>-->
|
||||
<!-- </action>-->
|
||||
<!-- </referenceBlock>-->
|
||||
<referenceContainer name="product.info.form.content">
|
||||
<block class="Lts\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="Olegnax_Quickview::product/view/addtocart.phtml" cacheable="false" />
|
||||
</referenceContainer>
|
||||
|
||||
<referenceBlock name="product.info.options.wrapper.bottom">
|
||||
<block class="Lts\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="Olegnax_Quickview::product/view/addtocart.phtml" cacheable="false" />
|
||||
</referenceBlock>
|
||||
|
||||
<referenceBlock name="related_products_impression" remove="true"/>
|
||||
<referenceBlock name="upsell_products_impression" remove="true"/>
|
||||
<referenceBlock name="related_products_impression" remove="true"/>
|
||||
<referenceBlock name="ox_quickview_initialize" remove="true"/>
|
||||
<referenceBlock name="amasty.mostviewed.bundle.below" remove="true"/>
|
||||
<referenceBlock name="amasty.mostviewed.bundle.tab" remove="true"/>
|
||||
<referenceBlock name="product.info.amshopby.morefrom" remove="true"/>
|
||||
</body>
|
||||
</page>
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="catalog_product_view"/>
|
||||
<body>
|
||||
<referenceBlock name="reviews.tab" remove="true"/>
|
||||
</body>
|
||||
</page>
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="catalog_product_view"/>
|
||||
<body>
|
||||
<referenceBlock name="product.info.details" remove="true"/>
|
||||
<referenceBlock name="reviews.tab" remove="true"/>
|
||||
</body>
|
||||
</page>
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="goto.product" remove="true"/>
|
||||
|
||||
<referenceBlock name="product.info.addtocart.bundle">
|
||||
<action method="setTemplate">
|
||||
<argument name="template" xsi:type="string">Olegnax_Quickview::product/view/addtocart.phtml</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
</body>
|
||||
</page>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="goto.product" remove="true"/>
|
||||
</body>
|
||||
</page>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="goto.product" remove="true"/>
|
||||
<move element="product.info" destination="product.info.main" after="-"/>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,9 @@
|
||||
var config = {
|
||||
map: {
|
||||
'*': {
|
||||
OxQuickview: 'Olegnax_Quickview/js/quickview',
|
||||
OxQuickviewInit: 'Olegnax_Quickview/js/init',
|
||||
OxQuickviewcatalogAddToCart: 'Olegnax_Quickview/js/catalog-add-to-cart'
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
<script>
|
||||
require( [ "jquery", 'underscore', 'Magento_Ui/js/modal/modal' ], function ( $, _, modal ) {
|
||||
"use strict";
|
||||
|
||||
$( function () {
|
||||
var documentPadding = 0;
|
||||
var parentBody = window.parent.document.body;
|
||||
$( '.ox_quickview-preloader', parentBody ).hide();
|
||||
$( '#ox_quickview_wrapper iframe', parentBody ).animate( { 'opacity': 1 }, 100 );
|
||||
$( '.reviews-actions a' ).attr( 'target', '_parent' );
|
||||
$( '.product-social-links a' ).attr( 'target', '_parent' );
|
||||
$( 'body' ).css( 'overflow', 'hidden' );
|
||||
} );
|
||||
|
||||
$( 'a[href]:not([href="#"])' ).on( 'click', function ( e ) {
|
||||
var $this = $( this ),
|
||||
href = $this.attr( 'href' ).replace( /\#.*$/, '' );
|
||||
if ( 0 >= href.length || $this.data( 'disable-parent' ) || '_blank' === $this.attr( 'target' ) ) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
top.window.location.href = href;
|
||||
} );
|
||||
|
||||
$( 'body' ).on( 'submit', 'form', function ( event ) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
var parentBody = window.parent.document.body;
|
||||
var $uenc = $( this ).find( 'input[name=uenc]' );
|
||||
if ( $uenc.length ) {
|
||||
$uenc.attr( 'value', ( function b64EncodeUnicode( str ) {
|
||||
return btoa( encodeURIComponent( str ).replace( /%([0-9A-F]{2})/g,
|
||||
function toSolidBytes( match, p1 ) {
|
||||
return String.fromCharCode( '0x' + p1 );
|
||||
} ) ).replace( /\=$/, '' );
|
||||
} )( window.parent.location.href ) );
|
||||
}
|
||||
$( this ).appendTo( parentBody ).trigger( 'submit' );
|
||||
} )
|
||||
} );
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php $buttonTitle = __('Go To Product');?>
|
||||
<div class="box-gotoproduct">
|
||||
<div class="fieldset">
|
||||
<div class="actions">
|
||||
<a target="_parent" href="<?php /* @escapeNotVerified */ echo $this->getProduct()->getProductUrl() ?>" title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>" class="action primary" id="product-gotoproduct-button">
|
||||
<span><?php /* @escapeNotVerified */ echo $buttonTitle ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,2 @@
|
||||
<div id="ox_quickview_wrapper" style="display:none"><div class="ox_quickview-preloader" data-role="loader"></div><div class="ox-overlay-close-btn"><span></span></div></div>
|
||||
<script>require(['jquery','OxQuickviewInit'],function($){$(function(){$('.ox-quickview-button').OxQuickviewInit({})})});</script>
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
/** @var $block View */
|
||||
|
||||
use Magento\Catalog\Block\Product\View;
|
||||
|
||||
?>
|
||||
|
||||
<?php $_product = $block->getProduct(); ?>
|
||||
<?php $buttonTitle = __('Add to Cart'); ?>
|
||||
<?php if ($_product->isSaleable()): ?>
|
||||
<div class="box-tocart">
|
||||
<div class="fieldset">
|
||||
<?php if ($block->shouldRenderQuantity()): ?>
|
||||
<div class="field qty">
|
||||
<label class="label" for="qty"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></label>
|
||||
<div class="control">
|
||||
<input type="number"
|
||||
name="qty"
|
||||
id="qty"
|
||||
value="<?= /* @escapeNotVerified */ $block->getProductDefaultQty() * 1 ?>"
|
||||
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
|
||||
class="input-text qty"
|
||||
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
|
||||
class="action primary tocart"
|
||||
id="product-addtocart-button">
|
||||
<span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
|
||||
</button>
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"Olegnax_Quickview/js/validate-product": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/** \Magento\Checkout\Block\Cart\Sidebar $bloock */
|
||||
?>
|
||||
<script>
|
||||
window.checkout = <?= /* @noEscape */ $block->getSerializedConfig() ?>;
|
||||
</script>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
/**
|
||||
* @var $block Title
|
||||
*/
|
||||
|
||||
use Magento\Theme\Block\Html\Title;
|
||||
|
||||
$helper = $this->helper( 'Olegnax\Quickview\Helper\Helper' );
|
||||
$_product = $helper->getProduct();
|
||||
$cssClass = $block->getCssClass() ? ' ' . $block->getCssClass() : '';
|
||||
$title = '';
|
||||
if (trim((string)$block->getPageHeading())) {
|
||||
$title = '<span class="base" data-ui-id="page-title-wrapper" ' . $block->getAddBaseAttribute() . '>'
|
||||
. $block->escapeHtml($block->getPageHeading()) . '</span>';
|
||||
}
|
||||
?>
|
||||
<?php if ($title): ?>
|
||||
<div class="sss page-title-wrapper<?= /* @escapeNotVerified */ $cssClass ?>">
|
||||
<a href="<?= $_product->getProductUrl(); ?>"><h1 class="page-title"
|
||||
<?php if ($block->getId()): ?> id="<?= /* @escapeNotVerified */ $block->getId() ?>" <?php endif; ?>
|
||||
<?php if ($block->getAddBaseAttributeAria()): ?>
|
||||
aria-labelledby="<?= /* @escapeNotVerified */ $block->getAddBaseAttributeAria() ?>"
|
||||
<?php endif; ?>>
|
||||
<?= /* @escapeNotVerified */ $title ?>
|
||||
</h1></a>
|
||||
<?= $block->getChildHtml() ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,235 @@
|
||||
@ox-quickview-height: 550px;
|
||||
@ox-modal--width: 960px;
|
||||
|
||||
& when (@media-common = true) {
|
||||
#ox_quickview_wrapper{
|
||||
html{
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.ox_quickview-preloader{
|
||||
box-sizing: border-box;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
content:url('../Olegnax_Quickview/images/preloader.svg');
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
margin-left: -40px;
|
||||
}
|
||||
.ox-quickview-catalog-product-view,
|
||||
.ox_quickview-catalog_product-view {
|
||||
.bundle-options-container{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top:0;
|
||||
background: #fff;
|
||||
margin-bottom: 0;
|
||||
.product-add-form{
|
||||
padding: 50px;
|
||||
}
|
||||
}
|
||||
.ox-product-labels-wrapper{
|
||||
&.ox-product-labels--top-left{
|
||||
padding-left: 20px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
&.ox-product-labels--top-right{
|
||||
padding-top: 20px;
|
||||
}
|
||||
&.ox-product-labels--bottom-left{
|
||||
padding-left: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
&.ox-product-labels--bottom-right{
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
&.catalog-product-view .column.main{
|
||||
-webkit-flex-direction: row;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
}
|
||||
.product.media{
|
||||
.gallery-placeholder {
|
||||
&.ox-custom-cursor.ox-gallery{
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: -o-grab;
|
||||
cursor: -ms-grab;
|
||||
cursor: grab;
|
||||
.fotorama__grab{
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: -o-grab;
|
||||
cursor: -ms-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.product-info-main{
|
||||
width: 48%;
|
||||
padding: 50px 40px 0 40px;
|
||||
margin-bottom:0;
|
||||
overflow-y: auto;
|
||||
.swatch-attribute{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.product-reviews-summary{
|
||||
margin: -15px 0 17px 0;
|
||||
}
|
||||
.page-title-wrapper .page-title{
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.product.attribute.overview{
|
||||
margin-bottom:30px;
|
||||
}
|
||||
}
|
||||
|
||||
.box-tocart .action.tocart {
|
||||
width: 100%;
|
||||
}
|
||||
.page-wrapper .page-main {
|
||||
padding: 0!important;
|
||||
min-height: 300px;
|
||||
}
|
||||
.reviews-actions .add {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.page-product-downloadable {
|
||||
.product-add-form{
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin-bottom: 30px;
|
||||
.box-tocart{
|
||||
width: 100%;
|
||||
margin-bottom: 30px;
|
||||
.product-addto-links{
|
||||
display:flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
.product-options-wrapper,
|
||||
.product-options-bottom {
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
.product-options-bottom {
|
||||
.price-box {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.product-add-form, .product-options-bottom .box-tocart,
|
||||
.product-options-bottom .actions--right-to-cart{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.product-info-main .product-info-price,
|
||||
.product-options-bottom .product-info-price{
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.swatch-opt{
|
||||
margin: 20px 0 30px 0;
|
||||
}
|
||||
.product-add-form .fieldset{
|
||||
margin: 0 0 30px;
|
||||
}
|
||||
}
|
||||
|
||||
/*.box-gotoproduct #product-gotoproduct-button {
|
||||
|
||||
}*/
|
||||
|
||||
/*.page-products .product-item .ox-quickview {
|
||||
display: none
|
||||
}*/
|
||||
|
||||
.ox-quickview-catalog-product-view,
|
||||
.ox_quickview-catalog_product-view {
|
||||
.page-wrapper {
|
||||
min-height: auto !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media (min-width: @ox-modal--width){
|
||||
.ox-quickview-catalog-product-view,
|
||||
.ox_quickview-catalog_product-view {
|
||||
&.page-product-bundle{
|
||||
overflow-y:auto!important;
|
||||
}
|
||||
.fotorama{
|
||||
max-height:@ox-quickview-height;
|
||||
height:@ox-quickview-height;
|
||||
}
|
||||
.product.media{
|
||||
width: 52%;
|
||||
margin-bottom:0;
|
||||
#ox-zoom-cursor{
|
||||
display:none;
|
||||
}
|
||||
.fotorama__nav,
|
||||
.fotorama__nav--thumbs,
|
||||
.fotorama__nav-wrap--horizontal{
|
||||
margin:0;
|
||||
display:none!important;
|
||||
}
|
||||
.fotorama__wrap .fotorama__grab{
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: -o-grab;
|
||||
cursor: -ms-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.fotorama__stage{
|
||||
height:@ox-quickview-height!important;
|
||||
max-height: @ox-quickview-height!important;
|
||||
}
|
||||
}
|
||||
.product-info-main{
|
||||
height: @ox-quickview-height;
|
||||
max-height: 100vh;
|
||||
.product-addto-links,
|
||||
.product-options-bottom {
|
||||
.action.tocompare{
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.ox-quickview-sa .product-info-main .box-tocart{
|
||||
.actions .action.tocart{
|
||||
padding: 0 36px;
|
||||
min-width: 189px;
|
||||
}
|
||||
.field.qty{
|
||||
max-width: 112px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__xs) {
|
||||
.ox_quickview-catalog_product-view .product-info-main .box-tocart .field.qty{
|
||||
max-width: 130px;
|
||||
}
|
||||
}
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
|
||||
.ox-quickview-catalog-product-view,
|
||||
.ox_quickview-catalog_product-view {
|
||||
&.catalog-product-view .breadcrumbs,
|
||||
&.catalog-product-view .columns,
|
||||
&.catalog-product-view .page.messages,
|
||||
&.catalog-product-view .page-title-wrapper {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<svg id="athlete_preloader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 30">
|
||||
<defs>
|
||||
<style type="text/css"><![CDATA[
|
||||
@keyframes athlete_preloader {
|
||||
0%{
|
||||
transform-origin:left;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
70% {
|
||||
transform-origin:left;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
70.01% {
|
||||
transform-origin:right;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
100% {
|
||||
transform-origin:right;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes athlete_preloader {
|
||||
0%{
|
||||
-webkit-transform-origin:left;
|
||||
-webkit-transform: scale(0, 1);
|
||||
transform-origin:left;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
70% {
|
||||
-webkit-transform-origin:left;
|
||||
-webkit-transform: scale(1, 1);
|
||||
transform-origin:left;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
70.01% {
|
||||
-webkit-transform-origin:right;
|
||||
-webkit-transform: scale(1, 1);
|
||||
transform-origin:right;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform-origin:right;
|
||||
-webkit-transform: scale(0, 1);
|
||||
transform-origin:right;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
}
|
||||
.athlete_preloader_fill{
|
||||
transform-origin:left;
|
||||
animation: athlete_preloader 3s infinite;
|
||||
}
|
||||
]]></style>
|
||||
</defs>
|
||||
<path d="M0,0V30H80V0H0ZM76,26H4V4H76V26Z"/>
|
||||
<rect width="80" height="30" class="athlete_preloader_fill"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Catalog/js/product/view/product-ids-resolver',
|
||||
'catalogAddToCart',
|
||||
'jquery-ui-modules/widget',
|
||||
'jquery-ui-modules/core',
|
||||
], function ($, idsResolver) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.OxQuickviewcatalogAddToCart', $.mage.catalogAddToCart, {
|
||||
disableAddToCartButton: function (form) {
|
||||
this.element.addClass('ox-add-to-cart-loading');
|
||||
this._super(form);
|
||||
},
|
||||
enableAddToCartButton: function (form) {
|
||||
this.element.removeClass('ox-add-to-cart-loading');
|
||||
this._super(form);
|
||||
},
|
||||
/**
|
||||
* @param {jQuery} form
|
||||
*/
|
||||
ajaxSubmit: function (form) {
|
||||
var self = this,
|
||||
productIds = idsResolver(form),
|
||||
formData;
|
||||
|
||||
$(window.parent.document.body).find(self.options.minicartSelector).trigger('contentLoading');
|
||||
self.disableAddToCartButton(form);
|
||||
formData = new FormData(form[0]);
|
||||
|
||||
window.parent.ajaxCartTransport = false;
|
||||
|
||||
window.parent.jQuery.ajax({
|
||||
url: form.attr('action'),
|
||||
data: formData,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
beforeSend: function () {
|
||||
if (self.isLoaderEnabled()) {
|
||||
$(window.parent.document.body).trigger(self.options.processStart);
|
||||
}
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var eventData, parameters;
|
||||
|
||||
$(window.parent.document).trigger('ajax:addToCart', {
|
||||
'sku': form.data().productSku,
|
||||
'productIds': productIds,
|
||||
'form': form,
|
||||
'response': res
|
||||
});
|
||||
|
||||
if (self.isLoaderEnabled()) {
|
||||
$(window.parent.document.body).trigger(self.options.processStop);
|
||||
}
|
||||
|
||||
if (res.backUrl) {
|
||||
eventData = {
|
||||
'form': form,
|
||||
'redirectParameters': []
|
||||
};
|
||||
// trigger global event, so other modules will be able add parameters to redirect url
|
||||
$(window.parent.document.body).trigger('catalogCategoryAddToCartRedirect', eventData);
|
||||
|
||||
if (eventData.redirectParameters.length > 0) {
|
||||
parameters = res.backUrl.split('#');
|
||||
parameters.push(eventData.redirectParameters.join('&'));
|
||||
res.backUrl = parameters.join('#');
|
||||
}
|
||||
|
||||
self._redirect(res.backUrl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.messages) {
|
||||
$(window.parent.document.body).find(self.options.messagesSelector).html(res.messages);
|
||||
}
|
||||
|
||||
if (res.minicart) {
|
||||
$(window.parent.document.body).find(self.options.minicartSelector).replaceWith(res.minicart);
|
||||
$(window.parent.document.body).find(self.options.minicartSelector).trigger('contentUpdated');
|
||||
}
|
||||
|
||||
if (res.product && res.product.statusText) {
|
||||
$(window.parent.document.body).find(self.options.productStatusSelector)
|
||||
.removeClass('available')
|
||||
.addClass('unavailable')
|
||||
.find('span')
|
||||
.html(res.product.statusText);
|
||||
}
|
||||
self.enableAddToCartButton(form);
|
||||
|
||||
window.parent.ajaxCartTransport = !window.OXAjaxNShowMCart;
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
$(window.parent.document).trigger('ajax:addToCart:error', {
|
||||
'sku': form.data().productSku,
|
||||
'productIds': productIds,
|
||||
'form': form,
|
||||
'response': res
|
||||
});
|
||||
self.enableAddToCartButton(form);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
complete: function (res) {
|
||||
if (res.state() === 'rejected') {
|
||||
window.parent.location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return $.mage.OxQuickviewcatalogAddToCart;
|
||||
});
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
define(['jquery', 'OxQuickview', 'OXmodal'], function ($, quickview) {
|
||||
"use strict";
|
||||
|
||||
$.widget('mage.OxQuickviewInit', {
|
||||
_create: function () {
|
||||
$('#ox_quickview_wrapper').OXmodal({
|
||||
defaultModalClass: 'ox-dialog ox-smallmodal',
|
||||
type: 'modal',
|
||||
overlayClass: "ox-slideout-shadow",
|
||||
closeButtonTrigger: '.ox-overlay-close-btn',
|
||||
"htmlClass": "ox-fixed",
|
||||
});
|
||||
|
||||
$(document.body).on('click.OxQuickview', '.ox-quickview-button', function (event) {
|
||||
event.preventDefault();
|
||||
var prodUrl = $(this).attr('data-quickview-url');
|
||||
if (prodUrl) {
|
||||
quickview.displayContent(prodUrl);
|
||||
}
|
||||
}).on('closeOxQuickview', function () {
|
||||
quickview.close();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return $.mage.OxQuickviewInit;
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
define( [
|
||||
'jquery',
|
||||
'OXmodal'
|
||||
], function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
var oxquickview = {
|
||||
displayContent: function ( prodUrl ) {
|
||||
if ( !prodUrl.length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var a = $( '#ox_quickview_wrapper' );
|
||||
if ( !a.length ) {
|
||||
a = $( '<div>' ).attr( 'id', 'ox_quickview_wrapper' );
|
||||
$( 'body' ).append( a );
|
||||
a.OXmodal( {
|
||||
defaultModalClass: 'ox-dialog ox-smallmodal',
|
||||
type: 'modal',
|
||||
overlayClass: "ox-slideout-shadow",
|
||||
closeButtonTrigger: '.ox-overlay-close-btn',
|
||||
"htmlClass": "ox-fixed",
|
||||
} );
|
||||
}
|
||||
a.find( '.ox_quickview-preloader' ).show();
|
||||
a.find( 'iframe' ).remove();
|
||||
a.append( $( '<iframe>' ).attr( {
|
||||
src: prodUrl,
|
||||
frameborder: 0,
|
||||
allowfullscreen: 0,
|
||||
style: 'opacity: 0;width: 100%;height: 100%;',
|
||||
} ) );
|
||||
(a.data( 'mageOXmodal' ) || a.data( 'mage-OXmodal' )).open();
|
||||
a.parent().on( 'click', function ( e ) {
|
||||
(a.data( 'mageOXmodal' ) || a.data( 'mage-OXmodal' )).close();
|
||||
} );
|
||||
},
|
||||
close:function () {
|
||||
let a = $( '#ox_quickview_wrapper' );
|
||||
(a.data( 'mageOXmodal' ) || a.data( 'mage-OXmodal' )).close();
|
||||
}
|
||||
};
|
||||
|
||||
window.oxquickview = oxquickview;
|
||||
return oxquickview;
|
||||
} );
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'mage/mage',
|
||||
'Magento_Catalog/product/view/validation',
|
||||
'OxQuickviewcatalogAddToCart'
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.productValidate', {
|
||||
options: {
|
||||
bindSubmit: false,
|
||||
radioCheckboxClosest: '.nested'
|
||||
},
|
||||
|
||||
/**
|
||||
* Uses Magento's validation widget for the form object.
|
||||
* @private
|
||||
*/
|
||||
_create: function () {
|
||||
var bindSubmit = this.options.bindSubmit;
|
||||
|
||||
this.element.validation({
|
||||
radioCheckboxClosest: this.options.radioCheckboxClosest,
|
||||
|
||||
/**
|
||||
* Uses OxQuickviewcatalogAddToCart widget as submit handler.
|
||||
* @param {Object} form
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
submitHandler: function (form) {
|
||||
var jqForm = $(form).OxQuickviewcatalogAddToCart({
|
||||
bindSubmit: bindSubmit
|
||||
});
|
||||
|
||||
jqForm.OxQuickviewcatalogAddToCart('submitForm', jqForm);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.productValidate;
|
||||
});
|
||||
Reference in New Issue
Block a user