init
This commit is contained in:
+79
@@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
<attribute name="class" value="page-product-bundle"/>
|
||||
<referenceBlock name="product.info">
|
||||
<block class="Stemcell\Checkout\Block\Catalog\Product\View" name="bundle.summary" as="form_bottom" template="Magento_Bundle::catalog/product/view/summary.phtml">
|
||||
<block class="Magento\Catalog\Pricing\Render" name="product.price.render.bundle.customization">
|
||||
<arguments>
|
||||
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
|
||||
<argument name="price_type_code" xsi:type="string">configured_price</argument>
|
||||
<argument name="zone" xsi:type="string">item_view</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.bundle" as="addtocart" template="Magento_Catalog::product/view/addtocart.phtml">
|
||||
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons"/>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.addto.bundle" as="addto" template="Magento_Catalog::product/view/addto.phtml"/>
|
||||
</block>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="product.info.options.wrapper">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="bundle.product.view.options.notice" template="Magento_Bundle::catalog/product/view/options/notice.phtml"/>
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle.options" as="type_bundle_options" template="Magento_Bundle::catalog/product/view/type/bundle/options.phtml" before="-">
|
||||
<container name="product.info.bundle.options.top" as="product_info_bundle_options_top">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="bundle.back.button" as="backButton" before="-" template="Magento_Bundle::catalog/product/view/backbutton.phtml"/>
|
||||
</container>
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select" name="product.info.bundle.options.select" as="select">
|
||||
<arguments>
|
||||
<argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument>
|
||||
<argument name="validateQuantityViewModel" xsi:type="object">Magento\Bundle\ViewModel\ValidateQuantity</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Multi" name="product.info.bundle.options.multi" as="multi"/>
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Radio" name="product.info.bundle.options.radio" as="radio">
|
||||
<arguments>
|
||||
<argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument>
|
||||
<argument name="validateQuantityViewModel" xsi:type="object">Magento\Bundle\ViewModel\ValidateQuantity</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox" name="product.info.bundle.options.checkbox" as="checkbox">
|
||||
<arguments>
|
||||
<argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</block>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="product.info.form.options">
|
||||
<container name="bundle.product.options.wrapper" htmlTag="div" htmlClass="bundle-options-wrapper"/>
|
||||
</referenceBlock>
|
||||
<move element="product.info.options.wrapper" destination="bundle.product.options.wrapper" before="-" />
|
||||
<move element="product.info.options.wrapper.bottom" destination="bundle.product.options.wrapper" after="product.info.options.wrapper" />
|
||||
<move element="product.price.tier" destination="product.info.options.wrapper.bottom" before="-" />
|
||||
<referenceBlock name="product.info.options.wrapper.bottom">
|
||||
<block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.qtyincrements" before="-" template="Magento_CatalogInventory::qtyincrements.phtml"/>
|
||||
<action method="unsetChild">
|
||||
<argument name="block" xsi:type="string">product.info.addtocart</argument>
|
||||
</action>
|
||||
<action method="setHideRequiredNotice">
|
||||
<argument name="flag" xsi:type="string">1</argument>
|
||||
</action>
|
||||
<action method="unsetChild">
|
||||
<argument name="block" xsi:type="string">product.info.addto</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
<referenceContainer name="product.info.type">
|
||||
<block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle" name="product.info.bundle" as="product_type_data" template="Magento_Bundle::catalog/product/view/type/bundle.phtml"/>
|
||||
<container name="product.info.bundle.extra" after="product.info.bundle" as="product_type_data_extra" label="Product Extra Info"/>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="product.info.main">
|
||||
<container name="bundle.options.container" htmlTag="div" htmlClass="bundle-options-container" after="product.info.media"/>
|
||||
</referenceContainer>
|
||||
<move element="product.info" destination="bundle.options.container" before="-"/>
|
||||
</body>
|
||||
</page>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?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>
|
||||
<referenceBlock name="checkout.cart.item.renderers">
|
||||
<block class="Stemcell\Checkout\Block\Cart\Item\Bundle\Renderer" name="checkout.cart.item.renderers.bundle" as="bundle" template="Magento_Checkout::cart/item/default.phtml">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.bundle.actions" as="actions">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.bundle.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.bundle.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
</referenceBlock>
|
||||
</body>
|
||||
</page>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
|
||||
/* @var $block \Stemcell\Checkout\Block\Catalog\Product\View */
|
||||
/* @var $_product \Magento\Catalog\Model\Product */
|
||||
$_product = $block->getProduct();
|
||||
$block->getBundleProductOptions($_product);
|
||||
?>
|
||||
<?php if ($_product->isSaleable() && $block->hasOptions()) : ?>
|
||||
<div id="bundleSummary"
|
||||
class="block-bundle-summary"
|
||||
data-mage-init='{"sticky":{"container": ".product-add-form"}}'>
|
||||
<div class="content">
|
||||
<!-- <div class="bundle-summary">-->
|
||||
<!-- <div id="bundle-summary" data-container="product-summary">-->
|
||||
<!-- <div class="bundle-options-label"><b>包含:</b></div>-->
|
||||
<!-- --><?php //foreach ($block->getBundleProductOptions($_product) as $_option): ?>
|
||||
<!-- --><?php ///* @var $_option \Magento\Catalog\Model\Product */ ?>
|
||||
<!-- <div class="bundle-option" style="margin-bottom: 20px">-->
|
||||
<!---->
|
||||
<!-- <div class="bundle-option-name">--><?php //= $_option->getName() ?><!--</div>-->
|
||||
<!-- <div class="bundle-option-sku">-->
|
||||
<!-- <span class="bundle-option-label">SKU:</span>-->
|
||||
<!-- --><?php //= $_option->getSku() ?>
|
||||
<!-- </div>-->
|
||||
<!-- <div class="bundle-option-qty">-->
|
||||
<!-- <span class="bundle-option-lable">数量:</span>-->
|
||||
<!-- --><?php //= number_format($_option->getSelectionQty()) ?>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- --><?php //endforeach; ?>
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="bundle-info">
|
||||
<div class="product-details">
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
".product-add-form": {
|
||||
"slide": {
|
||||
"slideSpeed": 1500,
|
||||
"slideSelector": "#bundle-slide",
|
||||
"slideBackSelector": ".action.customization.back",
|
||||
"bundleProductSelector": "#bundleProduct",
|
||||
"bundleOptionsContainer": ".product-add-form"
|
||||
<?php if ($block->isStartCustomization()) : ?>
|
||||
,"autostart": true
|
||||
<?php endif;?>
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="columns.top">
|
||||
<container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-">
|
||||
<block class="Magento\Catalog\Block\Category\View" name="category.image" template="Magento_Catalog::category/image.phtml">
|
||||
<arguments>
|
||||
<argument name="image" xsi:type="object">Magento\Catalog\ViewModel\Category\Image</argument>
|
||||
<argument name="output" xsi:type="object">Magento\Catalog\ViewModel\Category\Output</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml"/>
|
||||
<block class="Magento\Catalog\Block\Category\View" name="category.cms" template="Magento_Catalog::category/cms.phtml"/>
|
||||
</container>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="content">
|
||||
<block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
|
||||
<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
|
||||
<container name="category.product.list.additional" as="additional" />
|
||||
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
|
||||
<block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
|
||||
name="category.product.addto.compare" as="compare"
|
||||
template="Magento_Catalog::product/list/addto/compare.phtml"/>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
|
||||
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
|
||||
</block>
|
||||
<action method="setToolbarBlockName">
|
||||
<argument name="name" xsi:type="string">product_list_toolbar</argument>
|
||||
</action>
|
||||
<action method="setDefaultDirection">
|
||||
<argument name="dir" xsi:type="string">desc</argument>
|
||||
</action>
|
||||
</block>
|
||||
</block>
|
||||
<block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
|
||||
<arguments>
|
||||
<argument name="triggers" xsi:type="array">
|
||||
<item name="compareProductLink" xsi:type="string">.action.tocompare</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
<referenceBlock name="page.main.title">
|
||||
<arguments>
|
||||
<argument name="id" xsi:type="string">page-title-heading</argument>
|
||||
<argument name="add_base_attribute_aria" xsi:type="string">page-title-heading toolbar-amount</argument>
|
||||
</arguments>
|
||||
<block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="category.products.list">
|
||||
<arguments>
|
||||
<argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument>
|
||||
</arguments>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="category.product.addto" remove="true" />
|
||||
<move element="page.main.title" destination="content" before="category.products"/>
|
||||
<move element="category.image" destination="content" after="page.main.title"/>
|
||||
<move element="category.description" destination="content" after="category.image"/>
|
||||
</body>
|
||||
</page>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="root">
|
||||
<action method="setTemplate">
|
||||
<argument name="template" xsi:type="string">popup.phtml</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
<referenceContainer name="content">
|
||||
<block class="Magento\Catalog\Block\Product\Gallery" name="catalog_product_gallery" template="Magento_Catalog::product/gallery.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<css src="mage/gallery/gallery.css"/>
|
||||
</head>
|
||||
<update handle="catalog_product_opengraph" />
|
||||
<update handle="page_calendar"/>
|
||||
<body>
|
||||
<move element="page.main.title" destination="product.info.main" before="-"/>
|
||||
<attribute name="itemtype" value="http://schema.org/Product" />
|
||||
<attribute name="itemscope" value="itemscope"/>
|
||||
<referenceBlock name="head.components">
|
||||
<block class="Magento\Framework\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Catalog::js/components.phtml"/>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="page.main.title">
|
||||
<arguments>
|
||||
<argument name="css_class" xsi:type="string">product</argument>
|
||||
<argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
|
||||
</arguments>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="root">
|
||||
<arguments>
|
||||
<argument name="add_attribute" xsi:type="string">itemscope itemtype="http://schema.org/Product"</argument>
|
||||
</arguments>
|
||||
</referenceBlock>
|
||||
|
||||
<referenceBlock name="breadcrumbs" template="Magento_Catalog::product/breadcrumbs.phtml">
|
||||
<arguments>
|
||||
<argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\Breadcrumbs</argument>
|
||||
</arguments>
|
||||
</referenceBlock>
|
||||
|
||||
<referenceContainer name="content">
|
||||
<container name="product.info.main" htmlTag="div" htmlClass="product-info-main" after="product.info.media">
|
||||
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.overview" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info" before="product.info.price">
|
||||
<arguments>
|
||||
<argument name="at_call" xsi:type="string">getShortDescription</argument>
|
||||
<argument name="at_code" xsi:type="string">short_description</argument>
|
||||
<argument name="css_class" xsi:type="string">overview</argument>
|
||||
<argument name="at_label" xsi:type="string">none</argument>
|
||||
<argument name="title" translate="true" xsi:type="string">Overview</argument>
|
||||
<argument name="add_attribute" xsi:type="string">itemprop="description"</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="Magento_Catalog::product/view/review.phtml" after="product.info.stock.sku" />
|
||||
<container name="product.info.price" label="Product info auxiliary container" htmlTag="div" htmlClass="product-info-price">
|
||||
<container name="product.info.stock.sku" label="Product auxiliary info" htmlTag="div" htmlClass="product-info-stock-sku">
|
||||
<container name="product.info.type" before="-"/>
|
||||
</container>
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="Magento_Catalog::product/view/review.phtml" after="product.info.stock.sku" />
|
||||
<block class="Magento\Catalog\Pricing\Render" name="product.price.final">
|
||||
<arguments>
|
||||
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
|
||||
<argument name="price_type_code" xsi:type="string">final_price</argument>
|
||||
<argument name="zone" xsi:type="string">item_view</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</container>
|
||||
<block class="Magento\Catalog\Pricing\Render" name="product.price.tier" after="product.info.price">
|
||||
<arguments>
|
||||
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
|
||||
<argument name="price_type_code" xsi:type="string">tier_price</argument>
|
||||
<argument name="zone" xsi:type="string">item_view</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price.tier"/>
|
||||
|
||||
<block class="Stemcell\Catalog\Block\Product\View" name="product.info" template="Magento_Catalog::product/view/form.phtml">
|
||||
<block class="Magento\Framework\View\Element\Template" name="product.info.form.options" as="options_container">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="Magento_Catalog::product/view/options/wrapper.phtml" after="product.info.price">
|
||||
<block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="Magento_Catalog::product/view/options.phtml">
|
||||
<block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" name="product.info.options.default" as="default" template="Magento_Catalog::product/view/options/type/default.phtml"/>
|
||||
<block class="Magento\Catalog\Block\Product\View\Options\Type\Text" name="product.info.options.text" as="text" template="Magento_Catalog::product/view/options/type/text.phtml"/>
|
||||
<block class="Magento\Catalog\Block\Product\View\Options\Type\File" name="product.info.options.file" as="file" template="Magento_Catalog::product/view/options/type/file.phtml"/>
|
||||
<block class="Magento\Catalog\Block\Product\View\Options\Type\Select" name="product.info.options.select" as="select" template="Magento_Catalog::product/view/options/type/select.phtml"/>
|
||||
<block class="Magento\Catalog\Block\Product\View\Options\Type\Date" name="product.info.options.date" as="date" template="Magento_Catalog::product/view/options/type/date.phtml"/>
|
||||
</block>
|
||||
<block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
<container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint">
|
||||
<container name="product.info.social" label="Product social links container" htmlTag="div" htmlClass="product-social-links">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.addto" as="addto" template="Magento_Catalog::product/view/addto.phtml">
|
||||
<block class="Magento\Catalog\Block\Product\View\AddTo\Compare" name="view.addto.compare" after="view.addto.wishlist"
|
||||
template="Magento_Catalog::product/view/addto/compare.phtml" >
|
||||
<arguments>
|
||||
<argument name="addToCompareViewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.mailto" template="Magento_Catalog::product/view/mailto.phtml"/>
|
||||
</container>
|
||||
</container>
|
||||
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.info.custom" template="Magento_Catalog::product/view/productCustom.phtml" after="product.info.options.wrapper" />
|
||||
<container name="product.info.form.content" as="product_info_form_content" after="product.info.custom">
|
||||
<block class="Stemcell\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
|
||||
</container>
|
||||
</container>
|
||||
<container name="product.info.media" htmlTag="div" htmlClass="product media" before="-">
|
||||
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_after.target" before="skip_gallery_before.wrapper" template="Magento_Theme::html/skiptarget.phtml">
|
||||
<arguments>
|
||||
<argument name="target_id" xsi:type="string">gallery-prev-area</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
|
||||
<block class="Magento\Framework\View\Element\Template" before="product.info.media.image" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
|
||||
<arguments>
|
||||
<argument name="target" xsi:type="string">gallery-next-area</argument>
|
||||
<argument name="label" translate="true" xsi:type="string">Skip to the end of the images gallery</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</container>
|
||||
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml">
|
||||
<arguments>
|
||||
<argument name="gallery_options" xsi:type="object">Magento\Catalog\Block\Product\View\GalleryOptions</argument>
|
||||
<argument name="imageHelper" xsi:type="object">Magento\Catalog\Helper\Image</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
|
||||
<block class="Magento\Framework\View\Element\Template" after="product.info.media.image" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
|
||||
<arguments>
|
||||
<argument name="target" xsi:type="string">gallery-prev-area</argument>
|
||||
<argument name="label" translate="true" xsi:type="string">Skip to the beginning of the images gallery</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</container>
|
||||
<block class="Magento\Framework\View\Element\Template" name="skip_gallery_before.target" after="skip_gallery_after.wrapper" template="Magento_Theme::html/skiptarget.phtml">
|
||||
<arguments>
|
||||
<argument name="target_id" xsi:type="string">gallery-next-area</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\ProductVideo\Block\Product\View\Gallery" name="product.info.media.video" after="product.info.media.image" template="Magento_ProductVideo::product/view/gallery.phtml"/>
|
||||
</container>
|
||||
|
||||
<block class="Magento\Catalog\Block\Product\View\Details" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
|
||||
|
||||
</block>
|
||||
<block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
|
||||
<arguments>
|
||||
<argument name="triggers" xsi:type="array">
|
||||
<item name="compareProductLink" xsi:type="string">.action.tocompare</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
|
||||
<referenceContainer name="product.info.description.wrapper">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.details.top" template="Magento_Catalog::product/view/productDetailsTop.phtml" before="product.info.description" />
|
||||
</referenceContainer>
|
||||
<referenceContainer name="product.attributes.pagebuilder.wrapper">
|
||||
<block class="Magento\Catalog\Block\Product\View" name="product.details.custom" template="Magento_Catalog::product/view/productDetailsCustom.phtml" before="product.info.description" />
|
||||
</referenceContainer>
|
||||
|
||||
<referenceContainer name="content.aside">
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
|
||||
<arguments>
|
||||
<argument name="type" xsi:type="string">related</argument>
|
||||
<argument name="view_model" xsi:type="object">Magento\Catalog\ViewModel\Product\Listing\PreparePostData</argument>
|
||||
</arguments>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="related.product.addto" as="addto">
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
|
||||
name="related.product.addto.compare" as="compare"
|
||||
template="Magento_Catalog::product/list/addto/compare.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
|
||||
<arguments>
|
||||
<argument name="type" xsi:type="string">upsell</argument>
|
||||
<argument name="view_model" xsi:type="object">Magento\Catalog\ViewModel\Product\Listing\PreparePostData</argument>
|
||||
</arguments>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="upsell.product.addto" as="addto">
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
|
||||
name="upsell.product.addto.compare" as="compare"
|
||||
template="Magento_Catalog::product/list/addto/compare.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
<block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional" as="product_additional_data"/>
|
||||
</referenceContainer>
|
||||
<referenceBlock name="product.info.addtocart">
|
||||
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons"/>
|
||||
</referenceBlock>
|
||||
<referenceBlock name="product.info.addtocart.additional">
|
||||
<block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons.additional"/>
|
||||
</referenceBlock>
|
||||
<referenceContainer name="content">
|
||||
<block
|
||||
class="Magento\Catalog\Block\Ui\ProductViewCounter"
|
||||
name="product_viewed_counter"
|
||||
template="Magento_Catalog::product/view/counter.phtml"/>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="page.main.price" remove="true" />
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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>
|
||||
<referenceContainer name="header-wrapper">
|
||||
<container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper">
|
||||
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml">
|
||||
<arguments>
|
||||
<argument name="jsLayout" xsi:type="array">
|
||||
<item name="components" xsi:type="array">
|
||||
<item name="compareProducts" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</container>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Category view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Category\View
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->isContentMode() || $block->isMixedMode()) :?>
|
||||
<div class="category-cms">
|
||||
<?= $block->getCmsBlockHtml() ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Category view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Category\View
|
||||
*/
|
||||
?>
|
||||
<?php if ($_description = $block->getCurrentCategory()->getDescription()) :?>
|
||||
<div class="category-description">
|
||||
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->categoryAttribute(
|
||||
$block->getCurrentCategory(),
|
||||
$_description,
|
||||
'description'
|
||||
) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Category view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Category\View
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
// phpcs:disable Generic.WhiteSpace.ScopeIndent.IncorrectExact
|
||||
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
|
||||
?>
|
||||
<?php
|
||||
$_category = $block->getCurrentCategory();
|
||||
$_imgHtml = '';
|
||||
if ($_imgUrl = $block->getImage()->getUrl($_category)) {
|
||||
$_imgHtml = '<div class="category-image"><img src="'
|
||||
. $block->escapeUrl($_imgUrl)
|
||||
. '" alt="'
|
||||
. $block->escapeHtmlAttr($_category->getName())
|
||||
. '" title="'
|
||||
. $block->escapeHtmlAttr($_category->getName())
|
||||
. '" class="image" /></div>';
|
||||
$_imgHtml = $block->getOutput()->categoryAttribute($_category, $_imgHtml, 'image');
|
||||
/* @noEscape */ echo $_imgHtml;
|
||||
}
|
||||
?>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Category view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Category\View
|
||||
*/
|
||||
?>
|
||||
<?php if (!$block->isContentMode() || $block->isMixedMode()) :?>
|
||||
<?= $block->getProductListHtml() ?>
|
||||
<?php endif; ?>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<div class="widget block block-category-link">
|
||||
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
|
||||
</div>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var Magento\Catalog\Block\Widget\Link $block */
|
||||
?>
|
||||
<?= $block->escapeHtml($block->getHref()) ?>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<span class="widget block block-category-link-inline">
|
||||
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
|
||||
</span>
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Catalog\Model\Product\Option;
|
||||
|
||||
/**
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Select\Checkable
|
||||
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
|
||||
*/
|
||||
$option = $block->getOption();
|
||||
if ($option): ?>
|
||||
<?php
|
||||
$configValue = $block->getPreconfiguredValue($option);
|
||||
$optionType = $option->getType();
|
||||
$arraySign = $optionType === Option::OPTION_TYPE_CHECKBOX ? '[]' : '';
|
||||
$count = 1;
|
||||
?>
|
||||
|
||||
<div class="options-list nested" id="options-<?= $block->escapeHtmlAttr($option->getId()) ?>-list">
|
||||
<?php if ($optionType === Option::OPTION_TYPE_RADIO && !$option->getIsRequire()):?>
|
||||
<div class="field choice admin__field admin__field-option">
|
||||
<input type="radio"
|
||||
id="options_<?= $block->escapeHtmlAttr($option->getId()) ?>"
|
||||
class="radio admin__control-radio product-custom-option"
|
||||
name="options[<?= $block->escapeHtmlAttr($option->getId()) ?>]"
|
||||
data-selector="options[<?= $block->escapeHtmlAttr($option->getId()) ?>]"
|
||||
value=""
|
||||
checked="checked"
|
||||
/>
|
||||
<?php if (!$block->getSkipJsReloadPrice()): ?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
|
||||
'onclick',
|
||||
'opConfig.reloadPrice()',
|
||||
"options_" . $block->escapeJs($option->getId())
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<label class="label admin__field-label" for="options_<?= $block->escapeHtmlAttr($option->getId()) ?>">
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('None')) ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($option->getValues() as $value): ?>
|
||||
<?php
|
||||
$checked = '';
|
||||
$count++;
|
||||
if ($arraySign) {
|
||||
$checked = is_array($configValue) && in_array($value->getOptionTypeId(), $configValue) ? 'checked' : '';
|
||||
} else {
|
||||
$checked = $configValue == $value->getOptionTypeId() ? 'checked' : '';
|
||||
}
|
||||
$dataSelector = 'options[' . $option->getId() . ']';
|
||||
if ($arraySign) {
|
||||
$dataSelector .= '[' . $value->getOptionTypeId() . ']';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="field choice admin__field admin__field-option">
|
||||
<input type="<?= $block->escapeHtmlAttr($optionType) ?>"
|
||||
class="<?= $optionType === Option::OPTION_TYPE_RADIO
|
||||
? 'radio admin__control-radio'
|
||||
: 'checkbox admin__control-checkbox' ?> <?= $option->getIsRequire()
|
||||
? 'required': '' ?>
|
||||
product-custom-option
|
||||
<?= $block->getSkipJsReloadPrice() ? '' : 'opConfig.reloadPrice()' ?>"
|
||||
name="options[<?= $block->escapeHtmlAttr($option->getId()) ?>]<?= /* @noEscape */ $arraySign ?>"
|
||||
id="options_<?= $block->escapeHtmlAttr($option->getId() . '_' . $count) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($value->getOptionTypeId()) ?>"
|
||||
<?= $block->escapeHtml($checked) ?>
|
||||
data-selector="<?= $block->escapeHtmlAttr($dataSelector) ?>"
|
||||
price="<?= $block->escapeHtmlAttr($block->getCurrencyByStore($value)) ?>"
|
||||
/>
|
||||
<label class="label admin__field-label"
|
||||
for="options_<?= $block->escapeHtmlAttr($option->getId() . '_' . $count) ?>">
|
||||
<span>
|
||||
<?= $block->escapeHtml($value->getTitle()) ?>
|
||||
</span>
|
||||
<?= /* @noEscape */ $block->formatPrice($value) ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Catalog\Block\Product\Gallery $block */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
<?php $_width = $block->getImageWidth(); ?>
|
||||
<div class="product-image-popup">
|
||||
<div class="buttons-set"><a href="#" class="button" role="close-window">
|
||||
<span><?= $block->escapeHtml(__('Close Window')) ?></span></a></div>
|
||||
<?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()):?>
|
||||
<div class="nav">
|
||||
<?php if ($_prevUrl = $block->getPreviousImageUrl()):?>
|
||||
<a href="<?= $block->escapeUrl($_prevUrl) ?>"
|
||||
class="prev">« <?= $block->escapeHtml(__('Prev')) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($_nextUrl = $block->getNextImageUrl()):?>
|
||||
<a href="<?= $block->escapeUrl($_nextUrl) ?>"
|
||||
class="next"><?= $block->escapeHtml(__('Next')) ?> »</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($_imageTitle = $block->escapeHtml($block->getCurrentImage()->getLabel())):?>
|
||||
<h1 class="image-label"><?= /* @noEscape */ $_imageTitle ?></h1>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$imageUrl = $block->getImageUrl();
|
||||
?>
|
||||
<img src="<?= $block->escapeUrl($imageUrl) ?>"
|
||||
<?php if ($_width):?>
|
||||
width="<?= /* @noEscape */ $_width ?>"
|
||||
<?php endif; ?>
|
||||
alt="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getCurrentImage()->getLabel()) ?>"
|
||||
id="product-gallery-image"
|
||||
class="image"
|
||||
data-mage-init='{"catalogGallery":{}}'/>
|
||||
<div class="buttons-set"><
|
||||
a href="#" class="button" role="close-window"><span><?= $block->escapeHtml(__('Close Window')) ?></span></a>
|
||||
</div>
|
||||
<?php if ($block->getPreviousImageUrl() || $block->getNextImageUrl()):?>
|
||||
<div class="nav">
|
||||
<?php if ($_prevUrl = $block->getPreviousImageUrl()):?>
|
||||
<a href="<?= $block->escapeUrl($_prevUrl) ?>"
|
||||
class="prev">« <?= $block->escapeHtml(__('Prev')) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($_nextUrl = $block->getNextImageUrl()):?>
|
||||
<a href="<?= $block->escapeUrl($_nextUrl) ?>"
|
||||
class="next"><?= $block->escapeHtml(__('Next')) ?> »</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
'width:' . /* @noEscape */ $_width . 'px;',
|
||||
'div.product-image-popup'
|
||||
) ?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var $block \Magento\Catalog\Block\Product\Image */
|
||||
/** @var $escaper \Magento\Framework\Escaper */
|
||||
?>
|
||||
<!--deprecated template as image_with_borders is a primary one-->
|
||||
<img class="photo image <?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
|
||||
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
|
||||
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
|
||||
<?php endforeach; ?>
|
||||
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
|
||||
loading="lazy"
|
||||
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
|
||||
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
|
||||
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>" />
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var $block \Magento\Catalog\Block\Product\Image */
|
||||
/** @var $escaper \Magento\Framework\Escaper */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
$width = (int)$block->getWidth();
|
||||
$paddingBottom = $block->getRatio() * 100;
|
||||
?>
|
||||
<span class="product-image-container product-image-container-<?= /* @noEscape */ $block->getProductId() ?>">
|
||||
<span class="product-image-wrapper">
|
||||
<img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
|
||||
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
|
||||
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
|
||||
<?php endforeach; ?>
|
||||
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
|
||||
loading="lazy"
|
||||
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
|
||||
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
|
||||
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/></span>
|
||||
</span>
|
||||
<?php
|
||||
$styles = <<<STYLE
|
||||
.product-image-container-{$block->getProductId()} {
|
||||
width: {$width}px;
|
||||
}
|
||||
.product-image-container-{$block->getProductId()} span.product-image-wrapper {
|
||||
padding-bottom: {$paddingBottom}%;
|
||||
}
|
||||
STYLE;
|
||||
//In case a script was using "style" attributes of these elements
|
||||
$script = <<<SCRIPT
|
||||
prodImageContainers = document.querySelectorAll(".product-image-container-{$block->getProductId()}");
|
||||
for (var i = 0; i < prodImageContainers.length; i++) {
|
||||
prodImageContainers[i].style.width = "{$width}px";
|
||||
}
|
||||
prodImageContainersWrappers = document.querySelectorAll(
|
||||
".product-image-container-{$block->getProductId()} span.product-image-wrapper"
|
||||
);
|
||||
for (var i = 0; i < prodImageContainersWrappers.length; i++) {
|
||||
prodImageContainersWrappers[i].style.paddingBottom = "{$paddingBottom}%";
|
||||
}
|
||||
SCRIPT;
|
||||
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('style', [], $styles, false) ?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', ['type' => 'text/javascript'], $script, false) ?>
|
||||
@@ -0,0 +1,380 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
use Magento\Framework\App\Action\Action;
|
||||
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\ListProduct
|
||||
* @var \Magento\Framework\Escaper $escaper
|
||||
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
$_productCollection = $block->getLoadedProductCollection();
|
||||
/** @var \Magento\Catalog\Helper\Output $_helper */
|
||||
$_helper = $block->getData('outputHelper');
|
||||
$isEnquiry = $block->getRequest()->getParam('enquiry')==1;
|
||||
$enquiryProductsId = [66, 55];
|
||||
$isSearch = str_contains($block->getRequest()->getRequestUri(), 'catalogsearch');
|
||||
$documentCatIds = [153,306,154,185,247];
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$currentCategory = $objectManager->get(\Magento\Framework\Registry::class)->registry('current_category');
|
||||
$scopeConfig = $objectManager->get(\Magento\Framework\App\Config\ScopeConfigInterface::class);
|
||||
$eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class);
|
||||
$attribute = $eavConfig->getAttribute(
|
||||
\Magento\Catalog\Model\Product::ENTITY,
|
||||
'category_option'
|
||||
);
|
||||
|
||||
// Force admin store view
|
||||
$attribute->setStoreId(\Magento\Store\Model\Store::DEFAULT_STORE_ID);
|
||||
|
||||
$categoryOptionLabel = $attribute->getSource()->getOptionText($block->getRequest()->getParam('category_option', 0));
|
||||
$categoryOptionListViewLabels = [
|
||||
\Stemcell\Catalog\Enum\CategoryOption::Documents->value
|
||||
];
|
||||
// 获取配置值
|
||||
$samplePackCategoryId = $scopeConfig->getValue(
|
||||
'catalog/product_settings/sample_pack_category_id',
|
||||
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
|
||||
);
|
||||
|
||||
?>
|
||||
<?php if (!$_productCollection->count()): ?>
|
||||
<div class="message info">
|
||||
<div>
|
||||
<?php if ($currentCategory && ($currentCategory->getUrlKey()=='product-information-sheets')): ?>
|
||||
根据您输入的产品号暂时无法检索出产品说明书,请电话联系 <a href="tel:4008859050">400 885 9050</a> 或邮件联系 <a href="mailto:info.cn@stemcell.com">info.cn@stemcell.com</a>。
|
||||
<?php else: ?>
|
||||
<?= $escaper->escapeHtml(__('We can\'t find products matching the selection.')) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?= $block->getToolbarHtml() ?>
|
||||
<?= $block->getAdditionalHtml() ?>
|
||||
<?php
|
||||
if ($block->getMode() === 'grid') {
|
||||
$viewMode = 'grid';
|
||||
$imageDisplayArea = 'category_page_grid';
|
||||
$showDescription = false;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
|
||||
} else {
|
||||
$viewMode = 'list';
|
||||
$imageDisplayArea = 'category_page_list';
|
||||
$showDescription = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::FULL_VIEW;
|
||||
}
|
||||
/**
|
||||
* Position for actions regarding image size changing in vde if needed
|
||||
*/
|
||||
$pos = $block->getPositioned();
|
||||
$categoryOption = $block->getRequest()->getParam('category_option');
|
||||
if ($block->getRequest()->getModuleName()=='catalogsearch' && in_array($categoryOptionLabel, $categoryOptionListViewLabels)) {
|
||||
$viewMode = 'list';
|
||||
}
|
||||
?>
|
||||
<div class="products wrapper <?= /* @noEscape */ $viewMode ?> products-<?= /* @noEscape */ $viewMode ?>">
|
||||
<ol class="products list items product-items">
|
||||
<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
|
||||
<?php foreach ($_productCollection as $product): $_product = $product->load($product->getId());?>
|
||||
<li class="item product product-item <?php if($viewMode=='list'):?>pdf-product-item<?php endif;?>">
|
||||
<div class="product-item-info"
|
||||
id="product-item-info_<?= /* @noEscape */ $_product->getId() ?>"
|
||||
data-container="product-<?= /* @noEscape */ $viewMode ?>">
|
||||
<?php if($_product->getData('is_new_product')):?>
|
||||
<span class="new-label grid">新品</span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
// 根据产品类型选择合适的图片尺寸
|
||||
if ($_product->getTypeId() === 'virtual') {
|
||||
$currentImageDisplayArea = $imageDisplayArea . '_virtual';
|
||||
} else {
|
||||
$currentImageDisplayArea = $imageDisplayArea ;
|
||||
}
|
||||
|
||||
/* @var $productImage Magento\Catalog\Block\Product\Image */
|
||||
$productImage = $block->getImage($_product, $currentImageDisplayArea);
|
||||
|
||||
if ($pos != null) {
|
||||
$position = 'left:' . $productImage->getWidth() . 'px;'
|
||||
. 'top:' . $productImage->getHeight() . 'px;';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$supportTableIds = [2221,2196,2234];
|
||||
$pdfUrlIds = [2172,2181,2216];
|
||||
if($_product->getData('document_path') && !in_array($_product->getData('resource_type'), $pdfUrlIds)){
|
||||
$productUrl = $_product->getData('document_path');
|
||||
} elseif ($_product->getData('form_link') && $_product->getData('resource_type')!=2220){
|
||||
$productUrl = $_product->getData('form_link');
|
||||
} else {
|
||||
$productUrl = $escaper->escapeUrl($_product->getProductUrl());
|
||||
}
|
||||
if($isEnquiry && in_array($_product->getId(), $enquiryProductsId)) {
|
||||
$productUrl .= '?enquiry=1';
|
||||
}
|
||||
|
||||
if($isSearch || ($currentCategory && !in_array($currentCategory->getId(), $documentCatIds) && !in_array($_product->getData('resource_type'), $supportTableIds) && $currentCategory->getId()!=='250' && $_product->getData('resource_type')!=='2223')):
|
||||
?>
|
||||
<a href="<?= $productUrl ?>"
|
||||
class="product photo product-item-photo"
|
||||
tabindex="-1">
|
||||
<?= $productImage->toHtml() ?>
|
||||
<?php if($_product->getData('duration')):?>
|
||||
<span class="duration-label grid"><?php echo $_product->getData('duration')?></span>
|
||||
<?php endif;?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<div class="product details product-item-details">
|
||||
<?php $resourceTypeLabel = $_product->getAttributeText('resource_type'); ?>
|
||||
<?php if($_product->getData('resource_type')&&$_product->getData('resource_type')!=2234):?>
|
||||
<div class="resource-type"><?= $resourceTypeLabel ?></div>
|
||||
<?php endif;?>
|
||||
<?php $_productNameStripped = $block->stripTags($_product->getName(), null, true); ?>
|
||||
|
||||
<?php if($_product->getData('resource_type') && $_product->getData('resource_type')==2234):?>
|
||||
<div class="product-shop link-icon accordion-link">
|
||||
<div class="desc accordion">
|
||||
<div class="publication accordion-item">
|
||||
<div class="accordion-trigger">
|
||||
<div class="heading">
|
||||
<span class="author-date">
|
||||
<?= $_product->getData('author_info') ?> (<?= $_product->getData('reference_month') ?> <?= $_product->getData('reference_year') ?>)
|
||||
</span>
|
||||
<span class="reference-info">
|
||||
<?= $_product->getData('reference_journal') ?> <?= $_product->getData('reference_volume') ?> <?= $_product->getData('reference_issue') ?> <?= $_product->getData('reference_pages') ?>
|
||||
</span>
|
||||
</div>
|
||||
<h2 class="product-name">
|
||||
<?=/* @noEscape */ $_helper->productAttribute($_product, $_product->getName(), 'name')?>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<div class="abstract">
|
||||
<?= $_product->getData('reference_abstract') ?>
|
||||
<?php if($_product->getData('reference_url')):?>
|
||||
<a class="view-publication" href="<?= $_product->getData('reference_url') ?>" target="_blank">
|
||||
<i class="fa fa-external-link"></i>
|
||||
View Publication </a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<strong class="product name product-item-name <?php if($_product->getData('document_path') && !in_array($_product->getData('resource_type'), $pdfUrlIds)):?>pdf-product-name<?php endif;?>">
|
||||
<a class="product-item-link"
|
||||
href="<?= $productUrl ?>">
|
||||
<?=/* @noEscape */ $_helper->productAttribute($_product, $_product->getName(), 'name')?>
|
||||
</a>
|
||||
</strong>
|
||||
<?php endif;?>
|
||||
<?php $metaDescription = $product->getData('meta_description'); ?>
|
||||
<?php if ($resourceTypeLabel=='技术公告' && $metaDescription): ?>
|
||||
<div class="product-item-meta-description" style="color: #b6b6b6; margin-bottom: 0.5rem">
|
||||
<?php if ($block->getMode() === 'list'): ?> <b>简介:</b> <?php endif; ?>
|
||||
<?= $metaDescription ?>
|
||||
</div>
|
||||
<div class="product-item-sku" style="font-size: 1.1rem; color: #929090;">
|
||||
<b>产品号# </b> <?= $product->getSku() ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getTypeId()=='virtual'):?>
|
||||
<?php if($_product->getData('interviewee') && $_product->getData('resource_type')==2231):?>
|
||||
<?= $_product->getData('interviewee') ?>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$catIds = [2215,2216,2217,2220,2223,2247,2249,2237];
|
||||
if(!in_array($_product->getData('resource_type'), $catIds)):
|
||||
?>
|
||||
<div class="info-box <?php if($_product->getData('resource_type')==2234):?>info-box-reference<?php endif;?>">
|
||||
<?php if($isSearch || ($currentCategory && $_product->getData('product_family') && $_product->getData('resource_type')!=2231 && !in_array($currentCategory->getId(), $documentCatIds))):?>
|
||||
<div class="info-item">
|
||||
<p class="label">产品类型:</p>
|
||||
<p class="value"><?= $_product->getAttributeText('product_family') ?></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('brand') && $_product->getData('resource_type')==2198):?>
|
||||
<div class="info-item">
|
||||
<p class="label">品牌:</p>
|
||||
<p class="value">
|
||||
<?php
|
||||
$brand = $_product->getAttributeText('brand');
|
||||
if(is_array($brand)):
|
||||
$brandStr = implode(',', $brand);
|
||||
?>
|
||||
<?= $brandStr; ?>
|
||||
<?php else:?>
|
||||
<?= $brand; ?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$celltypecatIds = [2172,2181];
|
||||
if($_product->getData('cell_type') && in_array($_product->getData('resource_type'), $celltypecatIds)):
|
||||
?>
|
||||
<div class="info-item">
|
||||
<p class="label">细胞类型:</p>
|
||||
<p class="value">
|
||||
<?php
|
||||
$cellType = $_product->getAttributeText('cell_type');
|
||||
if(is_array($cellType)):
|
||||
$cellTypeStr = implode(',', $cellType);
|
||||
?>
|
||||
<?= $cellTypeStr; ?>
|
||||
<?php else:?>
|
||||
<?= $cellType; ?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$areacatIds = [2231,2244];
|
||||
if($_product->getData('area_of_interest') && in_array($_product->getData('resource_type'), $areacatIds)):?>
|
||||
<div class="info-item">
|
||||
<p class="label">研究方向:</p>
|
||||
<p class="value">
|
||||
<?php
|
||||
$areaInsert = $_product->getAttributeText('area_of_interest');
|
||||
if(is_array($areaInsert)):
|
||||
$areaInsertStr = implode(',', $areaInsert);
|
||||
?>
|
||||
<?= $areaInsertStr; ?>
|
||||
<?php else:?>
|
||||
<?= $areaInsert; ?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('topics')):?>
|
||||
<div class="info-item">
|
||||
<p class="label">Topics:</p>
|
||||
<p class="value"><?= $_product->getData('topics') ?></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('conference')):?>
|
||||
<div class="info-item">
|
||||
<p class="label">Conference:</p>
|
||||
<p class="value"><?= $_product->getData('conference') ?></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$parentSkus = (string)$_product->getData('parent_skus');
|
||||
if($isSearch || ($currentCategory && in_array($currentCategory->getId(), $documentCatIds) && $parentSkus) || in_array($_product->getData('resource_type'), $supportTableIds)):
|
||||
$parentSkusArr = explode(',',$parentSkus);
|
||||
?>
|
||||
<div class="info-item">
|
||||
<p class="label">产品号#:</p>
|
||||
<?php foreach($parentSkusArr as $sku):?>
|
||||
<p class="value"><?= $sku ?></p>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<p class="label">产品名:</p>
|
||||
<?php
|
||||
foreach($parentSkusArr as $productsku):
|
||||
try {
|
||||
$parentProduct = $objectManager->create('Magento\Catalog\Model\ProductRepository')->get($productsku);
|
||||
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
|
||||
$parentProduct = $objectManager->create('Magento\Catalog\Model\Product');
|
||||
}
|
||||
?>
|
||||
<p class="value"><?= $parentProduct->getName(); ?></p>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$shortDescatIds = [2216,2249];
|
||||
if(in_array($_product->getData('resource_type'), $shortDescatIds)):
|
||||
?>
|
||||
<?= $_product->getData('short_description') ?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$noPublishDateCatIds = [2223,2172,2244];
|
||||
if($_product->getData('new_publish_date') && !in_array($_product->getData('resource_type'), $noPublishDateCatIds)):
|
||||
?>
|
||||
<div class="info-item publish-date">
|
||||
<div class="value">发布日期: <?= date('m/d/Y', strtotime($_product->getData('new_publish_date'))) ?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php else:?>
|
||||
<?= $_product->getData('short_description') ?>
|
||||
<?php if($currentCategory && ($currentCategory->getId()==$samplePackCategoryId)):?>
|
||||
<p>产品号: <?= $_product->getData('sku') ?></p>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php if($isEnquiry && in_array($_product->getId(), $enquiryProductsId)): ?>
|
||||
<div class="actions-toolbar">
|
||||
<div class="primary" style="float:right">
|
||||
<a class="action submit primary" target="_blank" href="<?= $productUrl ?>">
|
||||
<span>询价</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif($isEnquiry): ?>
|
||||
<div class="actions-toolbar">
|
||||
<div class="primary" style="float:right">
|
||||
<a class="action submit primary" target="_blank" href="<?= $productUrl ?>">
|
||||
<span>购买</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?= ($pos && strpos($pos, $viewMode . '-actions')) ?
|
||||
/* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
$position,
|
||||
'product-item-info_' . $_product->getId() . ' div.product-item-actions'
|
||||
) : '' ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="toolbar-bottom"><?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?></div>
|
||||
<?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
|
||||
// 抗体列表不显示跟 global 对比多出的筛选项
|
||||
$('.category-antibodies #attr_144,.category-antibodies #attr_141,.category-antibodies #attr_193').parent().hide();
|
||||
$('.category-buffers-and-solutions #attr_193').parent().hide();
|
||||
$('.category-cultureware-and-general-supplies #attr_193').parent().hide();
|
||||
$('.category-density-gradient-media #attr_199').parent().hide();
|
||||
|
||||
// Reference页面标题内容展开关闭
|
||||
$('.accordion-trigger').click(function(){
|
||||
$(this).toggleClass('active');
|
||||
$(this).parents('.accordion-link').toggleClass('active');
|
||||
$(this).next().slideToggle();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare */
|
||||
?>
|
||||
<a href="#"
|
||||
class="action tocompare"
|
||||
title="<?= $block->escapeHtml(__('Add to Compare')) ?>"
|
||||
aria-label="<?= $block->escapeHtml(__('Add to Compare')) ?>"
|
||||
data-post='<?= /* @noEscape */ $block->getCompareHelper()->getPostDataParams($block->getProduct()) ?>'
|
||||
role="button">
|
||||
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
|
||||
</a>
|
||||
+306
@@ -0,0 +1,306 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Catalog\ViewModel\Product\Listing\PreparePostData;
|
||||
use Magento\Framework\App\ActionInterface;
|
||||
|
||||
/* @var $block \Magento\Catalog\Block\Product\AbstractProduct */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
|
||||
<?php
|
||||
switch ($type = $block->getType()) {
|
||||
|
||||
case 'related-rule':
|
||||
if ($exist = $block->hasItems()) {
|
||||
$type = 'related';
|
||||
$class = $type;
|
||||
|
||||
$image = 'related_products_list';
|
||||
$title = __('Related Products');
|
||||
$items = $block->getAllItems();
|
||||
$limit = $block->getPositionLimit();
|
||||
$shuffle = (int) $block->isShuffled();
|
||||
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
|
||||
$canItemsAddToCart = $block->canItemsAddToCart();
|
||||
|
||||
$showAddTo = true;
|
||||
$showCart = false;
|
||||
$templateType = null;
|
||||
$description = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'related':
|
||||
/** @var \Magento\Catalog\Block\Product\ProductList\Related $block */
|
||||
if ($exist = $block->getItems()->getSize()) {
|
||||
$type = 'related';
|
||||
$class = $type;
|
||||
|
||||
$image = 'related_products_list';
|
||||
$title = __('Related Products');
|
||||
$items = $block->getItems();
|
||||
$limit = 0;
|
||||
$shuffle = 0;
|
||||
$isWeightedRandom = 0;
|
||||
$canItemsAddToCart = $block->canItemsAddToCart();
|
||||
|
||||
$showAddTo = true;
|
||||
$showCart = false;
|
||||
$templateType = null;
|
||||
$description = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'upsell-rule':
|
||||
if ($exist = $block->hasItems()) {
|
||||
$type = 'upsell';
|
||||
$class = $type;
|
||||
|
||||
$image = 'upsell_products_list';
|
||||
$title = __('We found other products you might like!');
|
||||
$items = $block->getAllItems();
|
||||
$limit = $block->getPositionLimit();
|
||||
$shuffle = (int) $block->isShuffled();
|
||||
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
|
||||
|
||||
$showAddTo = false;
|
||||
$showCart = false;
|
||||
$templateType = null;
|
||||
$description = false;
|
||||
$canItemsAddToCart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'upsell':
|
||||
/** @var \Magento\Catalog\Block\Product\ProductList\Upsell $block */
|
||||
if ($exist = count($block->getItemCollection()->getItems())) {
|
||||
$type = 'upsell';
|
||||
$class = $type;
|
||||
|
||||
$image = 'upsell_products_list';
|
||||
$title = __('We found other products you might like!');
|
||||
$items = $block->getItemCollection()->getItems();
|
||||
$limit = $block->getItemLimit('upsell');
|
||||
$shuffle = 0;
|
||||
$isWeightedRandom = 0;
|
||||
|
||||
$showAddTo = false;
|
||||
$showCart = false;
|
||||
$templateType = null;
|
||||
$description = false;
|
||||
$canItemsAddToCart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'crosssell-rule':
|
||||
/** @var \Magento\Catalog\Block\Product\ProductList\Crosssell $block */
|
||||
if ($exist = $block->hasItems()) {
|
||||
$type = 'crosssell';
|
||||
$class = $type;
|
||||
|
||||
$image = 'cart_cross_sell_products';
|
||||
$title = __('More Choices:');
|
||||
$items = $block->getItemCollection();
|
||||
|
||||
$showAddTo = true;
|
||||
$showCart = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
|
||||
$description = false;
|
||||
$canItemsAddToCart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'crosssell':
|
||||
/** @var \Magento\Catalog\Block\Product\ProductList\Crosssell $block */
|
||||
if ($exist = count($block->getItems())) {
|
||||
$type = 'crosssell';
|
||||
$class = $type;
|
||||
|
||||
$image = 'cart_cross_sell_products';
|
||||
$title = __('More Choices:');
|
||||
$items = $block->getItems();
|
||||
|
||||
$showAddTo = true;
|
||||
$showCart = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
|
||||
$description = false;
|
||||
$canItemsAddToCart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
if ($exist = $block->getProductCollection()) {
|
||||
$type = 'new';
|
||||
$mode = 'grid';
|
||||
$type = $type . ' ' . $mode;
|
||||
|
||||
$class = 'widget' . ' ' . $type;
|
||||
|
||||
$image = 'new_products_content_widget_grid';
|
||||
$title = __('New Products');
|
||||
$items = $exist;
|
||||
|
||||
$showAddTo = true;
|
||||
$showCart = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
|
||||
$description = ($mode == 'list') ? true : false;
|
||||
$canItemsAddToCart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$exist = null;
|
||||
}
|
||||
$_item = null;
|
||||
?>
|
||||
|
||||
<?php if ($exist):?>
|
||||
|
||||
<?php if ($type == 'related' || $type == 'upsell'):?>
|
||||
<?php if ($type == 'related'):?>
|
||||
<div class="block <?= $block->escapeHtmlAttr($class) ?>"
|
||||
data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}'
|
||||
data-limit="<?= $block->escapeHtmlAttr($limit) ?>"
|
||||
data-shuffle="<?= /* @noEscape */ $shuffle ?>"
|
||||
data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>" id="section-related-products">
|
||||
<?php else:?>
|
||||
<div class="block <?= $block->escapeHtmlAttr($class) ?>"
|
||||
data-mage-init='{"upsellProducts":{}}'
|
||||
data-limit="<?= $block->escapeHtmlAttr($limit) ?>"
|
||||
data-shuffle="<?= /* @noEscape */ $shuffle ?>"
|
||||
data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>">
|
||||
<?php endif; ?>
|
||||
<?php else:?>
|
||||
<div class="block <?= $block->escapeHtmlAttr($class) ?>">
|
||||
<?php endif; ?>
|
||||
<div class="block-title title">
|
||||
<strong id="block-<?= $block->escapeHtmlAttr($class) ?>-heading" role="heading"
|
||||
aria-level="2"><?= $block->escapeHtml($title) ?></strong>
|
||||
</div>
|
||||
<div class="block-content content" aria-labelledby="block-<?= $block->escapeHtmlAttr($class) ?>-heading">
|
||||
|
||||
<div class="swiper products wrapper grid products-grid products-<?= $block->escapeHtmlAttr($type) ?>">
|
||||
<ol class="products list items product-items swiper-wrapper">
|
||||
<?php foreach ($items as $_item):?>
|
||||
<?php $available = ''; ?>
|
||||
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?>
|
||||
<?php if (!$_item->getRequiredOptions()):?>
|
||||
<?php $available = 'related-available'; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($type == 'related' || $type == 'upsell'):?>
|
||||
<li class="item product product-item swiper-slide"
|
||||
id="product-item_<?= /* @noEscape */ $_item->getId() ?>"
|
||||
data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" >
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
'display:none;',
|
||||
'li#product-item_' . $_item->getId()
|
||||
) ?>
|
||||
<?php else:?>
|
||||
<li class="item product product-item swiper-slide">
|
||||
<?php endif; ?>
|
||||
<div class="product-item-info <?= /* @noEscape */ $available ?>">
|
||||
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
|
||||
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
|
||||
class="product photo product-item-photo">
|
||||
<?= $block->getImage($_item, $image)->toHtml() ?>
|
||||
</a>
|
||||
<div class="product details product-item-details">
|
||||
<strong class="product name product-item-name"><a
|
||||
class="product-item-link"
|
||||
title="<?= $block->escapeHtmlAttr($_item->getName()) ?>"
|
||||
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>">
|
||||
<?= $block->escapeHtml($_item->getName()) ?></a>
|
||||
</strong>
|
||||
<p class="short-description"><?= $block->escapeHtml($_item->getShortDescription()) ?></p>
|
||||
|
||||
<?php if ($templateType):?>
|
||||
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$block->isRedirectToCartEnabled() && $_item):?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-role=tocart-form], .form.map.checkout": {
|
||||
"catalogAddToCart": {
|
||||
"product_sku": "<?= $block->escapeJs($_item->getSku()) ?>"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery',
|
||||
'js/swiper-bundle.min'
|
||||
], function($, Swiper, modal){
|
||||
|
||||
// 产品详情页相关产品
|
||||
var relatedSwiper = new Swiper('.products.products-related', {
|
||||
slidesPerView: 1.5,
|
||||
slidesPerGroup: 1.5,
|
||||
spaceBetween: 20,
|
||||
navigation: {
|
||||
nextEl: '.products.products-related .swiper-button-next',
|
||||
prevEl: '.products.products-related .swiper-button-prev',
|
||||
},
|
||||
breakpoints: {
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
slidesPerGroup: 3,
|
||||
spaceBetween: 30,
|
||||
},
|
||||
1008: {
|
||||
slidesPerView: 4,
|
||||
slidesPerGroup: 4,
|
||||
spaceBetween: 30,
|
||||
}
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
});
|
||||
|
||||
// 产品详情页upsell产品
|
||||
var upsellSwiper = new Swiper('.products.products-upsell', {
|
||||
slidesPerView: 1.5,
|
||||
slidesPerGroup: 1.5,
|
||||
spaceBetween: 20,
|
||||
navigation: {
|
||||
nextEl: '.products.products-upsell .swiper-button-next',
|
||||
prevEl: '.products.products-upsell .swiper-button-prev',
|
||||
},
|
||||
breakpoints: {
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
slidesPerGroup: 3,
|
||||
spaceBetween: 30,
|
||||
},
|
||||
1008: {
|
||||
slidesPerView: 4,
|
||||
slidesPerGroup: 4,
|
||||
spaceBetween: 30,
|
||||
}
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list toolbar
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->getCollection()->getSize()) :?>
|
||||
<?php $widget = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonDecode($block->getWidgetOptionsJson());
|
||||
$widgetOptions = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($widget['productListToolbarForm']);
|
||||
?>
|
||||
<div class="toolbar toolbar-products" data-mage-init='{"productListToolbarForm":<?= /* @noEscape */ $widgetOptions ?>}'>
|
||||
<?php if ($block->getIsBottom()): ?>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?>
|
||||
<?php else: ?>
|
||||
<?php if ($block->isExpanded()): ?>
|
||||
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?>
|
||||
<?php endif ?>
|
||||
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?>
|
||||
<?php if ($block->isExpanded()): ?>
|
||||
<?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list toolbar
|
||||
*
|
||||
* @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
|
||||
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
|
||||
*/
|
||||
?>
|
||||
<p class="toolbar-amount" id="toolbar-amount">
|
||||
<?php if ($block->getLastPageNum() > 1):?>
|
||||
<?= $block->escapeHtml(
|
||||
__(
|
||||
'%1 Items',
|
||||
'<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getTotalNum()) . '</span>'
|
||||
),
|
||||
['span']
|
||||
) ?>
|
||||
<?php elseif ($block->getTotalNum() == 1):?>
|
||||
<?= $block->escapeHtml(
|
||||
__(
|
||||
'%1 Item',
|
||||
'<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getTotalNum()) . '</span>'
|
||||
),
|
||||
['span']
|
||||
) ?>
|
||||
<?php else:?>
|
||||
<?= $block->escapeHtml(
|
||||
__(
|
||||
'%1 Items',
|
||||
'<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getTotalNum()) . '</span>'
|
||||
),
|
||||
['span']
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list toolbar
|
||||
*
|
||||
* @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
|
||||
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
|
||||
*/
|
||||
?>
|
||||
<div class="field limiter">
|
||||
<label class="label" for="limiter">
|
||||
<span><?= $block->escapeHtml(__('Show')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<select id="limiter" data-role="limiter" class="limiter-options">
|
||||
<?php foreach ($block->getAvailableLimit() as $_key => $_limit):?>
|
||||
<option value="<?= $block->escapeHtmlAttr($_key) ?>"
|
||||
<?php if ($block->isLimitCurrent($_key)):?>
|
||||
selected="selected"
|
||||
<?php endif ?>>
|
||||
<?= $block->escapeHtml(
|
||||
is_numeric($_limit) ? $localeFormatter->formatNumber((int) $_limit) : $_limit
|
||||
) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<span class="limiter-text"><?= $block->escapeHtml(__('per page')) ?></span>
|
||||
</div>
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list toolbar
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
|
||||
*/
|
||||
?>
|
||||
<div class="toolbar-sorter sorter">
|
||||
<label class="sorter-label" for="sorter"><?= $block->escapeHtml(__('Sort By')) ?></label>
|
||||
<select id="sorter" data-role="sorter" class="sorter-options">
|
||||
<?php foreach ($block->getAvailableOrders() as $_key => $_order) :?>
|
||||
<option value="<?= $block->escapeHtmlAttr($_key) ?>"
|
||||
<?php if ($block->isOrderCurrent($_key)) :?>
|
||||
selected="selected"
|
||||
<?php endif; ?>
|
||||
>
|
||||
<?php if ($block->escapeHtmlAttr($_key) == 'position') :?>
|
||||
默认
|
||||
<?php else:?>
|
||||
<?= $block->escapeHtml(__($_order)) ?>
|
||||
<?php endif;?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php if ($block->getCurrentDirection() == 'desc') :?>
|
||||
<a title="<?= $block->escapeHtmlAttr(__('Set Ascending Direction')) ?>"
|
||||
href="#"
|
||||
class="action sorter-action sort-desc"
|
||||
data-role="direction-switcher"
|
||||
data-value="asc">
|
||||
<span><?= $block->escapeHtml(__('Set Ascending Direction')) ?></span>
|
||||
</a>
|
||||
<?php else :?>
|
||||
<a title="<?= $block->escapeHtmlAttr(__('Set Descending Direction')) ?>"
|
||||
href="#"
|
||||
class="action sorter-action sort-asc"
|
||||
data-role="direction-switcher"
|
||||
data-value="desc">
|
||||
<span><?= $block->escapeHtml(__('Set Descending Direction')) ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Product list toolbar
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->isEnabledViewSwitcher()) :?>
|
||||
<div class="modes">
|
||||
<?php $_modes = $block->getModes(); ?>
|
||||
<?php if ($_modes && count($_modes) > 1) :?>
|
||||
<strong class="modes-label" id="modes-label"><?= $block->escapeHtml(__('View as')) ?></strong>
|
||||
<?php foreach ($block->getModes() as $_code => $_label) :?>
|
||||
<?php if ($block->isModeActive($_code)) :?>
|
||||
<strong title="<?= $block->escapeHtmlAttr($_label) ?>"
|
||||
class="modes-mode active mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
|
||||
data-value="<?= $block->escapeHtmlAttr(strtolower($_code)) ?>">
|
||||
<span><?= $block->escapeHtml($_label) ?></span>
|
||||
</strong>
|
||||
<?php else :?>
|
||||
<a class="modes-mode mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($_label) ?>"
|
||||
href="#"
|
||||
data-role="mode-switcher"
|
||||
data-value="<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
|
||||
id="mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>"
|
||||
aria-labelledby="modes-label mode-<?= $block->escapeHtmlAttr(strtolower($_code)) ?>">
|
||||
<span><?= $block->escapeHtml($_label) ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php /** @var $block \Magento\Framework\Pricing\Render\Amount */ ?>
|
||||
|
||||
<span class="price-container <?= $block->escapeHtmlAttr($block->getAdjustmentCssClasses()) ?>"
|
||||
<?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
|
||||
<?php if ($block->getDisplayLabel()) :?>
|
||||
<span class="price-label"><?= $block->escapeHtml($block->getDisplayLabel()) ?></span>
|
||||
<?php endif; ?>
|
||||
<span <?php if ($block->getPriceId()) :?> id="<?= $block->escapeHtmlAttr($block->getPriceId()) ?>"<?php endif;?>
|
||||
<?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->escapeHtmlAttr($block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes()) . '"' : '' ?>
|
||||
data-price-amount="<?= $block->escapeHtmlAttr($block->getDisplayValue()) ?>"
|
||||
data-price-type="<?= $block->escapeHtmlAttr($block->getPriceType()) ?>"
|
||||
class="price-wrapper <?= $block->escapeHtmlAttr($block->getPriceWrapperCss()) ?>"
|
||||
><?= $block->escapeHtml($block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()), ['span']) ?></span>
|
||||
<?php if ($block->hasAdjustmentsHtml()) :?>
|
||||
<?= $block->getAdjustmentsHtml() ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($block->getSchema()) :?>
|
||||
<meta itemprop="price" content="<?= $block->escapeHtmlAttr($block->getDisplayValue()) ?>" />
|
||||
<meta itemprop="priceCurrency" content="<?= $block->escapeHtmlAttr($block->getDisplayCurrencyCode()) ?>" />
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
|
||||
$schema = ($block->getZone() == 'item_view') ? true : false;
|
||||
$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : '';
|
||||
/** @var \Magento\Catalog\Pricing\Price\ConfiguredPrice $configuredPrice */
|
||||
$configuredPrice = $block->getPrice();
|
||||
/** @var \Magento\Catalog\Pricing\Price\ConfiguredRegularPrice $configuredRegularPrice */
|
||||
$configuredRegularPrice = $block->getPriceType(
|
||||
\Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_REGULAR_PRICE_CODE
|
||||
);
|
||||
?>
|
||||
<?php if ($configuredPrice->getAmount()->getValue() < $configuredRegularPrice->getAmount()->getValue()) : ?>
|
||||
<p class="price-as-configured">
|
||||
<span class="special-price">
|
||||
<?= /* @noEscape */ $block->renderAmount(
|
||||
$configuredPrice->getAmount(),
|
||||
[
|
||||
'display_label' => $block->escapeHtml(__('Special Price')),
|
||||
'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)),
|
||||
'price_type' => 'finalPrice',
|
||||
'include_container' => true,
|
||||
'schema' => $schema,
|
||||
]
|
||||
); ?>
|
||||
</span>
|
||||
<span class="old-price">
|
||||
<?= /* @noEscape */ $block->renderAmount(
|
||||
$configuredRegularPrice->getAmount(),
|
||||
[
|
||||
'display_label' => $block->escapeHtml(__('Regular Price')),
|
||||
'price_id' => $block->escapeHtml($block->getPriceId('old-price-' . $idSuffix)),
|
||||
'price_type' => 'oldPrice',
|
||||
'include_container' => true,
|
||||
'skip_adjustments' => true,
|
||||
]
|
||||
); ?>
|
||||
</span>
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
$priceLabel = ($block->getPriceLabel() !== null)
|
||||
? $block->getPriceLabel()
|
||||
: '';
|
||||
?>
|
||||
<p class="price-as-configured">
|
||||
<?= /* @noEscape */ $block->renderAmount(
|
||||
$configuredPrice->getAmount(),
|
||||
[
|
||||
'display_label' => $block->escapeHtml($priceLabel),
|
||||
'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)),
|
||||
'price_type' => 'finalPrice',
|
||||
'include_container' => true,
|
||||
'schema' => $schema,
|
||||
]
|
||||
); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
|
||||
|
||||
/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
|
||||
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
|
||||
$priceModel = $block->getPriceType('regular_price');
|
||||
|
||||
/* @noEscape */ echo $block->renderAmount($priceModel->getAmount(), [
|
||||
'price_id' => $block->getPriceId('product-price-'),
|
||||
'include_container' => true
|
||||
]);
|
||||
?>
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 目前价格显示的需求是:产品详情页面要显示原价,购物车要折扣价(这个折扣是通过catalog price rule实现的)
|
||||
* 如果有新的用户组要显示价格,就需要在catalog price rule的Customer Groups把这个新用户组加进去
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
|
||||
|
||||
/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
|
||||
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
|
||||
$priceModel = $block->getPriceType('regular_price');
|
||||
|
||||
/** ex: \Magento\Catalog\Pricing\Price\FinalPrice */
|
||||
/** @var \Magento\Framework\Pricing\Price\PriceInterface $finalPriceModel */
|
||||
$finalPriceModel = $block->getPriceType('final_price');
|
||||
$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : '';
|
||||
$schema = ($block->getZone() == 'item_view') ? true : false;
|
||||
?>
|
||||
<?php if ($block->hasSpecialPrice()) :?>
|
||||
<span class="special-price">
|
||||
<?= /* @noEscape */ $block->renderAmount($finalPriceModel->getAmount(), [
|
||||
'display_label' => __('Special Price'),
|
||||
'price_id' => $block->getPriceId('product-price-' . $idSuffix),
|
||||
'price_type' => 'finalPrice',
|
||||
'include_container' => true,
|
||||
'schema' => $schema
|
||||
]); ?>
|
||||
</span>
|
||||
<span class="old-price">
|
||||
<?= /* @noEscape */ $block->renderAmount($priceModel->getAmount(), [
|
||||
'display_label' => __('Regular Price'),
|
||||
'price_id' => $block->getPriceId('old-price-' . $idSuffix),
|
||||
'price_type' => 'oldPrice',
|
||||
'include_container' => true,
|
||||
'skip_adjustments' => true
|
||||
]); ?>
|
||||
</span>
|
||||
<?php else :?>
|
||||
<?= /* @noEscape */ $block->renderAmount($finalPriceModel->getAmount(), [
|
||||
'price_id' => $block->getPriceId('product-price-' . $idSuffix),
|
||||
'price_type' => 'finalPrice',
|
||||
'include_container' => true,
|
||||
'schema' => $schema
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($block->showMinimalPrice()) :?>
|
||||
<?php if ($block->getUseLinkForAsLowAs()) :?>
|
||||
<a href="<?= $block->escapeUrl($block->getSaleableItem()->getProductUrl()) ?>" class="minimal-price-link">
|
||||
<?= /* @noEscape */ $block->renderAmountMinimal() ?>
|
||||
</a>
|
||||
<?php else :?>
|
||||
<span class="minimal-price-link">
|
||||
<?= /* @noEscape */ $block->renderAmountMinimal() ?>
|
||||
</span>
|
||||
<?php endif?>
|
||||
<?php endif; ?>
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
// phpcs:disable Generic.WhiteSpace.ScopeIndent
|
||||
|
||||
/** @var \Magento\Catalog\Pricing\Render\PriceBox $block */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
/** @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter*/
|
||||
/** @var \Magento\Catalog\Pricing\Price\TierPrice $tierPriceModel */
|
||||
$tierPriceModel = $block->getPrice();
|
||||
$tierPrices = $tierPriceModel->getTierPriceList();
|
||||
$msrpShowOnGesture = $block->getPriceType('msrp_price')->isShowPriceOnGesture();
|
||||
$product = $block->getSaleableItem();
|
||||
?>
|
||||
<?php if (count($tierPrices)): ?>
|
||||
<ul class="<?= $block->escapeHtmlAttr(($block->hasListClass() ? $block->getListClass(): 'prices-tier items')) ?>">
|
||||
<?php foreach ($tierPrices as $index => $price): ?>
|
||||
<li class="item">
|
||||
<?php
|
||||
$productId = $product->getId();
|
||||
$isSaleable = $product->isSaleable();
|
||||
$popupId = 'msrp-popup-' . $productId . $block->getRandomString(20);
|
||||
if ($msrpShowOnGesture && $price['price']->getValue() < $product->getMsrp()):
|
||||
$addToCartUrl = '';
|
||||
if ($isSaleable) {
|
||||
$addToCartUrl = $this->helper(\Magento\Checkout\Helper\Cart::class)
|
||||
->getAddUrl($product, ['qty' => $price['price_qty']]);
|
||||
}
|
||||
$tierPriceData = [
|
||||
'addToCartUrl' => $addToCartUrl,
|
||||
'name' => $product->getName(),
|
||||
'realPrice' => $block->renderAmount(
|
||||
$price['price'],
|
||||
[
|
||||
'price_id' => $index,
|
||||
'id_suffix' => '-' . $index,
|
||||
'include_container' => true
|
||||
]
|
||||
),
|
||||
'msrpPrice' => $block->renderAmount(
|
||||
$block->getPriceType('msrp_price')->getAmount(),
|
||||
[
|
||||
'price_id' => $index,
|
||||
'id_suffix' => '-' . $index,
|
||||
'include_container' => true
|
||||
]
|
||||
),
|
||||
];
|
||||
if ($block->getCanDisplayQty($product)) {
|
||||
$tierPriceData['qty'] = $price['price_qty'];
|
||||
}
|
||||
?>
|
||||
<?= $block->escapeHtml(__('Buy %1 for: ', $price['price_qty'])) ?>
|
||||
<a href="#"
|
||||
id="<?= $block->escapeHtmlAttr($popupId) ?>"
|
||||
data-tier-price="<?= $block->escapeHtml($block->jsonEncode($tierPriceData)) ?>">
|
||||
<?= $block->escapeHtml(__('Click for price')) ?>
|
||||
</a>
|
||||
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
|
||||
'onclick',
|
||||
'event.preventDefault()',
|
||||
'a#' . $block->escapeHtmlAttr($popupId)
|
||||
) ?>
|
||||
<?php else:
|
||||
$priceAmountBlock = $block->renderAmount(
|
||||
$price['price'],
|
||||
[
|
||||
'price_id' => $index,
|
||||
'id_suffix' => '-' . $index,
|
||||
'include_container' => true,
|
||||
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_OPTION
|
||||
]
|
||||
);
|
||||
?>
|
||||
<?= /* @noEscape */ ($block->getShowDetailedPrice() !== false)
|
||||
? __(
|
||||
'Buy %1 for %2 each and '.
|
||||
'<strong class="benefit">save<span class="percent tier-%3"> %4</span>%</strong>',
|
||||
$localeFormatter->formatNumber($price['price_qty']),
|
||||
$priceAmountBlock,
|
||||
$index,
|
||||
$localeFormatter->formatNumber(
|
||||
$block->formatPercent($tierPriceModel->getSavePercent($price['price']))
|
||||
)
|
||||
)
|
||||
: __('Buy %1 for %2 each', $price['price_qty'], $priceAmountBlock);
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php if ($msrpShowOnGesture):?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
".product-info-main": {
|
||||
"addToCart": {
|
||||
"origin": "tier",
|
||||
"addToCartButton": "#product_addtocart_form [type=submit]",
|
||||
"inputQty": "#qty",
|
||||
"attr": "[data-tier-price]",
|
||||
"productForm": "#product_addtocart_form",
|
||||
"productId": "<?= (int) $productId ?>",
|
||||
"productIdInput": "input[type=hidden][name=product]",
|
||||
"isSaleable": "<?= (bool) $isSaleable ?>"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php endif; ?>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View\Additional */
|
||||
?>
|
||||
<?php foreach ($block->getChildHtmlList() as $_html) :?>
|
||||
<?= /* @noEscape */ $_html ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
<?php
|
||||
$_product = \Magento\Framework\App\ObjectManager::getInstance()
|
||||
->get(\Magento\Framework\Registry::class)
|
||||
->registry('current_product');
|
||||
?>
|
||||
<?php if($_product->getData('legal_statement')):?>
|
||||
<div class="product-info-section product-details-bottom">
|
||||
<div class="content">
|
||||
<?= $_product->getData('legal_statement') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View*/
|
||||
?>
|
||||
<div class="product-addto-links" data-role="add-to-links">
|
||||
<?= $block->getChildHtml() ?>
|
||||
</div>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */
|
||||
?>
|
||||
|
||||
<?php $viewModel = $block->getData('addToCompareViewModel'); ?>
|
||||
<?php if ($viewModel->isAvailableForCompare($block->getProduct())) :?>
|
||||
<a href="#" data-post='<?= /* @noEscape */ $block->getPostDataParams() ?>'
|
||||
data-role="add-to-links"
|
||||
class="action tocompare"><span><?= $block->escapeHtml(__('Add to Compare')) ?></span></a>
|
||||
<?php endif; ?>
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Stemcell\Catalog\Block\Product\View */
|
||||
?>
|
||||
<?php
|
||||
|
||||
$_product = $block->getProduct();
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
|
||||
|
||||
$showEnquiry = $block->showEnquiry($_product);
|
||||
$enquiryLink = $block->getWenjuanxingEnquiryUrl();
|
||||
|
||||
?>
|
||||
<?php $buttonTitle = __('Add to Cart'); ?>
|
||||
<?php if ($_product->getTypeId()!=='virtual'):?>
|
||||
<?php if(!$customerSession->isLoggedIn()):?>
|
||||
<div class="box-tocart-wjx">
|
||||
<a class="action primary" id="product-enquiry-button"
|
||||
target="_blank"
|
||||
href="<?= $enquiryLink;?>?sojumpparm=<?= $_product->getSku() ?>"
|
||||
>
|
||||
<span>立即询价</span>
|
||||
</a>
|
||||
</div>
|
||||
<?php elseif($showEnquiry):?>
|
||||
<div class="box-tocart-wjx" <?php if ($block->isConfigurable($_product)): ?>style="display: none" <?php endif; ?> >
|
||||
<a class="action primary" id="product-enquiry-button"
|
||||
target="_blank"
|
||||
href="<?= $enquiryLink;?>?sojumpparm=<?= $_product->getSku() ?>"
|
||||
>
|
||||
<span>立即询价</span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if($block->notStockCheckGroup()): ?>
|
||||
<div class="box-tocart">
|
||||
<div class="fieldset">
|
||||
<?php if ($block->shouldRenderQuantity()) :?>
|
||||
<div class="field qty">
|
||||
<label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="number"
|
||||
name="qty"
|
||||
id="qty"
|
||||
min="0"
|
||||
value="<?= $block->getProductDefaultQty() * 1 ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
|
||||
class="input-text qty"
|
||||
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
|
||||
class="action primary tocart"
|
||||
id="product-addtocart-button" disabled>
|
||||
<span><?= $block->escapeHtml($buttonTitle) ?></span>
|
||||
</button>
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"Magento_Catalog/js/validate-product": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
$('#product-addtocart-button').click(function(){
|
||||
//$('#webinar-modal').modal('openModal');
|
||||
$('#product_addtocart_form').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Description
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
$_product = $block->getProduct();
|
||||
|
||||
if (!$_product instanceof \Magento\Catalog\Model\Product) {
|
||||
return;
|
||||
}
|
||||
|
||||
$_call = $block->getAtCall();
|
||||
$_code = $block->getAtCode();
|
||||
$_className = $block->getCssClass();
|
||||
$_attributeLabel = $block->getAtLabel();
|
||||
$_attributeType = $block->getAtType();
|
||||
$_attributeAddAttribute = $block->getAddAttribute();
|
||||
|
||||
$renderLabel = true;
|
||||
// if defined as 'none' in layout, do not render
|
||||
if ($_attributeLabel == 'none') {
|
||||
$renderLabel = false;
|
||||
}
|
||||
|
||||
if ($_attributeLabel && $_attributeLabel == 'default') {
|
||||
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
|
||||
}
|
||||
if ($_attributeType && $_attributeType == 'text') {
|
||||
$_attributeValue = ($_helper->productAttribute($_product, $_product->$_call(), $_code))
|
||||
? $_product->getAttributeText($_code)
|
||||
: '';
|
||||
} else {
|
||||
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
|
||||
}
|
||||
|
||||
$filterProvider = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Cms\Model\Template\FilterProvider::class);
|
||||
if ($desc = $_product->getDescription()) {
|
||||
$desc = htmlspecialchars_decode((string)$filterProvider->getPageFilter()->filter($desc));
|
||||
} else {
|
||||
$desc = '';
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if($_product->getTypeId()=='virtual'):?>
|
||||
<div class="virtual-product-description-wrapper">
|
||||
<div class="product-description-left">
|
||||
<div class="page-title-wrapper product">
|
||||
<h1 class="page-title">
|
||||
<?= /* @noEscape */ $_product->getName() ?>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<?php if($_product->getData('document_number')):?>
|
||||
<div class="product-header"></div>
|
||||
<div class="document-attributes">
|
||||
<ul>
|
||||
<li>Document # <?= $_product->getData('document_number') ?></li>
|
||||
<li>Version <?= $_product->getData('document_version') ?> </li>
|
||||
<li><?= $_product->getData('document_date') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="download-pdf">
|
||||
<a href="<?= $_product->getData('document_path') ?>" target="_blank">
|
||||
<span class="sc-button grey" id="download-button">下载 PDF</span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<!--虚拟产品视频显示-->
|
||||
<?php
|
||||
$videoCatIds = [2217,2220];
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$storeManager = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class);
|
||||
$mediaUrl = $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
|
||||
if(in_array($_product->getData('resource_type'), $videoCatIds)):
|
||||
$videoUrl = $mediaUrl . 'video/' . $_product->getData('video_youku') . '.mp4';
|
||||
?>
|
||||
<div class="video-player-box">
|
||||
<video id="video-player-aws" preload="auto" controls playsinline webkit-playsinline x5-playsinline>
|
||||
<source src="<?= $videoUrl ?>" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<!--虚拟产品description内容显示-->
|
||||
<div class="product attribute description virtual-description section">
|
||||
<?= /* @noEscape */ $desc ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$noPublishDateCatIds = [2223,2172,2244];
|
||||
if($_product->getData('new_publish_date') && !in_array($_product->getData('resource_type'), $noPublishDateCatIds)):
|
||||
?>
|
||||
<div class="publish-date">发布日期: <?= date('m/d/Y', strtotime($_product->getData('new_publish_date'))) ?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<div class="product-description-right">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif ($_attributeValue):?>
|
||||
<div class="product attribute <?= $block->escapeHtmlAttr($_className) ?>">
|
||||
<?php if ($renderLabel) :?>
|
||||
<strong class="type"><?= $block->escapeHtml($_attributeLabel) ?></strong>
|
||||
<?php endif; ?>
|
||||
<div class="value" <?= /* @noEscape */ $_attributeAddAttribute ?>><?= /* @noEscape */ $_attributeValue ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product additional attributes template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Attributes
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
$_product = $block->getProduct();
|
||||
?>
|
||||
<?php if ($_additional = $block->getAdditionalData()) :?>
|
||||
<div class="additional-attributes-wrapper table-wrapper">
|
||||
<table class="data table additional-attributes" id="product-attribute-specs-table">
|
||||
<caption class="table-caption"><?= $block->escapeHtml(__('More Information')) ?></caption>
|
||||
<tbody>
|
||||
<?php foreach ($_additional as $_data) :?>
|
||||
<tr>
|
||||
<th class="col label" scope="row"><?= $block->escapeHtml($_data['label']) ?></th>
|
||||
<td class="col data" data-th="<?= $block->escapeHtmlAttr($_data['label']) ?>"><?= /* @noEscape */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
/**
|
||||
* Product viewed counter template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Ui\ProductViewCounter
|
||||
*/
|
||||
?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"*": {
|
||||
"Magento_Catalog/js/product/view/provider": {
|
||||
"data": <?= /* @noEscape */ $block->getCurrentProductData() ?>
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product description template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Description
|
||||
*/
|
||||
?>
|
||||
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
|
||||
$block->getProduct(),
|
||||
$block->getProduct()->getDescription(),
|
||||
'description'
|
||||
) ?>
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Catalog\Block\Product\View\Details $block */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')):?>
|
||||
<div class="product info detailed">
|
||||
<?php $layout = $block->getLayout(); ?>
|
||||
<div class="product data items" data-mage-init='{"tabs":{"openedState":"active"}}'>
|
||||
<?php $hideTabContent = false; ?>
|
||||
<?php foreach ($detailedInfoGroup as $name):?>
|
||||
<?php
|
||||
$html = $layout->renderElement($name);
|
||||
if (!$html || !trim($html)) {
|
||||
continue;
|
||||
}
|
||||
$alias = $layout->getElementAlias($name);
|
||||
$label = $block->getChildData($alias, 'title');
|
||||
?>
|
||||
<div class="data item title <?= !$hideTabContent ? 'active' : ''?>"
|
||||
data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>">
|
||||
<a class="data switch"
|
||||
tabindex="-1"
|
||||
data-toggle="trigger"
|
||||
href="#<?= $block->escapeUrl($alias) ?>"
|
||||
id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title">
|
||||
<?= /* @noEscape */ $label ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="data item content"
|
||||
aria-labelledby="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title"
|
||||
id="<?= $block->escapeHtmlAttr($alias) ?>" data-role="content">
|
||||
<?= /* @noEscape */ $html ?>
|
||||
</div>
|
||||
<?= $hideTabContent
|
||||
? /* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
'display: none;',
|
||||
'#' . $block->escapeHtmlAttr($alias)
|
||||
)
|
||||
: '' ?>
|
||||
<?php $hideTabContent = true; ?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product view template
|
||||
*
|
||||
* @var $block \Stemcell\Catalog\Block\Product\View
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php $_helper = $this->helper(Magento\Catalog\Helper\Output::class); ?>
|
||||
<?php
|
||||
|
||||
$_product = $block->getProduct();
|
||||
if($_product->getTypeId() == 'configurable'){
|
||||
$_children = $_product->getTypeInstance()->getUsedProducts($_product);
|
||||
}
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
|
||||
?>
|
||||
|
||||
<div class="product-add-form">
|
||||
<?php if($_product->getTypeId()=='simple'):?>
|
||||
<div class="simple-product-sku">产品号: <?= $_product->getSku();?></div>
|
||||
<?php endif;?>
|
||||
<div class="config-product-skus" style="display:none">
|
||||
<?php if($_product->getTypeId() == 'configurable'):?>
|
||||
<?php
|
||||
foreach ($_children as $child):
|
||||
$childProduct = $objectManager->create('Magento\Catalog\Model\Product')->load($child->getId());
|
||||
// $qty = $StockState->getStockQty($child->getId(), $child->getStore()->getWebsiteId());
|
||||
$qty = $block->getStockFromSubItems($child);
|
||||
$enquiry = intval($child->getPrice() == 0) || !$block->isLoggedIn();
|
||||
?>
|
||||
<div class="feature-content<?php echo $child->getId()?>" data-stock="<?php echo $qty; ?>" data-enquiry="<?= $enquiry ?>">
|
||||
<?= $childProduct->getData('feature') ?>
|
||||
<div class="product-note-text"><?= $childProduct->getData('note') ?></div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<form data-product-sku="<?= $block->escapeHtml($_product->getSku()) ?>"
|
||||
action="<?= $block->escapeUrl($block->getSubmitUrl($_product)) ?>" method="post"
|
||||
id="product_addtocart_form"<?php if ($_product->getOptions()) :?> enctype="multipart/form-data"<?php endif; ?>>
|
||||
<input type="hidden" name="product" value="<?= (int)$_product->getId() ?>" />
|
||||
<input type="hidden" name="selected_configurable_option" value="" />
|
||||
<input type="hidden" name="related_product" id="related-products-field" value="" />
|
||||
<input type="hidden" name="item" value="<?= (int)$block->getRequest()->getParam('id') ?>" />
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<?= $block->getChildHtml('form_top') ?>
|
||||
<?php if (!$block->hasOptions()) :?>
|
||||
<?= $block->getChildHtml('product_info_form_content') ?>
|
||||
<?php else :?>
|
||||
<?php if ($_product->isSaleable() && $block->getOptionsContainer() == 'container1') :?>
|
||||
<?= $block->getChildChildHtml('options_container') ?>
|
||||
<?php endif;?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_product->isSaleable() && $block->hasOptions() && $block->getOptionsContainer() == 'container2') :?>
|
||||
<?= $block->getChildChildHtml('options_container') ?>
|
||||
<?php endif;?>
|
||||
<?= $block->getChildHtml('form_bottom') ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-role=priceBox][data-price-box=product-id-<?= $block->escapeHtml($_product->getId()) ?>]": {
|
||||
"priceBox": {
|
||||
"priceConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Product media data template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Gallery
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
$images = $block->getGalleryImages()->getItems();
|
||||
$mainImage = current(array_filter($images, function ($img) use ($block) {
|
||||
return $block->isMainImage($img);
|
||||
}));
|
||||
|
||||
if (!empty($images) && empty($mainImage)) {
|
||||
$mainImage = $block->getGalleryImages()->getFirstItem();
|
||||
}
|
||||
|
||||
$helper = $block->getData('imageHelper');
|
||||
$mainImageData = $mainImage ?
|
||||
$mainImage->getData('medium_image_url') :
|
||||
$helper->getDefaultPlaceholderUrl('image');
|
||||
$product = $block->getProduct();
|
||||
if($product->getTypeId()!=='virtual'):
|
||||
?>
|
||||
|
||||
<div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
|
||||
<img
|
||||
alt="main product photo"
|
||||
class="gallery-placeholder__image"
|
||||
src="<?= /* @noEscape */ $mainImageData ?>"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-gallery-role=gallery-placeholder]": {
|
||||
"mage/gallery/gallery": {
|
||||
"mixins":["magnifier/magnify"],
|
||||
"magnifierOpts": <?= /* @noEscape */ $block->getMagnifier() ?>,
|
||||
"data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>,
|
||||
"options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>,
|
||||
"fullscreen": <?= /* @noEscape */ $block->getGalleryOptions()->getFSOptionsJson() ?>,
|
||||
"breakpoints": <?= /* @noEscape */ $block->getBreakpoints() ?>
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif;?>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
?>
|
||||
<?php $_product = $block->getProduct() ?>
|
||||
<?php if ($block->canEmailToFriend()) :?>
|
||||
<a href="<?= $block->escapeUrl($this->helper(Magento\Catalog\Helper\Product::class)->getEmailToFriendUrl($_product)) ?>"
|
||||
class="action mailto friend"><span><?= $block->escapeHtml(__('Email')) ?></span></a>
|
||||
<?php endif; ?>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Directory\Block\Currency */
|
||||
?>
|
||||
<meta property="product:price:currency"
|
||||
content="<?= /* @noEscape */ $block->stripTags($block->getCurrentCurrencyCode()) ?>"/>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View */
|
||||
?>
|
||||
|
||||
<meta property="og:type" content="product" />
|
||||
<meta property="og:title"
|
||||
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
|
||||
<meta property="og:image"
|
||||
content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
|
||||
<meta property="og:description"
|
||||
content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
|
||||
<meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
|
||||
<?php if ($priceAmount = $block->getProduct()
|
||||
->getPriceInfo()
|
||||
->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)
|
||||
->getAmount()):?>
|
||||
<meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/>
|
||||
<?= $block->getChildHtml('meta.currency') ?>
|
||||
<?php endif;?>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/* @var $block \Magento\Catalog\Block\Product\View\Options */
|
||||
?>
|
||||
|
||||
<?php $_options = $block->decorateArray($block->getOptions()) ?>
|
||||
<?php $_productId = $block->getProduct()->getId() ?>
|
||||
<?php if (count($_options)) :?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"priceOptions": {
|
||||
"optionConfig": <?= /* @noEscape */ $block->getJsonConfig() ?>,
|
||||
"controlContainer": ".field",
|
||||
"priceHolderSelector": "[data-product-id='<?= $block->escapeHtml($_productId) ?>'][data-role=priceBox]"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php foreach ($_options as $_option) :?>
|
||||
<?= $block->getOptionHtml($_option) ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */ ?>
|
||||
<?php $_option = $block->getOption() ?>
|
||||
<?php $_optionId = $block->escapeHtmlAttr($_option->getId()) ?>
|
||||
<?php $class = ($_option->getIsRequire()) ? ' required' : ''; ?>
|
||||
<div class="field date<?= /* @noEscape */ $class ?>"
|
||||
data-mage-init='{"priceOptionDate":{"fromSelector":"#product_addtocart_form"}}'>
|
||||
<fieldset class="fieldset fieldset-product-options-inner<?= /* @noEscape */ $class ?>">
|
||||
<legend class="legend">
|
||||
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
|
||||
<?= /* @noEscape */ $block->getFormattedPrice() ?>
|
||||
</legend>
|
||||
<div class="control">
|
||||
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME
|
||||
|| $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE) :?>
|
||||
|
||||
<?= $block->getDateHtml() ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DATE_TIME
|
||||
|| $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_TIME) :?>
|
||||
<?= $block->getTimeHtml() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_option->getIsRequire()) :?>
|
||||
<input type="hidden"
|
||||
name="validate_datetime_<?= /* @noEscape */ $_optionId ?>"
|
||||
class="validate-datetime-<?= /* @noEscape */ $_optionId ?>"
|
||||
value=""
|
||||
data-validate="{'validate-required-datetime':<?= /* @noEscape */ $_optionId ?>}"/>
|
||||
<?php else :?>
|
||||
<input type="hidden"
|
||||
name="validate_datetime_<?= /* @noEscape */ $_optionId ?>"
|
||||
class="validate-datetime-<?= /* @noEscape */ $_optionId ?>"
|
||||
value=""
|
||||
data-validate="{'validate-optional-datetime':<?= /* @noEscape */ $_optionId ?>}"/>
|
||||
<?php endif; ?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"validation": {
|
||||
"ignore": ":hidden:not(input[name^='validate_datetime_'])"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php $_option = $block->getOption() ?>
|
||||
<div class="field">
|
||||
<label class="label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label>
|
||||
</div>
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/* @var $block \Magento\Catalog\Block\Product\View\Options\Type\File */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
<?php $_option = $block->getOption(); ?>
|
||||
<?php $_fileInfo = $block->getFileInfo(); ?>
|
||||
<?php $_fileExists = $_fileInfo->hasData(); ?>
|
||||
<?php $_fileName = 'options_' . $block->escapeHtmlAttr($_option->getId()) . '_file'; ?>
|
||||
<?php $_fieldNameAction = $_fileName . '_action'; ?>
|
||||
<?php $_fieldValueAction = $_fileExists ? 'save_old' : 'save_new'; ?>
|
||||
<?php $_fileNamed = $_fileName . '_name'; ?>
|
||||
<?php $class = ($_option->getIsRequire()) ? ' required' : ''; ?>
|
||||
|
||||
<div class="field file<?= /* @noEscape */ $class ?>">
|
||||
<label class="label" for="<?= /* @noEscape */ $_fileName ?>" id="<?= /* @noEscape */ $_fileName ?>-label">
|
||||
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
|
||||
<?= /* @noEscape */ $block->getFormattedPrice() ?>
|
||||
</label>
|
||||
<?php if ($_fileExists):?>
|
||||
<div class="control">
|
||||
<span class="<?= /* @noEscape */ $_fileNamed ?>"><?= $block->escapeHtml($_fileInfo->getTitle()) ?></span>
|
||||
<a href="#" class="label" id="change-<?= /* @noEscape */ $_fileName ?>" >
|
||||
<?= $block->escapeHtml(__('Change')) ?>
|
||||
</a>
|
||||
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
|
||||
'onclick',
|
||||
'event.preventDefault()',
|
||||
'a#change-' ./* @noEscape */ $_fileName
|
||||
) ?>
|
||||
<?php if (!$_option->getIsRequire()):?>
|
||||
<input type="checkbox" id="delete-<?= /* @noEscape */ $_fileName ?>" />
|
||||
<span class="label"><?= $block->escapeHtml(__('Delete')) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="control" id="input-box-<?= /* @noEscape */ $_fileName ?>"
|
||||
data-mage-init='{"priceOptionFile":{
|
||||
"fileName":"<?= /* @noEscape */ $_fileName ?>",
|
||||
"fileNamed":"<?= /* @noEscape */ $_fileNamed ?>",
|
||||
"fieldNameAction":"<?= /* @noEscape */ $_fieldNameAction ?>",
|
||||
"changeFileSelector":"#change-<?= /* @noEscape */ $_fileName ?>",
|
||||
"deleteFileSelector":"#delete-<?= /* @noEscape */ $_fileName ?>"}
|
||||
}'>
|
||||
<input type="file"
|
||||
name="<?= /* @noEscape */ $_fileName ?>"
|
||||
id="<?= /* @noEscape */ $_fileName ?>"
|
||||
class="product-custom-option<?= $_option->getIsRequire() ? ' required' : '' ?>"
|
||||
<?= $_fileExists ? 'disabled="disabled"' : '' ?> />
|
||||
<input type="hidden" class="product-custom-option" name="<?= /* @noEscape */ $_fieldNameAction ?>"
|
||||
value="<?= /* @noEscape */ $_fieldValueAction ?>" />
|
||||
<?php if ($_option->getFileExtension()):?>
|
||||
<p class="note">
|
||||
<?= $block->escapeHtml(__('Compatible file extensions to upload')) ?>:
|
||||
<strong><?= $block->escapeHtml($_option->getFileExtension()) ?></strong>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ($_option->getImageSizeX() > 0):?>
|
||||
<p class="note">
|
||||
<?= $block->escapeHtml(__('Maximum image width')) ?>: <strong><?= (int)$_option->getImageSizeX()
|
||||
?> <?= $block->escapeHtml(__('px.')) ?></strong>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ($_option->getImageSizeY() > 0):?>
|
||||
<p class="note">
|
||||
<?= $block->escapeHtml(__('Maximum image height')) ?>: <strong><?= (int)$_option->getImageSizeY()
|
||||
?> <?= $block->escapeHtml(__('px.')) ?></strong>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?= $_fileExists ?
|
||||
/* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
'display:none',
|
||||
'#input-box-' . /* @noEscape */ $_fileName
|
||||
) : '' ?>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Select */ ?>
|
||||
<?php
|
||||
$_option = $block->getOption();
|
||||
$class = ($_option->getIsRequire()) ? ' required' : '';
|
||||
?>
|
||||
<div class="field<?= /* @noEscape */ $class ?>">
|
||||
<label class="label" for="select_<?= $block->escapeHtmlAttr($_option->getId()) ?>">
|
||||
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<?= $block->getValuesHtml() ?>
|
||||
<?php if ($_option->getIsRequire()) :?>
|
||||
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO || $_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_CHECKBOX) :?>
|
||||
<span id="options-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></span>
|
||||
<?php endif; ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Text */ ?>
|
||||
<?php
|
||||
$_option = $block->getOption();
|
||||
$class = ($_option->getIsRequire()) ? ' required' : '';
|
||||
?>
|
||||
|
||||
<div class="field<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_AREA) {
|
||||
echo ' textarea';
|
||||
} ?><?= /* @noEscape */ $class ?>">
|
||||
<label class="label" for="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text">
|
||||
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
|
||||
<?= /* @noEscape */ $block->getFormattedPrice() ?>
|
||||
</label>
|
||||
|
||||
<div class="control">
|
||||
<?php if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_FIELD) :?>
|
||||
<?php $_textValidate = null;
|
||||
if ($_option->getIsRequire()) {
|
||||
$_textValidate['required'] = true;
|
||||
}
|
||||
if ($_option->getMaxCharacters()) {
|
||||
$_textValidate['maxlength'] = $_option->getMaxCharacters();
|
||||
}
|
||||
$_textValidate['validate-no-utf8mb4-characters'] = true;
|
||||
?>
|
||||
<input type="text"
|
||||
id="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text"
|
||||
class="input-text product-custom-option"
|
||||
<?php if (!empty($_textValidate)) {?>
|
||||
data-validate="<?= $block->escapeHtml(json_encode($_textValidate)) ?>"
|
||||
<?php } ?>
|
||||
name="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
|
||||
data-selector="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
|
||||
value="<?= $block->escapeHtml($block->getDefaultValue()) ?>"/>
|
||||
<?php elseif ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_AREA) :?>
|
||||
<?php $_textAreaValidate = null;
|
||||
if ($_option->getIsRequire()) {
|
||||
$_textAreaValidate['required'] = true;
|
||||
}
|
||||
if ($_option->getMaxCharacters()) {
|
||||
$_textAreaValidate['maxlength'] = $_option->getMaxCharacters();
|
||||
}
|
||||
$_textAreaValidate['validate-no-utf8mb4-characters'] = true;
|
||||
?>
|
||||
<textarea id="options_<?= $block->escapeHtmlAttr($_option->getId()) ?>_text"
|
||||
class="product-custom-option"
|
||||
<?php if (!empty($_textAreaValidate)) {?>
|
||||
data-validate="<?= $block->escapeHtml(json_encode($_textAreaValidate)) ?>"
|
||||
<?php } ?>
|
||||
name="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
|
||||
data-selector="options[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
|
||||
rows="5"
|
||||
cols="25"><?= $block->escapeHtml($block->getDefaultValue()) ?></textarea>
|
||||
<?php endif; ?>
|
||||
<?php if ($_option->getMaxCharacters()) :?>
|
||||
<p class="note note_<?= $block->escapeHtmlAttr($_option->getId()) ?>">
|
||||
<?= $block->escapeHtml(__('Maximum %1 characters', $_option->getMaxCharacters())) ?>
|
||||
<span class="character-counter no-display"></span>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ($_option->getMaxCharacters()) :?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-selector='options[<?= $block->escapeJs($_option->getId()) ?>]']": {
|
||||
"Magento_Catalog/js/product/remaining-characters": {
|
||||
"maxLength": "<?= (int)$_option->getMaxCharacters() ?>",
|
||||
"noteSelector": ".note_<?= $block->escapeJs($_option->getId()) ?>",
|
||||
"counterSelector": ".note_<?= $block->escapeJs($_option->getId()) ?> .character-counter"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block Magento\Catalog\Block\Product\View */
|
||||
?>
|
||||
<?php
|
||||
$required = '';
|
||||
if ($block->hasRequiredOptions()) {
|
||||
$required = ' data-hasrequired="' . $block->escapeHtmlAttr(__('* Required Fields')) . '"';
|
||||
}
|
||||
?>
|
||||
<div class="product-options-wrapper" id="product-options-wrapper"<?= /* @noEscape */ $required ?>>
|
||||
<div class="fieldset" tabindex="0">
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</div>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<div class="product-options-bottom">
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /** @var \Magento\Catalog\Block\Product\AbstractProduct $block */ ?>
|
||||
<?php $_product = $block->getProduct() ?>
|
||||
<?= $block->getProductPriceHtml(
|
||||
$_product,
|
||||
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
|
||||
\Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW,
|
||||
[
|
||||
'price_id_suffix' => '_clone'
|
||||
]
|
||||
) ?>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Description
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
$_product = $block->getProduct();
|
||||
?>
|
||||
|
||||
<div class="product-attribute-note"></div>
|
||||
<?php if($_product->getData('feature')):?>
|
||||
<div class="product-attribute-feature">
|
||||
<h4>产品号 #(选择产品)</h4>
|
||||
<div class="content">
|
||||
<?= $_product->getData('feature') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('advantages')):?>
|
||||
<div class="product-attribute-included">
|
||||
<div class="summary">
|
||||
<div class="show-summary open">
|
||||
<h4>产品优势</h4>
|
||||
</div>
|
||||
<div class="summary-detail" style="display: block;">
|
||||
<?= $_product->getData('advantages') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('included')):?>
|
||||
<div class="product-attribute-included">
|
||||
<div class="summary">
|
||||
<div class="show-summary <?php if(!$_product->getData('advantages')):?>open<?php endif;?>">
|
||||
<h4>产品组分包括</h4>
|
||||
</div>
|
||||
<div class="summary-detail" <?php if(!$_product->getData('advantages')):?>style="display: block;"<?php endif;?>>
|
||||
<?= $_product->getData('included') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Description
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
$_product = $block->getProduct();
|
||||
|
||||
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$imageHelper = $_objectManager->get('\Magento\Catalog\Helper\Image');
|
||||
$mainImageUrl = $imageHelper->init($_product, 'product_thumbnail_image')->setImageFile($_product->getFile())->resize(120, 120)->getUrl();
|
||||
?>
|
||||
|
||||
<?php if ($_product->getTypeId()!=='virtual'):?>
|
||||
<div class="product-details-tabs-wrapper">
|
||||
<div class="product-details-tabs">
|
||||
<div class="data-item data-item-active" data-id="section-product-description">
|
||||
<a href="#">总览</a>
|
||||
</div>
|
||||
<?php if($_product->getData('data_figures')):?>
|
||||
<div class="data-item" data-id="section-data-figures">
|
||||
<a href="#">实验数据</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('protocols_documentation')):?>
|
||||
<div class="data-item" data-id="section-protocols-documentation">
|
||||
<a href="#">产品说明书及文档</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('applications')):?>
|
||||
<div class="data-item" data-id="section-applications">
|
||||
<a href="#">应用领域</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('product_view_technical_resource') || $_product->getData('resources_publications')):?>
|
||||
<div class="data-item" data-id="section-resources-publications">
|
||||
<a href="#">相关材料与文献</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(count($_product->getRelatedProducts())>0):?>
|
||||
<div class="data-item" data-id="section-related-products">
|
||||
<a href="#">相关产品</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if($_product->getData('description')):?>
|
||||
<div class="product-info-section view-more-content" data-visible-height="250" id="section-product-description">
|
||||
<?php
|
||||
$protocolDocumentation = $_helper->productAttribute($_product, $_product->getData('description'), 'description');
|
||||
?>
|
||||
<?= $protocolDocumentation ?>
|
||||
<div class="view-more-wrapper"> <a class="view-more-button"> 查看更多 </a> <a class="view-less-button"> 显示更少 </a> </div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('data_figures')):?>
|
||||
<div class="product-info-section" id="section-data-figures">
|
||||
<?php
|
||||
$dataFigures = $_helper->productAttribute($_product, $_product->getData('data_figures'), 'data_figures');
|
||||
?>
|
||||
<?= $dataFigures ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('protocols_documentation')):?>
|
||||
<div class="product-info-section" id="section-protocols-documentation">
|
||||
<?php
|
||||
$protocolDocumentation = $_helper->productAttribute($_product, $_product->getData('protocols_documentation'), 'protocols_documentation');
|
||||
?>
|
||||
<?= $protocolDocumentation ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('applications')):?>
|
||||
<div class="product-info-section" id="section-applications">
|
||||
<?php
|
||||
$applications = $_helper->productAttribute($_product, $_product->getData('applications'), 'applications');
|
||||
?>
|
||||
<?= $applications ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<div class="product-info-section" id="section-resources-publications">
|
||||
<h2>相关材料与文献</h2>
|
||||
<?= $block->getChildHtml('product_view_technical_resource'); ?>
|
||||
|
||||
<?= $_helper->productAttribute($_product, $_product->getData('faq'), 'faq'); ?>
|
||||
<?= $block->getChildHtml('product_view_publication'); ?>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<div class="get-price-popup" id="modal-get-price-content" style="display:none">
|
||||
<?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('get-price-popup-form')->toHtml();?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery',
|
||||
'js/swiper-bundle.min',
|
||||
'Magento_Ui/js/modal/modal'
|
||||
], function($, Swiper, modal){
|
||||
|
||||
// 只有规格属性的时候默认选中第一个规格
|
||||
setTimeout(function(){
|
||||
var swatchLength = $('.product-options-wrapper .swatch-attribute').length;
|
||||
var attributeSize = $('.product-options-wrapper .swatch-attribute.size').length;
|
||||
if(swatchLength == 1 && attributeSize == 1){
|
||||
$('.product-options-wrapper .swatch-attribute .swatch-option').first().trigger('click');
|
||||
}
|
||||
},2000);
|
||||
|
||||
// include点击展开关闭
|
||||
$('.product-attribute-included .show-summary').click(function(){
|
||||
$(this).toggleClass('open');
|
||||
$(this).next().slideToggle();
|
||||
});
|
||||
// 产品详情页Products for Your Protocol
|
||||
var protocolSwiper = new Swiper('.under-product-description .swiper.products', {
|
||||
slidesPerView: 1.5,
|
||||
slidesPerGroup: 1.5,
|
||||
spaceBetween: 20,
|
||||
navigation: {
|
||||
nextEl: '.swiper.products .swiper-button-next',
|
||||
prevEl: '.swiper.products .swiper-button-prev',
|
||||
},
|
||||
breakpoints: {
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
slidesPerGroup: 3,
|
||||
spaceBetween: 30,
|
||||
},
|
||||
1008: {
|
||||
slidesPerView: 4,
|
||||
slidesPerGroup: 4,
|
||||
spaceBetween: 30,
|
||||
}
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
});
|
||||
|
||||
// 产品详情页所有文档列表滚动
|
||||
var noticeSwiper = new Swiper('.product-pdf-slider', {
|
||||
slidesPerView: 2,
|
||||
slidesPerGroup: 2,
|
||||
spaceBetween: 10,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
clickable: true
|
||||
},
|
||||
breakpoints: {
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
slidesPerGroup: 3,
|
||||
spaceBetween: 30,
|
||||
},
|
||||
1008: {
|
||||
slidesPerView: 4,
|
||||
slidesPerGroup: 4,
|
||||
spaceBetween: 30,
|
||||
}
|
||||
},
|
||||
watchOverflow: true,
|
||||
observer: true,
|
||||
observeParents: true
|
||||
});
|
||||
|
||||
//获取价格表单内容弹窗
|
||||
var options = {
|
||||
type: 'popup',
|
||||
responsive: true,
|
||||
innerScroll: true,
|
||||
modalClass: 'get-price-modal'
|
||||
};
|
||||
|
||||
modal(options, $('#modal-get-price-content'));
|
||||
$(".request-pricing").on('click',function(){
|
||||
$("#modal-get-price-content").modal("openModal");
|
||||
});
|
||||
|
||||
// 产品详情专为您的实验方案打造的产品描述链接点击
|
||||
$('.under-product-description .heading a').click(function(){
|
||||
const tabIdtoTop = $('#section-protocols-documentation').offset().top - 150;
|
||||
$('html, body').animate({
|
||||
scrollTop: tabIdtoTop
|
||||
}, 500);
|
||||
});
|
||||
// 产品详情tabs点击
|
||||
$('.product-details-tabs .data-item').click(function(){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
const tabId = $(this).attr('data-id');
|
||||
const tabIdtoTop = $('#'+tabId).offset().top - 150;
|
||||
$('html, body').animate({
|
||||
scrollTop: tabIdtoTop
|
||||
}, 500);
|
||||
});
|
||||
// 页面滚动到产品详情对应tab选中
|
||||
$(window).scroll(function () {
|
||||
let scrolledTop = $(document).scrollTop();
|
||||
const tab2toTop = $('#section-data-figures').html() ? $('#section-data-figures').offset().top - 152 : '';
|
||||
const tab3toTop = $('#section-protocols-documentation').html() ? $('#section-protocols-documentation').offset().top - 152 : '';
|
||||
const tab4toTop = $('#section-applications').html() ? $('#section-applications').offset().top - 152 : '';
|
||||
const tab5toTop = $('#section-resources-publications').html() ? $('#section-resources-publications').offset().top - 152 : '';
|
||||
const tab6toTop = $('#section-related-products').html() ? $('#section-related-products').offset().top - 152 : '';
|
||||
if(scrolledTop < tab2toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-product-description'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(scrolledTop >= tab2toTop && scrolledTop < tab3toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-data-figures'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(scrolledTop >= tab3toTop && scrolledTop < tab4toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-protocols-documentation'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(scrolledTop >= tab4toTop && scrolledTop < tab5toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-applications'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(tab6toTop && scrolledTop >= tab5toTop && scrolledTop < tab6toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-resources-publications'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(tab6toTop && scrolledTop >= tab6toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-related-products'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
} else if(!tab6toTop && scrolledTop >= tab5toTop){
|
||||
$('.product-details-tabs .data-item').each(function(){
|
||||
const tabId = $(this).attr('data-id');
|
||||
if(tabId == 'section-resources-publications'){
|
||||
$(this).addClass('data-item-active').siblings().removeClass('data-item-active');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 产品文献列表点击
|
||||
$('.publications-section .publications .publication').click(function(){
|
||||
$(this).toggleClass('show');
|
||||
});
|
||||
|
||||
// 查看更多展开
|
||||
$('.product-info-section .view-more-content').each(function(){
|
||||
setTimeout(() => {
|
||||
const contentHeight = parseInt($(this).height());
|
||||
const visibleHeight = parseInt($(this).attr('data-visible-height'));
|
||||
if(contentHeight > visibleHeight){
|
||||
$(this).children('.view-more-wrapper').removeClass('hidden');
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
$('.view-more-wrapper .view-more-button').click(function(){
|
||||
$(this).parent().addClass('view-less');
|
||||
$(this).hide();
|
||||
$(this).next().show();
|
||||
$(this).parents('.view-more-content').css({'overflow':'initial','max-height':'initial'})
|
||||
});
|
||||
// 查看更少
|
||||
$('.view-more-wrapper .view-less-button').click(function(){
|
||||
$(this).parent().removeClass('view-less');
|
||||
$(this).hide();
|
||||
$(this).prev().show();
|
||||
const visibleHeight = $(this).parents('.view-more-content').attr('data-visible-height');
|
||||
$(this).parents('.view-more-content').css({'overflow':'hidden','max-height': visibleHeight+'px'})
|
||||
});
|
||||
|
||||
// 智齿用户给客服发送商品卡片
|
||||
var cardData = {
|
||||
"cardId": "<?= $_product->getId();?>",
|
||||
"cardStyle": 1,
|
||||
"cardType": 1,
|
||||
"cardGuide": "推荐产品",
|
||||
"customCards": [
|
||||
{
|
||||
"customCardId": "<?= $_product->getSku();?>",
|
||||
"customCardName": "<?= $_product->getName();?>",
|
||||
"customCardThumbnail": "<?= $mainImageUrl;?>",
|
||||
"customCardAmount": "",
|
||||
"customCardAmountSymbol": "",
|
||||
"customCardLink": "<?= $_product->getProductUrl();?>",
|
||||
"customCardDesc": "<?= htmlspecialchars_decode((string)$_product->getShortDescription());?>",
|
||||
"customMenus": [{
|
||||
"menuType": 2,
|
||||
"menuName": "发送给客服"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
zc("config", {
|
||||
card_info: JSON.stringify(cardData),
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
/**
|
||||
* Product view template
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\View\Description
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
$_product = $block->getProduct();
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$imageHelper = $objectManager->get('\Magento\Catalog\Helper\Image');
|
||||
$protocolSkus = $_product->getData('products_for_your_protocol_sku');
|
||||
$protocolSkuArr = explode(',',$protocolSkus??'');
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php if($_product->getData('products_for_your_protocol')):?>
|
||||
<div class="under-product-description under-product-description-tips">
|
||||
<?php
|
||||
$productBottomTip = $_helper->productAttribute($_product, $_product->getData('products_for_your_protocol'), 'products_for_your_protocol');
|
||||
?>
|
||||
<?= $productBottomTip ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('products_for_your_protocol_sku')):?>
|
||||
<?php $protocolSkuArr = explode(',',$protocolSkus); ?>
|
||||
<div class="under-product-description">
|
||||
<div class="block widget required grid">
|
||||
<div class="block-title title">
|
||||
<strong id="block-widget required grid-heading" role="heading" aria-level="2"> 专为您的实验方案打造的产品 </strong>
|
||||
</div>
|
||||
<div class="heading">
|
||||
要查看实验方案所需的所有配套产品,请参阅<a class="titles-row-anchor" href="#section-protocols-and-documentation">《实验方案与技术文档》</a>。
|
||||
</div>
|
||||
<div class="swiper products wrapper grid products-grid">
|
||||
<ol class="products list items product-items swiper-wrapper">
|
||||
<?php
|
||||
foreach($protocolSkuArr as $protocolSku):
|
||||
$protocolProduct = $objectManager->create('Magento\Catalog\Model\Product')->loadByAttribute('sku',$protocolSku);
|
||||
$imageUrl = $imageHelper->init($protocolProduct, 'product_base_image')->setImageFile($protocolProduct->getFile())->resize(295, 227)->getUrl();
|
||||
?>
|
||||
<li class="item product product-item swiper-slide">
|
||||
<div class="product-item-info">
|
||||
<a href="<?= $protocolProduct->getProductUrl()?>" class="product photo product-item-photo">
|
||||
<span class="product-image-container">
|
||||
<img src="<?= $imageUrl;?>" loading="lazy" alt="<?= $protocolProduct->getName()?>">
|
||||
</span>
|
||||
</a>
|
||||
<div class="product details product-item-details">
|
||||
<strong class="product name product-item-name">
|
||||
<a class="product-item-link" title="<?= $protocolProduct->getName()?>" href="<?= $protocolProduct->getProductUrl()?>"><?= $protocolProduct->getName()?></a>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ol>
|
||||
<div class="swiper-button swiper-button-next">
|
||||
<div class="swiper-button-arrow"></div>
|
||||
</div>
|
||||
<div class="swiper-button swiper-button-prev">
|
||||
<div class="swiper-button-arrow"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($_product->getData('our_product_specialist_say')):?>
|
||||
<div class="our-product-specialist">
|
||||
<div class="scientist-quotes-section">
|
||||
<?php
|
||||
$productsSpecialist = $_helper->productAttribute($_product, $_product->getData('our_product_specialist_say'), 'our_product_specialist_say');
|
||||
?>
|
||||
<?= $productsSpecialist ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /** @var $block \Magento\Catalog\Block\Product\AbstractProduct */ ?>
|
||||
<?= $block->getReviewsSummaryHtml($block->getProduct(), false, true) ?>
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /* @var $block \Magento\Catalog\Block\Product\View\AbstractView */?>
|
||||
<?php
|
||||
|
||||
$_product = $block->getProduct();
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$productViewHelper = $objectManager->get('\Stemcell\Catalog\Helper\Product\View');
|
||||
$qty = $productViewHelper->getStockFromSubItems($_product);
|
||||
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
|
||||
?>
|
||||
|
||||
<?php if ($block->displayProductStockStatus() && $customerSession->isLoggedIn()) :?>
|
||||
<?php if ($_product->isAvailable()) :?>
|
||||
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
|
||||
<?php if($qty>=100):?>
|
||||
<span>库存:100+</span>
|
||||
<?php elseif($qty<100 && $qty>0):?>
|
||||
<span>库存:<?= $qty ?></span>
|
||||
<?php else:?>
|
||||
<span>库存:<?= $block->escapeHtml(__('期货')) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else :?>
|
||||
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
|
||||
<span>库存:<?= $block->escapeHtml(__('期货')) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp(
|
||||
[
|
||||
'widget_columns' => [
|
||||
'displayMode' => 'grid'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_compared_products_grid_content_widget'
|
||||
]
|
||||
]
|
||||
);
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp(
|
||||
[
|
||||
'widget_columns' => [
|
||||
'displayMode' => 'list'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_compared_products_list_content_widget'
|
||||
]
|
||||
]
|
||||
);
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp(
|
||||
[
|
||||
'listing' => [
|
||||
'displayMode' => 'grid'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_compared_products_images_names_widget'
|
||||
]
|
||||
]
|
||||
);
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<div class="widget block block-product-link">
|
||||
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
|
||||
</div>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<span class="widget block block-product-link-inline">
|
||||
<a <?= /* @noEscape */ $block->getLinkAttributes() ?>><span><?= $block->escapeHtml($block->getLabel()) ?></span></a>
|
||||
</span>
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
|
||||
?>
|
||||
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
|
||||
<div class="block widget block-new-products-list">
|
||||
<div class="block-title">
|
||||
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?php $suffix = $block->getNameInLayout(); ?>
|
||||
<ol class="product-items" id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>">
|
||||
<?php foreach ($_products->getItems() as $_product) :?>
|
||||
<li class="product-item">
|
||||
<div class="product-item-info">
|
||||
<a class="product-item-photo" href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
|
||||
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>">
|
||||
<?= $block->getImage($_product, 'side_column_widget_product_thumbnail')->toHtml() ?>
|
||||
</a>
|
||||
<div class="product-item-details">
|
||||
<strong class="product-item-name">
|
||||
<a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
|
||||
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>)"
|
||||
class="product-item-link">
|
||||
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute($_product, $_product->getName(), 'name') ?>
|
||||
</a>
|
||||
</strong>
|
||||
<?= $block->getProductPriceHtml($_product, '-widget-new-' . $suffix) ?>
|
||||
<div class="product-item-actions">
|
||||
<div class="actions-primary">
|
||||
<?php if ($_product->isSaleable()) :?>
|
||||
<?php if (!$_product->getTypeInstance()->isPossibleBuyFromList($_product)) :?>
|
||||
<button type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
|
||||
class="action tocart primary"
|
||||
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_product)) ?>"}}'>
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php else :?>
|
||||
<?php
|
||||
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
|
||||
$postData = $postDataHelper->getPostData($block->escapeUrl($block->getAddToCartUrl($_product)), ['product' => $_product->getEntityId()]);
|
||||
?>
|
||||
<button type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"
|
||||
class="action tocart primary"
|
||||
data-post='<?= /* @noEscape */ $postData ?>'>
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php else :?>
|
||||
<?php if ($_product->isAvailable()) :?>
|
||||
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
|
||||
<span><?= $block->escapeHtml(__('In stock')) ?></span>
|
||||
</div>
|
||||
<?php else :?>
|
||||
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
|
||||
<div class="block widget block-new-products-images">
|
||||
<div class="block-title">
|
||||
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?php $suffix = $block->getNameInLayout(); ?>
|
||||
<ol id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>"
|
||||
class="product-items product-items-images">
|
||||
<?php foreach ($_products->getItems() as $_product) :?>
|
||||
<li class="product-item">
|
||||
<a class="product-item-photo" href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
|
||||
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>">
|
||||
<?php /* new_products_images_only_widget */ ?>
|
||||
<?= $block->getImage($_product, 'new_products_images_only_widget')->toHtml() ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
?>
|
||||
<?php if (($_products = $block->getProductCollection()) && $_products->getSize()) :?>
|
||||
<div class="block widget block-new-products-names">
|
||||
<div class="block-title">
|
||||
<strong><?= $block->escapeHtml(__('New Products')) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?php $suffix = $block->getNameInLayout(); ?>
|
||||
<ol id="widget-new-products-<?= $block->escapeHtmlAttr($suffix) ?>"
|
||||
class="product-items product-items-names">
|
||||
<?php foreach ($_products->getItems() as $_product) :?>
|
||||
<li class="product-item">
|
||||
<strong class="product-item-name">
|
||||
<a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"
|
||||
title="<?= /* @noEscape */ $block->stripTags($_product->getName(), null, true) ?>)"
|
||||
class="product-item-link">
|
||||
<?= /* @noEscape */ $this->helper(
|
||||
Magento\Catalog\Helper\Output::class
|
||||
)->productAttribute($_product, $_product->getName(), 'name') ?>
|
||||
</a>
|
||||
</strong>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Template for displaying new products widget
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\Widget\NewWidget
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
|
||||
if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
|
||||
$type = 'widget-new-grid';
|
||||
|
||||
$mode = 'grid';
|
||||
|
||||
$image = 'new_products_content_widget_grid';
|
||||
$title = __('New Products');
|
||||
$items = $block->getProductCollection()->getItems();
|
||||
|
||||
$showWishlist = true;
|
||||
$showCompare = true;
|
||||
$showCart = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
|
||||
$description = false;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($exist) :?>
|
||||
<div class="block widget block-new-products <?= /* @noEscape */ $mode ?>">
|
||||
<div class="block-title">
|
||||
<strong role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
|
||||
<div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>">
|
||||
<ol class="product-items <?= /* @noEscape */ $type ?>">
|
||||
<?php foreach ($items as $_item) :?>
|
||||
<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>
|
||||
<?= $block->getProductPriceHtml($_item, $type); ?>
|
||||
|
||||
<?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()) :?>
|
||||
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)) :?>
|
||||
<button class="action tocart primary"
|
||||
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
|
||||
type="button"
|
||||
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php else :?>
|
||||
<?php
|
||||
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
|
||||
$postData = $postDataHelper->getPostData(
|
||||
$block->escapeUrl($block->getAddToCartUrl($_item)),
|
||||
['product' => (int) $_item->getEntityId()]
|
||||
)
|
||||
?>
|
||||
<button class="action tocart primary"
|
||||
data-post='<?= /* @noEscape */ $postData ?>'
|
||||
type="button"
|
||||
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php else :?>
|
||||
<?php if ($_item->isAvailable()) :?>
|
||||
<div class="stock available">
|
||||
<span><?= $block->escapeHtml(__('In stock')) ?></span>
|
||||
</div>
|
||||
<?php else :?>
|
||||
<div class="stock unavailable">
|
||||
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?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::class)->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::class);?>
|
||||
<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>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
|
||||
// phpcs:disable Magento2.Files.LineLength.MaxExceeded
|
||||
|
||||
/**
|
||||
* Template for displaying new products widget
|
||||
*
|
||||
* @var $block \Magento\Catalog\Block\Product\Widget\NewWidget
|
||||
*/
|
||||
if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
|
||||
$type = 'widget-new-list';
|
||||
|
||||
$mode = 'list';
|
||||
|
||||
$image = 'new_products_content_widget_list';
|
||||
$title = __('New Products');
|
||||
$items = $block->getProductCollection()->getItems();
|
||||
/** @var Magento\Catalog\Helper\Output $_helper */
|
||||
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
|
||||
|
||||
$showWishlist = true;
|
||||
$showCompare = true;
|
||||
$showCart = true;
|
||||
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
|
||||
$description = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($exist) :?>
|
||||
<div class="block widget block-new-products <?= /* @noEscape */ $mode ?>">
|
||||
<div class="block-title">
|
||||
<strong role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
|
||||
<div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>">
|
||||
<ol class="product-items <?= /* @noEscape */ $type ?>">
|
||||
<?php foreach ($items as $_item) :?>
|
||||
<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->escapeHtmlAttr($_item->getName()) ?>"
|
||||
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
|
||||
class="product-item-link">
|
||||
<?= $block->escapeHtml($_item->getName()) ?>
|
||||
</a>
|
||||
</strong>
|
||||
<?= $block->getProductPriceHtml($_item, $type) ?>
|
||||
|
||||
<?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()) :?>
|
||||
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)
|
||||
) :?>
|
||||
<button class="action tocart primary"
|
||||
data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
|
||||
type="button"
|
||||
title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php else :?>
|
||||
<?php
|
||||
$postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
|
||||
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
|
||||
?>
|
||||
<button class="action tocart primary"
|
||||
data-post='<?= /* @noEscape */ $postData ?>'
|
||||
type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php else :?>
|
||||
<?php if ($_item->isAvailable()) :?>
|
||||
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
|
||||
<?php else :?>
|
||||
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
|
||||
<?php endif; ?>
|
||||
<?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::class)->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::class); ?>
|
||||
<a href="#" class="action tocompare"
|
||||
title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>"
|
||||
data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>'
|
||||
>
|
||||
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($description) :?>
|
||||
<div class="product-item-description">
|
||||
<?= /* @noEscape */ $_helper->productAttribute(
|
||||
$_item,
|
||||
$_item->getShortDescription(),
|
||||
'short_description'
|
||||
) ?>
|
||||
<a title="<?= $block->escapeHtmlAttr($_item->getName()) ?>"
|
||||
href="<?= $block->escapeUrl($block->getProductUrl($_item))?>"
|
||||
class="action more"><?= $block->escapeHtml(__('Learn More')) ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp([
|
||||
'widget_columns' => [
|
||||
'displayMode' => 'grid'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_viewed_products_grid_content_widget'
|
||||
]
|
||||
]);
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.Security.LanguageConstruct.DirectOutput
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp([
|
||||
'widget_columns' => [
|
||||
'displayMode' => 'list'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_viewed_products_list_content_widget'
|
||||
]
|
||||
]);
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
|
||||
|
||||
/** @var $block \Magento\Ui\Block\Wrapper */
|
||||
?>
|
||||
|
||||
<?php /* @noEscape */ echo $block->renderApp(
|
||||
[
|
||||
'listing' => [
|
||||
'displayMode' => 'grid'
|
||||
],
|
||||
'image' => [
|
||||
'imageCode' => 'recently_viewed_products_images_names_widget'
|
||||
]
|
||||
]
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
+231
@@ -0,0 +1,231 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'mage/translate',
|
||||
'underscore',
|
||||
'Magento_Catalog/js/product/view/product-ids-resolver',
|
||||
'Magento_Catalog/js/product/view/product-info-resolver',
|
||||
'jquery-ui-modules/widget'
|
||||
], function ($, $t, _, idsResolver, productInfoResolver) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.catalogAddToCart', {
|
||||
options: {
|
||||
processStart: null,
|
||||
processStop: null,
|
||||
bindSubmit: true,
|
||||
minicartSelector: '[data-block="minicart"]',
|
||||
messagesSelector: '[data-placeholder="messages"]',
|
||||
productStatusSelector: '.stock.available',
|
||||
addToCartButtonSelector: '.action.tocart',
|
||||
addToCartButtonDisabledClass: 'disabled',
|
||||
addToCartButtonTextWhileAdding: '',
|
||||
addToCartButtonTextAdded: '',
|
||||
addToCartButtonTextDefault: '',
|
||||
productInfoResolver: productInfoResolver
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
_create: function () {
|
||||
if (this.options.bindSubmit) {
|
||||
this._bindSubmit();
|
||||
}
|
||||
$(this.options.addToCartButtonSelector).prop('disabled', false);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_bindSubmit: function () {
|
||||
var self = this;
|
||||
|
||||
if (this.element.data('catalog-addtocart-initialized')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.element.data('catalog-addtocart-initialized', 1);
|
||||
this.element.on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
self.submitForm($(this));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_redirect: function (url) {
|
||||
var urlParts, locationParts, forceReload;
|
||||
|
||||
urlParts = url.split('#');
|
||||
locationParts = window.location.href.split('#');
|
||||
forceReload = urlParts[0] === locationParts[0];
|
||||
|
||||
window.location.assign(url);
|
||||
|
||||
if (forceReload) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isLoaderEnabled: function () {
|
||||
return this.options.processStart && this.options.processStop;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for the form 'submit' event
|
||||
*
|
||||
* @param {jQuery} form
|
||||
*/
|
||||
submitForm: function (form) {
|
||||
this.ajaxSubmit(form);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {jQuery} form
|
||||
*/
|
||||
ajaxSubmit: function (form) {
|
||||
var self = this,
|
||||
productIds = idsResolver(form),
|
||||
productInfo = self.options.productInfoResolver(form),
|
||||
formData;
|
||||
|
||||
$(self.options.minicartSelector).trigger('contentLoading');
|
||||
self.disableAddToCartButton(form);
|
||||
formData = new FormData(form[0]);
|
||||
|
||||
$.ajax({
|
||||
url: form.prop('action'),
|
||||
data: formData,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
beforeSend: function () {
|
||||
if (self.isLoaderEnabled()) {
|
||||
$('body').trigger(self.options.processStart);
|
||||
}
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var eventData, parameters;
|
||||
|
||||
$(document).trigger('ajax:addToCart', {
|
||||
'sku': form.data().productSku,
|
||||
'productIds': productIds,
|
||||
'productInfo': productInfo,
|
||||
'form': form,
|
||||
'response': res
|
||||
});
|
||||
|
||||
if (self.isLoaderEnabled()) {
|
||||
$('body').trigger(self.options.processStop);
|
||||
}
|
||||
$('body').trigger('processStop');
|
||||
$('.loading-mask').hide();
|
||||
|
||||
if (res.backUrl) {
|
||||
eventData = {
|
||||
'form': form,
|
||||
'redirectParameters': []
|
||||
};
|
||||
// trigger global event, so other modules will be able add parameters to redirect url
|
||||
$('body').trigger('catalogCategoryAddToCartRedirect', eventData);
|
||||
|
||||
if (eventData.redirectParameters.length > 0 &&
|
||||
window.location.href.split(/[?#]/)[0] === res.backUrl
|
||||
) {
|
||||
parameters = res.backUrl.split('#');
|
||||
parameters.push(eventData.redirectParameters.join('&'));
|
||||
res.backUrl = parameters.join('#');
|
||||
}
|
||||
|
||||
self._redirect(res.backUrl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.messages) {
|
||||
$(self.options.messagesSelector).html(res.messages);
|
||||
}
|
||||
|
||||
if (res.minicart) {
|
||||
$(self.options.minicartSelector).replaceWith(res.minicart);
|
||||
$(self.options.minicartSelector).trigger('contentUpdated');
|
||||
}
|
||||
|
||||
if (res.product && res.product.statusText) {
|
||||
$(self.options.productStatusSelector)
|
||||
.removeClass('available')
|
||||
.addClass('unavailable')
|
||||
.find('span')
|
||||
.html(res.product.statusText);
|
||||
}
|
||||
self.enableAddToCartButton(form);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
$(document).trigger('ajax:addToCart:error', {
|
||||
'sku': form.data().productSku,
|
||||
'productIds': productIds,
|
||||
'productInfo': productInfo,
|
||||
'form': form,
|
||||
'response': res
|
||||
});
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
complete: function (res) {
|
||||
if (res.state() === 'rejected') {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} form
|
||||
*/
|
||||
disableAddToCartButton: function (form) {
|
||||
var addToCartButtonTextWhileAdding = this.options.addToCartButtonTextWhileAdding || $t('Adding...'),
|
||||
addToCartButton = $(form).find(this.options.addToCartButtonSelector);
|
||||
|
||||
addToCartButton.addClass(this.options.addToCartButtonDisabledClass);
|
||||
addToCartButton.find('span').text(addToCartButtonTextWhileAdding);
|
||||
addToCartButton.prop('title', addToCartButtonTextWhileAdding);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} form
|
||||
*/
|
||||
enableAddToCartButton: function (form) {
|
||||
var addToCartButtonTextAdded = this.options.addToCartButtonTextAdded || $t('Added'),
|
||||
self = this,
|
||||
addToCartButton = $(form).find(this.options.addToCartButtonSelector);
|
||||
|
||||
addToCartButton.find('span').text(addToCartButtonTextAdded);
|
||||
addToCartButton.prop('title', addToCartButtonTextAdded);
|
||||
|
||||
setTimeout(function () {
|
||||
var addToCartButtonTextDefault = self.options.addToCartButtonTextDefault || $t('Add to Cart');
|
||||
|
||||
addToCartButton.removeClass(self.options.addToCartButtonDisabledClass);
|
||||
addToCartButton.find('span').text(addToCartButtonTextDefault);
|
||||
addToCartButton.prop('title', addToCartButtonTextDefault);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.catalogAddToCart;
|
||||
});
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
define([
|
||||
'jquery',
|
||||
'mage/mage',
|
||||
'Magento_Catalog/product/view/validation',
|
||||
'catalogAddToCart'
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
$.widget('mage.productValidate', {
|
||||
options: {
|
||||
bindSubmit: false,
|
||||
radioCheckboxClosest: '.nested',
|
||||
addToCartButtonSelector: '.action.tocart'
|
||||
},
|
||||
|
||||
/**
|
||||
* 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 catalogAddToCart widget as submit handler.
|
||||
* @param {Object} form
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
submitHandler: function (form) {
|
||||
var jqForm = $(form).catalogAddToCart({
|
||||
bindSubmit: bindSubmit
|
||||
});
|
||||
|
||||
jqForm.catalogAddToCart('submitForm', jqForm);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(this.options.addToCartButtonSelector).attr('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
return $.mage.productValidate;
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
use Magento\CatalogSearch\Block\Result;
|
||||
|
||||
/** These changes need to valid applying filters and configuration before search process is started. */
|
||||
|
||||
/** @var $block Result*/
|
||||
$productList = $block->getProductListHtml();
|
||||
?>
|
||||
<?php if ($block->getResultCount()) : ?>
|
||||
<?= /* @noEscape */ $block->getChildHtml('tagged_product_list_rss_link') ?>
|
||||
<div class="search results">
|
||||
<?php if ($messages = $block->getNoteMessages()) : ?>
|
||||
<div class="message notice">
|
||||
<div>
|
||||
<?php foreach ($messages as $message) : ?>
|
||||
<?= /* @noEscape */ $message ?><br />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= /* @noEscape */ $productList ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
||||
<div class="message notice">
|
||||
<div>
|
||||
根据您输入的搜索关键词暂时无法检索出内容,请电话联系 <a href="tel:4008859050">400 885 9050</a> 或邮件联系 <a href="mailto:info.cn@stemcell.com">info.cn@stemcell.com</a>。
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
|
||||
// 搜索结果左侧无筛选栏右侧显示全
|
||||
const filterHtml = $('.sidebar #layered-filter-block').html();
|
||||
if(!filterHtml){
|
||||
$('.page-layout-2columns-left .column.main').addClass('no-left-filter');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\App\Action\Action;
|
||||
|
||||
/** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper
|
||||
?>
|
||||
<?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 = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
|
||||
$description = false;
|
||||
?>
|
||||
<div 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">
|
||||
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
|
||||
<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 layout-12">
|
||||
<div class="name-box">
|
||||
<a title="<?= $block->escapeHtml($_item->getName()) ?>"
|
||||
href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>"
|
||||
class="product-item-link">
|
||||
<?= $block->escapeHtml($_item->getName()) ?>
|
||||
</a>
|
||||
<div class="product-details">
|
||||
<?= $_item->getShortDescription() ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($templateType): ?>
|
||||
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?= ($iterator == count($items) + 1) ? '</li>' : '' ?>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($block->getBlockHtml('formkey')): ?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
".block.widget [data-role=tocart-form]": {
|
||||
"Magento_Catalog/js/validate-product": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="checkout_cart_item_renderers"/>
|
||||
<body>
|
||||
<referenceContainer name="page.messages">
|
||||
<block class="Magento\Checkout\Block\Cart\ValidationMessages" name="checkout.cart.validationmessages"/>
|
||||
</referenceContainer>
|
||||
<referenceContainer name="content">
|
||||
<block class="Magento\Checkout\Block\Cart" name="checkout.cart" template="Magento_Checkout::cart.phtml" cacheable="false">
|
||||
<container name="checkout.cart.items" as="with-items">
|
||||
<container name="checkout.cart.container" htmlTag="div" htmlClass="cart-container" before="-">
|
||||
<container name="checkout.cart.form.before" as="form_before" label="Shopping Cart Items Before" htmlTag="div" htmlClass="rewards"/>
|
||||
<container name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary" after="-">
|
||||
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Theme::text.phtml">
|
||||
<arguments>
|
||||
<argument translate="true" name="text" xsi:type="string">Summary</argument>
|
||||
<argument name="tag" xsi:type="string">strong</argument>
|
||||
<argument name="css_class" xsi:type="string">summary title</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<block class="Magento\Checkout\Block\Cart\Shipping" name="checkout.cart.shipping" as="shipping" template="Magento_Checkout::cart/shipping.phtml" after="checkout.cart.summary.title">
|
||||
<arguments>
|
||||
<argument name="jsLayout" xsi:type="array">
|
||||
<item name="types" xsi:type="array">
|
||||
<item name="form.input" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="provider" xsi:type="string">checkoutProvider</item>
|
||||
<item name="deps" xsi:type="array">
|
||||
<item name="0" xsi:type="string">checkoutProvider</item>
|
||||
</item>
|
||||
<item name="template" xsi:type="string">ui/form/field</item>
|
||||
<item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="components" xsi:type="array">
|
||||
<item name="summary-block-config" xsi:type="array">
|
||||
<item name="component" xsi:type="string">uiComponent</item>
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="shipping-rates-validation" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<!--Step configuration components-->
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="block-summary" xsi:type="array">
|
||||
<item name="component" xsi:type="string">uiComponent</item>
|
||||
<item name="deps" xsi:type="array">
|
||||
<item name="0" xsi:type="string">summary-block-config</item>
|
||||
</item>
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="block-rates" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/shipping-rates</item>
|
||||
<item name="sortOrder" xsi:type="string">2</item>
|
||||
</item>
|
||||
<item name="block-shipping" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/shipping-estimation</item>
|
||||
<item name="provider" xsi:type="string">checkoutProvider</item>
|
||||
<item name="sortOrder" xsi:type="string">1</item>
|
||||
<item name="deps" xsi:type="array">
|
||||
<item name="0" xsi:type="string">block-summary.block-shipping.address-fieldsets</item>
|
||||
</item>
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="address-fieldsets" xsi:type="array">
|
||||
<item name="component" xsi:type="string">uiComponent</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="deps" xsi:type="array">
|
||||
<item name="0" xsi:type="string">checkoutProvider</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="displayArea" xsi:type="string">address-fieldsets</item>
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="city" xsi:type="array">
|
||||
<item name="sortOrder" xsi:type="string">115</item>
|
||||
<item name="dataScope" xsi:type="string">shippingAddress.city</item>
|
||||
<item name="provider" xsi:type="string">checkoutProvider</item>
|
||||
</item>
|
||||
<item name="country_id" xsi:type="array">
|
||||
<item name="sortOrder" xsi:type="string">110</item>
|
||||
<item name="dataScope" xsi:type="string">shippingAddress.country_id</item>
|
||||
<item name="provider" xsi:type="string">checkoutProvider</item>
|
||||
</item>
|
||||
<item name="region_id" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Ui/js/form/element/region</item>
|
||||
<item name="sortOrder" xsi:type="string">112</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="template" xsi:type="string">ui/form/field</item>
|
||||
<item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
|
||||
<item name="customEntry" xsi:type="string">shippingAddress.region</item>
|
||||
</item>
|
||||
<!-- Value of region_id field is filtered by the value of county_id attribute -->
|
||||
<item name="filterBy" xsi:type="array">
|
||||
<item name="target" xsi:type="string"><![CDATA[${ $.provider }:${ $.parentScope }.country_id]]></item>
|
||||
<item name="field" xsi:type="string">country_id</item>
|
||||
</item>
|
||||
</item>
|
||||
<!-- The following items override configuration of corresponding address attributes -->
|
||||
<item name="region" xsi:type="array">
|
||||
<!-- Make region attribute invisible on frontend. Corresponding input element is created by region_id field -->
|
||||
<item name="visible" xsi:type="boolean">false</item>
|
||||
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
|
||||
<item name="sortOrder" xsi:type="string">111</item>
|
||||
<item name="dataScope" xsi:type="string">shippingAddress.region</item>
|
||||
</item>
|
||||
<item name="postcode" xsi:type="array">
|
||||
<!-- post-code field has custom UI component -->
|
||||
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
|
||||
<item name="dataScope" xsi:type="string">shippingAddress.postcode</item>
|
||||
<item name="sortOrder" xsi:type="string">114</item>
|
||||
<item name="provider" xsi:type="string">checkoutProvider</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="checkoutProvider" xsi:type="array">
|
||||
<item name="component" xsi:type="string">uiComponent</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
<container name="checkout.cart.totals.container" as="totals" label="Shopping Cart Totals">
|
||||
<block class="Magento\Checkout\Block\Cart\Totals" name="checkout.cart.totals" template="Magento_Checkout::cart/totals.phtml">
|
||||
<arguments>
|
||||
<argument name="jsLayout" xsi:type="array">
|
||||
<item name="components" xsi:type="array">
|
||||
<item name="block-totals" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/totals</item>
|
||||
<item name="displayArea" xsi:type="string">totals</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="template" xsi:type="string">Magento_Checkout/cart/totals</item>
|
||||
</item>
|
||||
<item name="children" xsi:type="array">
|
||||
<!-- sort order for this totals is configured on admin panel-->
|
||||
<!-- Stores->Configuration->SALES->Sales->General->Checkout Totals Sort Order -->
|
||||
<item name="subtotal" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/subtotal</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="title" xsi:type="string" translate="true">Subtotal</item>
|
||||
<item name="template" xsi:type="string">Magento_Checkout/cart/totals/subtotal</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="shipping" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/totals/shipping</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="title" xsi:type="string" translate="true">Shipping</item>
|
||||
<item name="template" xsi:type="string">Magento_Checkout/cart/totals/shipping</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="customer-discount" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/totals/customer-discount</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="title" xsi:type="string" translate="true">优惠金额</item>
|
||||
<item name="template" xsi:type="string">Magento_Checkout/cart/totals/customer-discount</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="grand-total" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="title" xsi:type="string" translate="true">Order Total</item>
|
||||
<item name="template" xsi:type="string">Magento_Checkout/cart/totals/grand-total</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</container>
|
||||
<block class="Magento\Checkout\Block\Cart" name="checkout.cart.methods.bottom" template="Magento_Checkout::cart/methods.phtml">
|
||||
<container name="checkout.cart.methods" as="methods" label="Payment Methods After Checkout Button">
|
||||
<block class="Magento\Checkout\Block\Onepage\Link" name="checkout.cart.methods.onepage.bottom" template="Magento_Checkout::onepage/link.phtml" />
|
||||
<block class="Magento\Checkout\Block\QuoteShortcutButtons" name="checkout.cart.shortcut.buttons" />
|
||||
</container>
|
||||
</block>
|
||||
</container>
|
||||
<block class="Stemcell\Checkout\Block\Cart\Grid" name="checkout.cart.form" as="cart-items" template="Magento_Checkout::cart/form.phtml" after="cart.summary">
|
||||
<arguments>
|
||||
<argument name="view_model" xsi:type="object">Magento\Checkout\ViewModel\Cart</argument>
|
||||
</arguments>
|
||||
<block class="Magento\Framework\View\Element\RendererList" name="checkout.cart.item.renderers" as="renderer.list"/>
|
||||
<block class="Magento\Framework\View\Element\Text\ListText" name="checkout.cart.order.actions"/>
|
||||
</block>
|
||||
<container name="checkout.cart.widget" as="checkout_cart_widget" label="Shopping Cart Items After" after="cart-items"/>
|
||||
</container>
|
||||
<block class="Magento\Checkout\Block\Cart\Crosssell" name="checkout.cart.crosssell" template="Magento_Catalog::product/list/items.phtml" after="-" ifconfig="checkout/cart/crosssell_enabled">
|
||||
<arguments>
|
||||
<argument name="type" xsi:type="string">crosssell</argument>
|
||||
<argument name="view_model" xsi:type="object">Magento\Catalog\ViewModel\Product\Listing\PreparePostData</argument>
|
||||
</arguments>
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="crosssell.product.addto" as="addto">
|
||||
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
|
||||
name="crosssell.product.addto.compare" as="compare"
|
||||
template="Magento_Catalog::product/list/addto/compare.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
</container>
|
||||
<container name="checkout.cart.noitems" as="no-items">
|
||||
<block class="Magento\Checkout\Block\Cart" name="checkout.cart.empty" before="-" template="Magento_Checkout::cart/noItems.phtml">
|
||||
<container name="checkout.cart.empty.widget" as="checkout_cart_empty_widget" label="Empty Shopping Cart Content Before"/>
|
||||
</block>
|
||||
</container>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
<block class="Magento\Checkout\Block\Cart\Additional\Info" name="additional.product.info" template="Magento_Checkout::cart/additional/info.phtml"/>
|
||||
</body>
|
||||
</page>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?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">
|
||||
<update handle="checkout_item_price_renderers"/>
|
||||
<body>
|
||||
<referenceBlock name="checkout.cart.item.renderers">
|
||||
<block class="Stemcell\Checkout\Block\Cart\Item\Renderer" name="checkout.cart.item.renderers.default" as="default" template="Magento_Checkout::cart/item/default.phtml">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.default.actions" as="actions">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.default.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
<block class="Stemcell\Checkout\Block\Cart\Item\Renderer" name="checkout.cart.item.renderers.simple" as="simple" template="Magento_Checkout::cart/item/default.phtml">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.simple.actions" as="actions">
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.simple.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
|
||||
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.simple.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
|
||||
</block>
|
||||
</block>
|
||||
</referenceBlock>
|
||||
</body>
|
||||
</page>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<title>Success Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<referenceBlock name="page.main.title">
|
||||
<action method="setPageTitle">
|
||||
<argument translate="true" name="title" xsi:type="string">Thank you for your purchase!</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
<referenceContainer name="content">
|
||||
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="Magento_Checkout::success.phtml" cacheable="false">
|
||||
<container name="order.success.additional.info" label="Order Success Additional Info"/>
|
||||
</block>
|
||||
<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="Magento_Checkout::registration.phtml" cacheable="false"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
|
||||
|
||||
<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
|
||||
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>"
|
||||
class="action print"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
<?= $block->escapeHtml(__('Print receipt')) ?>
|
||||
</a>
|
||||
<?= $block->getChildHtml() ?>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart template
|
||||
*
|
||||
* @var $block \Magento\Checkout\Block\Cart
|
||||
*/
|
||||
|
||||
if ($block->getItemsCount()) {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildHtml('with-items');
|
||||
} else {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildHtml('no-items');
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
$('#shopping-cart-table .cart.item').first().addClass('first-item');
|
||||
|
||||
// 购物车选择销售
|
||||
$('.xiaos_list').change(function(){
|
||||
if($(this).val()){
|
||||
$('.yi_list,.hidden-lab-id').val('');
|
||||
$(this).removeClass('has-error');
|
||||
$('.sale-error-tip').hide();
|
||||
var salespersonId = $(this).val();
|
||||
$.ajax({
|
||||
url: BASE_URL+'stemcell_checkout/cart/getLabsFromSalesperson',
|
||||
data: {salesperson_id: salespersonId},
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var labAccountHtml = '';
|
||||
if(res.labs && res.labs.length > 0){
|
||||
res.labs.forEach(item => {
|
||||
labAccountHtml += '<li data-lab="'+item.lab_id+'" data-lab-id="'+item.lab_code+'">'+item.booking_account+'</li>';
|
||||
});
|
||||
}
|
||||
$('.yi-list-select').html(labAccountHtml);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
console.log('error res', res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 购物车产品详细信息Lab选择点击
|
||||
$('.yi_list').click(function(){
|
||||
if($('.yi-list-select').html()){
|
||||
$(this).next().show();
|
||||
}
|
||||
});
|
||||
$('body').click(function (e) {
|
||||
var target = $(e.target);
|
||||
if(!target.is('.yi_list,.yi-list-select-box,.yi-list-select-search')){
|
||||
$('.yi-list-select-box').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 购物车产品详细信息Lab选择输入后过滤结果列表
|
||||
$('.yi-list-select-search').keyup(function(){
|
||||
const typeLab = $(this).val();
|
||||
$(this).next().children('li').each(function(){
|
||||
const labListText = $(this).text();
|
||||
if(labListText.indexOf(typeLab) != -1){
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", ".yi-list-select li", function() {
|
||||
const labText = $(this).text();
|
||||
const labId = $(this).attr('data-lab-id');
|
||||
//const salespersonId = $(this).attr('data-salesperson-id');
|
||||
const lab = $(this).attr('data-lab');
|
||||
//const salesperson = $(this).attr('data-salesperson');
|
||||
$(this).parents('div.yi-list-select-box').prev().val(labText);
|
||||
$(this).parents('div.yi-list-select-box').siblings('.hidden-lab-id').val(lab);
|
||||
//$(this).parent().siblings('.hidden-salesperson-id').val(salespersonId);
|
||||
$(this).parents('.details-section').siblings().children('.lab-id.input').val(labId);
|
||||
//$(this).parents('.details-section').siblings('.item-salesperson').children('.salesperson').html(salesperson);
|
||||
});
|
||||
|
||||
// 详细信息同上
|
||||
$('.details_same_btn').click(function(){
|
||||
const labInput = $(this).parents('.cart.item').prev().children().find('.yi_list').val();
|
||||
const labIdHiddenInput = $(this).parents('.cart.item').prev().children().find('.hidden-lab-id').val();
|
||||
const labIdInput = $(this).parents('.cart.item').prev().children().find('.lab-id').val();
|
||||
const cdInput = $(this).parents('.cart.item').prev().children().find('.cd-id').val();
|
||||
const qInput = $(this).parents('.cart.item').prev().children().find('.q-id').val();
|
||||
const personText = $(this).parents('.cart.item').prev().children().find('.salesperson').text();
|
||||
const useTypeRadio = $(this).parents('.cart.item').prev().children().find('.np:checked').val();
|
||||
const discountInput = $(this).parents('.cart.item').prev().children().find('.discount').val();
|
||||
const beizhuText = $(this).parents('.cart.item').prev().children().find('.beizhu').val();
|
||||
|
||||
$(this).parent().children().find('.yi_list').val(labInput);
|
||||
$(this).parent().children().find('.hidden-lab-id').val(labIdHiddenInput);
|
||||
$(this).parent().children().find('.salesperson').text(personText);
|
||||
$(this).parent().children().find('.lab-id').val(labIdInput);
|
||||
$(this).parent().children().find('.cd-id').val(cdInput);
|
||||
$(this).parent().children().find('.q-id').val(qInput);
|
||||
$(this).parent().children().find('.discount').val(discountInput);
|
||||
$(this).parent().children().find('input.np[value='+useTypeRadio+']').prop('checked', true);
|
||||
$(this).parent().children().find('.beizhu').val(beizhuText);
|
||||
});
|
||||
|
||||
// 修改数量更新购物车
|
||||
$('.cart.table-wrapper .col.qty .input-text').change(function(){
|
||||
$('.form.form-cart button.update').trigger('click');
|
||||
});
|
||||
// 修改折扣更新购物车
|
||||
$('.cart.table-wrapper .discount_off input').change(function(){
|
||||
if($(this).val()>0){
|
||||
$('.form.form-cart button.update').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
//订单备注
|
||||
$(document).on("change", "#customer_note", function() {
|
||||
var textareaContent = $(this).val();
|
||||
$('#cart-customer-note').val(textareaContent);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart additional info
|
||||
* @var $block \Magento\Framework\View\Element\Template
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
$name = $block->getNameInLayout();
|
||||
foreach ($block->getChildNames($name) as $childName) {
|
||||
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
|
||||
echo $block->getChildBlock($childName)->setItem($block->getItem())->toHtml();
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\View\Element\AbstractBlock $block
|
||||
*/
|
||||
|
||||
// We should use strlen function because coupon code could be "0", converted to bool will lead to false
|
||||
$hasCouponCode = $block->getCouponCode() !== null && strlen($block->getCouponCode()) > 0;
|
||||
?>
|
||||
<div class="block discount"
|
||||
id="block-discount"
|
||||
data-mage-init='{"collapsible":{"active": <?= $hasCouponCode ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}'>
|
||||
<div class="title" data-role="title">
|
||||
<strong id="block-discount-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Apply Discount Code')) ?></strong>
|
||||
</div>
|
||||
<div class="content" data-role="content" aria-labelledby="block-discount-heading">
|
||||
<form id="discount-coupon-form"
|
||||
action="<?= $block->escapeUrl($block->getUrl('checkout/cart/couponPost')) ?>"
|
||||
method="post"
|
||||
data-mage-init='{"discountCode":{"couponCodeSelector": "#coupon_code",
|
||||
"removeCouponSelector": "#remove-coupon",
|
||||
"applyButton": "button.action.apply",
|
||||
"cancelButton": "button.action.cancel"}}'>
|
||||
<div class="fieldset coupon<?= $hasCouponCode ? ' applied' : '' ?>">
|
||||
<input type="hidden" name="remove" id="remove-coupon" value="0" />
|
||||
<div class="field">
|
||||
<label for="coupon_code" class="label">
|
||||
<span><?= $block->escapeHtml(__('Enter discount code')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<input type="text"
|
||||
class="input-text"
|
||||
id="coupon_code"
|
||||
name="coupon_code"
|
||||
value="<?= $block->escapeHtmlAttr($block->getCouponCode()) ?>"
|
||||
placeholder="<?= $block->escapeHtmlAttr(__('Enter discount code')) ?>"
|
||||
<?php if ($hasCouponCode): ?>
|
||||
disabled="disabled"
|
||||
<?php endif; ?>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions-toolbar">
|
||||
<?php if (!$hasCouponCode): ?>
|
||||
<div class="primary">
|
||||
<button class="action apply primary" type="button"
|
||||
value="<?= $block->escapeHtmlAttr(__('Apply Discount')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Apply Discount')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="primary">
|
||||
<button type="button" class="action cancel primary"
|
||||
value="<?= $block->escapeHtmlAttr(__('Cancel Coupon')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Cancel Coupon')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$hasCouponCode): ?>
|
||||
<?= /* @noEscape */ $block->getChildHtml('captcha') ?>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Stemcell\Checkout\Block\Cart\Grid */
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
|
||||
if (!$customerSession->isLoggedIn()) {
|
||||
$url = $this->getUrl('customer/account/login');
|
||||
header("Location: $url");
|
||||
}
|
||||
|
||||
$quote = $block->getQuote();
|
||||
/* @var $formKey \Magento\Framework\Data\Form\FormKey */
|
||||
$formKey = $objectManager->get('Magento\Framework\Data\Form\FormKey');
|
||||
?>
|
||||
<?php $mergedCells = ($this->helper(Magento\Tax\Helper\Data::class)->displayCartBothPrices() ? 2 : 1); ?>
|
||||
<?= $block->getChildHtml('form_before') ?>
|
||||
<form action="<?= $block->escapeUrl($block->getUrl('stemcell_checkout/cart/updatePost')) ?>"
|
||||
method="post"
|
||||
id="form-validate"
|
||||
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
|
||||
{"validationURL" : "<?= $block->escapeUrl($block->getUrl('checkout/cart/updateItemQty')) ?>",
|
||||
"updateCartActionContainer": "#update_cart_action_container"}
|
||||
}'
|
||||
class="form form-cart">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<div class="cart table-wrapper<?= $mergedCells == 2 ? ' detailed' : '' ?>">
|
||||
|
||||
<!-- 销售人员选择 -->
|
||||
<div class="xiaos_list_box">
|
||||
<div class="salesperson-list">
|
||||
<b>*销售:</b>
|
||||
<select class="xiaos_list" name="cart[salesperson_id]">
|
||||
<option value="">请选择销售</option>
|
||||
<?php foreach ($block->getSalesperson() as $salesperson): ?>
|
||||
<?php /* @var $salesperson \Stemcell\Customer\Model\Salesperson */ ?>
|
||||
<option <?php if ($salesperson->getId()==$block->getQuoteData('salesperson_id')) echo 'selected' ?> value="<?= $salesperson->getId() ?>" >
|
||||
<?php echo $salesperson->getName() ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="sale-error-tip" style="display:none;">请选择销售</div>
|
||||
</div>
|
||||
<div class="empty_cart">
|
||||
<a href="<?= $block->getUrl('checkout/cart/updatePost').'?'. http_build_query(['update_cart_action'=>'empty_cart', 'form_key'=>$formKey->getFormKey()]) ?>">
|
||||
清空购物车
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 销售人员选择 -->
|
||||
|
||||
<textarea style="display:none;" id="cart-customer-note" name="cart[customer_note]"><?= $quote->getCustomerNote() ?></textarea>
|
||||
<table id="shopping-cart-table"
|
||||
class="cart items data table"
|
||||
data-mage-init='{"shoppingCart":{"emptyCartButton": ".action.clear",
|
||||
"updateCartActionContainer": "#update_cart_action_container"}}'>
|
||||
<caption class="table-caption"><?= $block->escapeHtml(__('Shopping Cart Items')) ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col item" scope="col"><span><?= $block->escapeHtml(__('Item')) ?></span></th>
|
||||
<th class="col price" scope="col"><span><?= $block->escapeHtml(__('经销商价格')) ?></span></th>
|
||||
<th class="col qty" scope="col"><span><?= $block->escapeHtml(__('Qty')) ?></span></th>
|
||||
<th class="col subtotal" scope="col"><span><?= $block->escapeHtml(__('总价')) ?></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach ($block->getItems() as $_item): ?>
|
||||
<?= $block->getItemHtml($_item) ?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php if ($block->getPagerHtml()): ?>
|
||||
<div class="cart-products-toolbar cart-products-toolbar-bottom toolbar"
|
||||
data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<div class="cart main actions" style="display: none">
|
||||
<?php if ($block->getContinueShoppingUrl()): ?>
|
||||
<a class="action continue"
|
||||
href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
|
||||
title="<?= $block->escapeHtml(__('Continue Shopping')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($block->getViewModel()->isClearShoppingCartEnabled()): ?>
|
||||
<button type="button"
|
||||
name="update_cart_action"
|
||||
data-cart-empty=""
|
||||
value="empty_cart"
|
||||
title="<?= $block->escapeHtml(__('Clear Shopping Cart')) ?>"
|
||||
class="action clear" id="empty_cart_button">
|
||||
<span><?= $block->escapeHtml(__('Clear Shopping Cart')) ?></span>
|
||||
</button>
|
||||
<?php endif ?>
|
||||
<button type="submit"
|
||||
name="update_cart_action"
|
||||
data-cart-item-update=""
|
||||
value="update_qty"
|
||||
title="<?= $block->escapeHtml(__('Update Shopping Cart')) ?>"
|
||||
class="action update">
|
||||
<span><?= $block->escapeHtml(__('Update Shopping Cart')) ?></span>
|
||||
</button>
|
||||
<input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
|
||||
</div>
|
||||
<input type="hidden" name="goCheckout" value="0" id="go_checkout_url"/>
|
||||
</form>
|
||||
<?= $block->getChildHtml('checkout.cart.order.actions') ?>
|
||||
<?= $block->getChildHtml('shopping.cart.table.after') ?>
|
||||
|
||||
<script>
|
||||
require([
|
||||
'jquery'
|
||||
], function($){
|
||||
// 购物车已经选中过默认选中销售
|
||||
if($('.xiaos_list').val()){
|
||||
var salespersonId = $('.xiaos_list').val();
|
||||
$.ajax({
|
||||
url: BASE_URL+'stemcell_checkout/cart/getLabsFromSalesperson',
|
||||
data: {salesperson_id: salespersonId},
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
|
||||
/** @inheritdoc */
|
||||
success: function (res) {
|
||||
var labAccountHtml = '';
|
||||
if(res.labs && res.labs.length > 0){
|
||||
res.labs.forEach(item => {
|
||||
labAccountHtml += '<li data-lab="'+item.lab_id+'" data-lab-id="'+item.lab_code+'">'+item.booking_account+'</li>';
|
||||
});
|
||||
}
|
||||
$('.yi-list-select').html(labAccountHtml);
|
||||
},
|
||||
|
||||
/** @inheritdoc */
|
||||
error: function (res) {
|
||||
console.log('error res', res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Catalog\Block\Product\View */
|
||||
?>
|
||||
<?php $_product = $block->getProduct(); ?>
|
||||
<?php $buttonTitle = __('Update Cart'); ?>
|
||||
<?php if ($_product->isSaleable()) :?>
|
||||
<div class="box-tocart update">
|
||||
<fieldset class="fieldset">
|
||||
<?php if ($block->shouldRenderQuantity()) :?>
|
||||
<div class="field qty">
|
||||
<label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="number"
|
||||
name="qty"
|
||||
id="qty"
|
||||
min="0"
|
||||
value=""
|
||||
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
|
||||
class="input-text qty"
|
||||
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<button type="submit"
|
||||
title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
|
||||
class="action primary tocart"
|
||||
id="product-updatecart-button">
|
||||
<span><?= $block->escapeHtml($buttonTitle) ?></span>
|
||||
</button>
|
||||
<?= $block->getChildHtml('', true) ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#product_addtocart_form": {
|
||||
"validation": {},
|
||||
"addToCart": {
|
||||
"cartButtonId": "#product-updatecart-button",
|
||||
"cartForm": "#product_addtocart_form"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
|
||||
/** @var $block \Stemcell\Checkout\Block\Cart\Item\Renderer | \Magento\Bundle\Block\Checkout\Cart\Item\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
$product = $_item->getProduct();
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$_product = $objectManager->create('Magento\Catalog\Model\Product')->load($product->getId());
|
||||
|
||||
$isVisibleProduct = $product->isVisibleInSiteVisibility();
|
||||
/** @var \Magento\Msrp\Helper\Data $helper */
|
||||
$helper = $this->helper(Magento\Msrp\Helper\Data::class);
|
||||
$canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinimalPriceLessMsrp($product);
|
||||
$labs = $block->getLabs();
|
||||
?>
|
||||
<tbody class="cart item">
|
||||
<tr class="item-info">
|
||||
<td data-th="<?= $block->escapeHtml(__('Item')) ?>" class="col item">
|
||||
<?php if ($block->hasProductUrl()): ?>
|
||||
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"
|
||||
title="<?= $block->escapeHtml($block->getProductName()) ?>"
|
||||
tabindex="-1"
|
||||
class="product-item-photo">
|
||||
<?php else: ?>
|
||||
<span class="product-item-photo">
|
||||
<?php endif; ?>
|
||||
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
|
||||
<?php if ($block->hasProductUrl()): ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<div class="product-item-details">
|
||||
<strong class="product-item-name">
|
||||
<?php if ($block->hasProductUrl()): ?>
|
||||
<a href="<?= $block->escapeUrl($block->getProductUrl()) ?>"><?= $block->escapeHtml($block->getProductName()) ?></a>
|
||||
<?php else: ?>
|
||||
<?= $block->escapeHtml($block->getProductName()) ?>
|
||||
<?php endif; ?>
|
||||
</strong>
|
||||
<dl class="item-options">
|
||||
<dt>产品号</dt>
|
||||
<dd><?= $product->getSku()?></dd>
|
||||
</dl>
|
||||
<?php if ($_options = $block->getOptionList()): ?>
|
||||
<?php if ($product->getTypeId()!='bundle'): ?>
|
||||
<dl class="item-options">
|
||||
<?php foreach ($_options as $_option): ?>
|
||||
|
||||
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
|
||||
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
|
||||
<dd>
|
||||
<?php if (isset($_formatedOptionValue['full_view'])): ?>
|
||||
<?= $block->escapeHtml($_formatedOptionValue['full_view'], ['span', 'a']) ?>
|
||||
<?php else: ?>
|
||||
<?= $block->escapeHtml($_formatedOptionValue['value']) ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
<?php else: ?>
|
||||
<div class="bundle-options">
|
||||
<div class="bundle-options-label"><b>包含:</b></div>
|
||||
<?php foreach ($_options as $_option): ?>
|
||||
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
|
||||
<?= $_formatedOptionValue['value'] ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($messages = $block->getMessages()): ?>
|
||||
<?php foreach ($messages as $message): ?>
|
||||
<div class= "cart item message <?= $block->escapeHtmlAttr($message['type']) ?>">
|
||||
<div><?= $block->escapeHtml($message['text']) ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php $addInfoBlock = $block->getProductAdditionalInformationBlock(); ?>
|
||||
<?php if ($addInfoBlock): ?>
|
||||
<?= $addInfoBlock->setItem($_item)->toHtml() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<?php if ($canApplyMsrp): ?>
|
||||
<td class="col msrp" data-th="<?= $block->escapeHtml(__('经销商价格')) ?>">
|
||||
<span class="pricing msrp">
|
||||
<span class="msrp notice"><?= $block->escapeHtml(__('See price before order confirmation.')) ?></span>
|
||||
<?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
|
||||
<a href="#" class="action help map"
|
||||
id="<?= ($block->escapeHtmlAttr($helpLinkId)) ?>"
|
||||
data-mage-init='{"addToCart":{
|
||||
"origin": "info",
|
||||
"helpLinkId": "#<?= $block->escapeJs($block->escapeHtml($helpLinkId)) ?>",
|
||||
"productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>",
|
||||
"showAddToCart": false
|
||||
}
|
||||
}'
|
||||
>
|
||||
<span><?= $block->escapeHtml(__("What's this?")) ?></span>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class="col price" data-th="<?= $block->escapeHtml(__('经销商价格')) ?>">
|
||||
<?= $block->getUnitPriceHtml($_item) ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">
|
||||
<div class="field qty">
|
||||
<div class="control qty">
|
||||
<label for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
|
||||
<span class="label"><?= $block->escapeHtml(__('Qty')) ?></span>
|
||||
<input id="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty"
|
||||
name="cart[<?= $block->escapeHtmlAttr($_item->getId()) ?>][qty]"
|
||||
data-cart-item-id="<?= $block->escapeHtmlAttr($_item->getSku()) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($block->getQty()) ?>"
|
||||
type="number"
|
||||
min="0"
|
||||
size="4"
|
||||
step="any"
|
||||
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
|
||||
class="input-text qty"
|
||||
data-validate="{required:true,'validate-greater-than-zero':true}"
|
||||
data-item-qty="<?= $block->escapeHtmlAttr($block->getQty()) ?>"
|
||||
data-role="cart-item-qty"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('总价')) ?>">
|
||||
<?php if ($canApplyMsrp): ?>
|
||||
<span class="cart msrp subtotal">--</span>
|
||||
<?php else: ?>
|
||||
<?= $block->getRowTotalHtml($_item) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item-details-info">
|
||||
<td colspan="4">
|
||||
<p><b>详细信息</b></p>
|
||||
<div class="title">
|
||||
<div class="details-section item-account">
|
||||
<p>账户*</p>
|
||||
<input class="yi_list in-se-0" readonly value="<?= $block->getLab()->getBookingAccount() ?>" placeholder="请选择订货账户" />
|
||||
<div class="yi-list-select-box" style="display: none;">
|
||||
<input class="yi-list-select-search" value="" placeholder="请输入关键词查找账户" />
|
||||
<ul class="yi-list-select cl-0"></ul>
|
||||
</div>
|
||||
<input type="hidden" class="hidden-lab-id" name="cart[<?= $_item->getId() ?>][extension_attributes][lab_id]" value="<?= $_item->getData('lab_id') ?>" />
|
||||
<input type="hidden" class="hidden-salesperson-id" name="cart[<?= $_item->getId() ?>][extension_attributes][salesperson_id]" value="<?= $_item->getData('salesperson_id') ?>" />
|
||||
<input type="hidden" class="hidden-lab-code" name="cart[<?= $_item->getId() ?>][extension_attributes][lab_code]" value="<?= $_item->getData('lab_code') ?>" />
|
||||
</div>
|
||||
<div class="details-section item-salesperson">
|
||||
<p>销售</p>
|
||||
<p class="salesperson" style="border: 1px solid #d1d1d1; padding: 5px; height: 20px; color: rgb(0, 0, 0)"><?= $block->getLab()->getData('salesperson') ?></p>
|
||||
</div>
|
||||
<div class="details-section item-sap-id">
|
||||
<p>SAP ID</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][pi_sap_id]" placeholder="SAP ID" class="lab-id input" value="<?= $_item->getData('pi_sap_id') ?>">
|
||||
</div>
|
||||
<div class="details-section">
|
||||
<p>CD码</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][cd]" placeholder="CD-12345" class="cd-id input" value="<?= $_item->getData('cd') ?>" >
|
||||
</div>
|
||||
<div class="details-section">
|
||||
<p>Quote码</p>
|
||||
<input name="cart[<?= $_item->getId() ?>][extension_attributes][quote]" placeholder="Q-12345" class="q-id input" value="<?= $_item->getData('quote') ?>" >
|
||||
</div>
|
||||
<div class="details-section discount_off">
|
||||
<p>折扣</p>
|
||||
<input pattern="^\d*(\.\d{0,2})?$" inputmode="decimal" name="cart[<?= $_item->getId() ?>][customer_discount_percent]" placeholder="1-100" class="discount" value="<?= number_format($_item->getCustomerDiscountPercent(), 2) ?>" > %
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-error-tip" style="display:none;">带*为必填字段,请填写完整后下单</div>
|
||||
<div class="titlel">
|
||||
<p class="useType">
|
||||
<span>终端类型: </span>
|
||||
<label><input type="radio" <?php if ($_item->getData('user_type')==0) echo 'checked' ?> name="cart[<?= $_item->getId() ?>][extension_attributes][user_type]" value="0" class="np">终端</label>
|
||||
<label><input type="radio" <?php if ($_item->getData('user_type')==1) echo 'checked' ?> name="cart[<?= $_item->getId() ?>][extension_attributes][user_type]" value="1" class="np">二级经销商</label>
|
||||
</p>
|
||||
</div>
|
||||
<p><b>备注</b></p>
|
||||
<div class="remark">
|
||||
<textarea name="cart[<?= $_item->getId() ?>][extension_attributes][note]" class="beizhu" placeholder="请填写备注信息"><?= $_item->getData('note') ?></textarea>
|
||||
</div>
|
||||
<button type="button" class="details_same_btn">详细信息同上</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item-actions">
|
||||
<td colspan="4">
|
||||
<div class="actions-toolbar">
|
||||
<?= /* @noEscape */ $block->getActions($_item) ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Item\Price\Renderer */
|
||||
?>
|
||||
<?php $_item = $block->getItem() ?>
|
||||
<div class="price-container">
|
||||
<span class="price-label"><?= $block->escapeHtml(__('Price')) ?></span>
|
||||
<span class="price-wrapper">
|
||||
<?= $block->escapeHtml(
|
||||
$this->helper(Magento\Checkout\Helper\Data::class)->formatPrice($_item->getCalculationPrice()),
|
||||
['span']
|
||||
) ?>
|
||||
</span>
|
||||
</div>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit */
|
||||
?>
|
||||
<?php if ($block->isProductVisibleInSiteVisibility()) :?>
|
||||
<a class="action action-edit"
|
||||
href="<?= $block->escapeUrl($block->getConfigureUrl()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Edit item parameters')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Edit')) ?></span>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove */
|
||||
?>
|
||||
<a href="#"
|
||||
title="<?= $block->escapeHtml(__('Remove item')) ?>"
|
||||
class="action action-delete"
|
||||
data-post='<?= /* @noEscape */ $block->getDeletePostJson() ?>'>
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('Remove item')) ?>
|
||||
</span>
|
||||
</a>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
/** @var $block \Magento\Checkout\Block\Cart */
|
||||
?>
|
||||
<?php if (!$block->hasError()) :?>
|
||||
<?php $methods = $block->getMethods('methods') ?: $block->getMethods('top_methods') ?>
|
||||
<ul class="checkout methods items checkout-methods-items">
|
||||
<?php foreach ($methods as $method) :?>
|
||||
<?php $methodHtml = $block->getMethodHtml($method); ?>
|
||||
<?php if (trim($methodHtml) !== '') :?>
|
||||
<li class="item"><?= /* @noEscape */ $methodHtml ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart\Sidebar */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
|
||||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
|
||||
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
|
||||
?>
|
||||
|
||||
<?php if($customerSession->isLoggedIn()):?>
|
||||
<div data-block="minicart" class="minicart-wrapper">
|
||||
<a class="action showcart" href="<?= $block->escapeUrl($block->getShoppingCartUrl()) ?>"
|
||||
data-bind="scope: 'minicart_content'">
|
||||
<span class="text"><?= $block->escapeHtml(__('My Cart')) ?></span>
|
||||
<span class="counter qty empty"
|
||||
data-bind="css: { empty: !!getCartParam('summary_count') == false && !isLoading() },
|
||||
blockLoader: isLoading">
|
||||
<span class="counter-number">
|
||||
<!-- ko if: getCartParam('summary_count') -->
|
||||
<!-- ko text: getCartParam('summary_count').toLocaleString(window.LOCALE) --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
<!-- ko ifnot: getCartParam('summary_count') -->
|
||||
<!-- ko text: 0 --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</span>
|
||||
<span class="counter-label">
|
||||
<!-- ko if: getCartParam('summary_count') -->
|
||||
<!-- ko text: getCartParam('summary_count').toLocaleString(window.LOCALE) --><!-- /ko -->
|
||||
<!-- ko i18n: 'items' --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<?php if ($block->getIsNeedToDisplaySideBar()):?>
|
||||
<div class="block block-minicart"
|
||||
data-role="dropdownDialog"
|
||||
data-mage-init='{"dropdownDialog":{
|
||||
"appendTo":"[data-block=minicart]",
|
||||
"triggerTarget":".showcart",
|
||||
"timeout": "2000",
|
||||
"closeOnMouseLeave": false,
|
||||
"closeOnEscape": true,
|
||||
"triggerClass":"active",
|
||||
"parentClass":"active",
|
||||
"buttons":[]}}'>
|
||||
<div id="minicart-content-wrapper" data-bind="scope: 'minicart_content'">
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
</div>
|
||||
<?= $block->getChildHtml('minicart.addons') ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php $scriptString = <<<script
|
||||
require(['jquery'], function ($) {
|
||||
$('a.action.showcart').on('click', function() {
|
||||
$(document.body).trigger('processStart');
|
||||
});
|
||||
});
|
||||
script;
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
|
||||
<?php endif ?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], 'window.checkout = ' .
|
||||
/* @noEscape */ $block->getSerializedConfig(), false); ?>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-block='minicart']": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
},
|
||||
"*": {
|
||||
"Magento_Ui/js/block-loader": "<?= $block->escapeJs(
|
||||
$block->escapeUrl($block->getViewFileUrl('images/loader-1.gif'))
|
||||
) ?>"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Cart */
|
||||
?>
|
||||
<div class="cart-empty">
|
||||
<?= $block->getChildHtml('checkout_cart_empty_widget') ?>
|
||||
<p><?= $block->escapeHtml(__('You have no items in your shopping cart.')) ?></p>
|
||||
<p><?= $block->escapeHtml(
|
||||
__(
|
||||
'Click <a href="%1">here</a> to continue shopping.',
|
||||
$block->escapeUrl($block->getContinueShoppingUrl())
|
||||
),
|
||||
['a']
|
||||
) ?>
|
||||
</p>
|
||||
<?= $block->getChildHtml('shopping.cart.table.after') ?>
|
||||
</div>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"*": {
|
||||
"Magento_Checkout/js/empty-cart": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php /** @var $block \Magento\Checkout\Block\Cart\Shipping */ ?>
|
||||
<?php /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?>
|
||||
<div id="block-shipping"
|
||||
class="block shipping"
|
||||
data-mage-init='{"collapsible":{"openedState": "active", "saveState": true}}'
|
||||
>
|
||||
<div class="title" data-role="title">
|
||||
<strong id="block-shipping-heading" role="heading" aria-level="2">
|
||||
<?= $block->getQuote()->isVirtual()
|
||||
? $block->escapeHtml(__('Estimate Tax'))
|
||||
: $block->escapeHtml(__('Estimate Shipping and Tax'))
|
||||
?>
|
||||
</strong>
|
||||
</div>
|
||||
<div id="block-summary"
|
||||
data-bind="scope:'block-summary'"
|
||||
class="content"
|
||||
data-role="content"
|
||||
aria-labelledby="block-shipping-heading"
|
||||
>
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#block-summary": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php $serializedCheckoutConfig = /* @noEscape */ $block->getSerializedCheckoutConfig();
|
||||
|
||||
$scriptString = <<<script
|
||||
|
||||
window.checkoutConfig = {$serializedCheckoutConfig};
|
||||
window.customerData = window.checkoutConfig.customerData;
|
||||
window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
|
||||
require([
|
||||
'mage/url',
|
||||
'Magento_Ui/js/block-loader'
|
||||
], function(url, blockLoader) {
|
||||
blockLoader(
|
||||
"{$block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')))}"
|
||||
);
|
||||
return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}');
|
||||
})
|
||||
script;
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Shopping cart totals template
|
||||
* @var $block \Magento\Checkout\Block\Cart\Totals
|
||||
*/
|
||||
$quote = $block->getQuote();
|
||||
?>
|
||||
<div id="cart-totals" class="cart-totals" data-bind="scope:'block-totals'">
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#cart-totals": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<textarea placeholder="订单备注" id="customer_note"><?= $quote->getCustomerNote() ?></textarea>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Onepage */
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
?>
|
||||
|
||||
<div id="checkout" data-bind="scope:'checkout'" class="checkout-container payment-step-show">
|
||||
<div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>
|
||||
<div class="loader">
|
||||
<img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>"
|
||||
alt="<?= $block->escapeHtmlAttr(__('Loading...')) ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("position: absolute;", "#checkout-loader img") ?>
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"#checkout": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php $serializedCheckoutConfig = /* @noEscape */ $block->getSerializedCheckoutConfig();
|
||||
$scriptString = <<<script
|
||||
window.checkoutConfig = {$serializedCheckoutConfig};
|
||||
// Create aliases for customer.js model from customer module
|
||||
window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
|
||||
window.customerData = window.checkoutConfig.customerData;
|
||||
script;
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
|
||||
<?php $scriptString = <<<script
|
||||
require([
|
||||
'mage/url',
|
||||
'Magento_Ui/js/block-loader'
|
||||
], function(url, blockLoader) {
|
||||
blockLoader("{$block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')))}");
|
||||
return url.setBaseUrl('{$block->escapeJs($block->escapeUrl($block->getBaseUrl()))}');
|
||||
})
|
||||
script;
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var $block \Magento\Checkout\Block\Onepage\Failure */
|
||||
?>
|
||||
<?php if ($block->getRealOrderId()) :?>
|
||||
<p><?= $block->escapeHtml(__('Order #') . $block->getRealOrderId()) ?></p>
|
||||
<?php endif ?>
|
||||
<?php if ($error = $block->getErrorMessage()) :?>
|
||||
<p><?= $block->escapeHtml($error) ?></p>
|
||||
<?php endif ?>
|
||||
<p><?= $block->escapeHtml(
|
||||
__('Click <a href="%1">here</a> to continue shopping.', $block->escapeUrl($block->getContinueShoppingUrl())),
|
||||
['a']
|
||||
) ?>
|
||||
</p>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Checkout\Block\Onepage\Link;
|
||||
use Magento\Framework\Escaper;
|
||||
|
||||
/**
|
||||
* @var Link $block
|
||||
* @var Escaper $escaper
|
||||
*/
|
||||
?>
|
||||
<?php if ($block->isPossibleOnepageCheckout()): ?>
|
||||
<button type="button"
|
||||
data-role="proceed-to-checkout"
|
||||
title="<?= $escaper->escapeHtmlAttr(__('Proceed to Checkout')) ?>"
|
||||
data-mage-init='{
|
||||
"Magento_Checkout/js/proceed-to-checkout":{
|
||||
"checkoutUrl":"<?= $escaper->escapeJs($block->getCheckoutUrl()) ?>"
|
||||
}
|
||||
}'
|
||||
class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>"
|
||||
<?php if ($block->isDisabled()): ?>
|
||||
disabled="disabled"
|
||||
<?php endif; ?>>
|
||||
<span><?= $escaper->escapeHtml(__('Proceed to Checkout')) ?></span>
|
||||
</button>
|
||||
<?php endif?>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
// phpcs:disable Magento2.Templates.ThisInTemplate
|
||||
|
||||
/** @var $block Magento\Checkout\Block\Cart\Item\Renderer */
|
||||
|
||||
$_item = $block->getItem();
|
||||
$taxDataHelper = $this->helper(Magento\Tax\Helper\Data::class);
|
||||
?>
|
||||
<tbody class="cart item">
|
||||
<tr>
|
||||
<td class="col item" data-th="<?= $block->escapeHtml(__('Product Name')) ?>">
|
||||
<span class="product-item-photo">
|
||||
<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
|
||||
</span>
|
||||
<div class="product-item-details">
|
||||
<strong class="product name product-item-name">
|
||||
<?= $block->escapeHtml($block->getProductName()) ?>
|
||||
</strong>
|
||||
<?php if ($_options = $block->getOptionList()) :?>
|
||||
<dl class="item-options">
|
||||
<?php foreach ($_options as $_option) :?>
|
||||
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
|
||||
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
|
||||
<dd>
|
||||
<?php if (isset($_formatedOptionValue['full_view'])) :?>
|
||||
<?= /* @noEscape */ $_formatedOptionValue['full_view'] ?>
|
||||
<?php else :?>
|
||||
<?= /* @noEscape */ $_formatedOptionValue['value'] ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
<?php endif;?>
|
||||
<?php if ($addtInfoBlock = $block->getProductAdditionalInformationBlock()) :?>
|
||||
<?= $addtInfoBlock->setItem($_item)->toHtml() ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
|
||||
<?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
|
||||
<?= $block->getUnitPriceInclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
|
||||
<?= $block->getUnitPriceExclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="col qty"
|
||||
data-th="<?= $block->escapeHtml(__('Qty')) ?>"
|
||||
>
|
||||
<span class="qty"><?= $block->escapeHtml($_item->getQty()) ?></span>
|
||||
</td>
|
||||
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
|
||||
<?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
|
||||
<?= $block->getRowTotalInclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
|
||||
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
|
||||
<?= $block->getRowTotalExclTaxHtml($_item) ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user