ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -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