ltsecurityinc安防产品在线商城代码
This commit is contained in:
+102
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Grouped product data template
|
||||
*
|
||||
* @var $block BaseImage
|
||||
* @var $block Grouped
|
||||
*/
|
||||
|
||||
use Magento\Catalog\Block\Product\View\BaseImage;
|
||||
use Magento\Catalog\Pricing\Price\TierPrice;
|
||||
use Magento\GroupedProduct\Block\Product\View\Type\Grouped;
|
||||
|
||||
?>
|
||||
<?php $block->setPreconfiguredValue(); ?>
|
||||
<?php $_product = $block->getProduct(); ?>
|
||||
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
|
||||
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
|
||||
|
||||
<div class="table-wrapper grouped">
|
||||
<table class="table data grouped"
|
||||
id="super-product-table"
|
||||
data-mage-init='{ "Magento_GroupedProduct/js/product-ids-resolver": {} }'>
|
||||
<caption class="table-caption"><?= $block->escapeHtml(__('Grouped product items')) ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col item" scope="col"><?= $block->escapeHtml(__('Product Name')) ?></th>
|
||||
<?php if ($_product->isSaleable()) : ?>
|
||||
<th class="col qty" scope="col"><?= $block->escapeHtml(__('Qty')) ?></th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php if ($_hasAssociatedProducts) : ?>
|
||||
<tbody>
|
||||
<?php foreach ($_associatedProducts as $_item) : ?>
|
||||
<tr>
|
||||
<td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
|
||||
<strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
|
||||
<?php if ($block->getCanShowProductPrice($_product)) : ?>
|
||||
<?php if ($block->getCanShowProductPrice($_item)) : ?>
|
||||
<?= /* @noEscape */ $block->getProductPrice($_item) ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if ($_product->isSaleable()) : ?>
|
||||
<td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
|
||||
<?php if ($_item->isSaleable()) : ?>
|
||||
<div class="control qty qty-controls-wrap">
|
||||
<a class="icon-minus qty-minus"></a>
|
||||
<a class="icon-plus qty-plus"></a>
|
||||
<input type="number"
|
||||
name="super_group[<?= $block->escapeHtmlAttr($_item->getId()) ?>]"
|
||||
data-selector="super_group[<?= $block->escapeHtmlAttr($_item->getId()) ?>]"
|
||||
value="<?= $block->escapeHtmlAttr($_item->getQty() * 1) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
|
||||
class="input-text qty"
|
||||
data-validate="{'validate-grouped-qty':'#super-product-table'}"
|
||||
data-errors-message-box="#validation-message-box"/>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
|
||||
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php if ($block->getCanShowProductPrice($_product)
|
||||
&& $block->getCanShowProductPrice($_item)
|
||||
&& trim((string)$block->getProductPriceHtml(
|
||||
$_item,
|
||||
TierPrice::PRICE_CODE
|
||||
))) : ?>
|
||||
<tr class="row-tier-price">
|
||||
<td colspan="2">
|
||||
<?= $block->getProductPriceHtml(
|
||||
$_item,
|
||||
TierPrice::PRICE_CODE
|
||||
) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<?php else : ?>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="unavailable"
|
||||
colspan="<?php if ($_product->isSaleable()) : ?>4<?php else : ?>3<?php endif; ?>">
|
||||
<?= $block->escapeHtml(__('No options of this product are available.')) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div id="validation-message-box"></div>
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// /**
|
||||
// * Copyright © Magento, Inc. All rights reserved.
|
||||
// * See COPYING.txt for license details.
|
||||
// */
|
||||
|
||||
//
|
||||
// Common
|
||||
// _____________________________________________
|
||||
|
||||
& when (@media-common = true) {
|
||||
|
||||
.table.grouped {
|
||||
margin-top: -15px;
|
||||
.lib-table-bordered(
|
||||
@_table_type: horizontal
|
||||
);
|
||||
.col{
|
||||
padding-left:0;
|
||||
padding-right:0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
thead{
|
||||
display:none;
|
||||
}
|
||||
> thead > tr > th {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.product-item-name {
|
||||
font-weight: @font-weight__bold;
|
||||
}
|
||||
|
||||
|
||||
.control {
|
||||
.qty {
|
||||
height: 46px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
min-width: 90px;
|
||||
padding: 0 22px;
|
||||
padding-bottom: 1px;
|
||||
background: #f4f4f4;
|
||||
border: none;
|
||||
font-size: 18px;
|
||||
font-weight: @font-weight__bold;
|
||||
}
|
||||
&.qty-controls-wrap{
|
||||
.icon-minus,
|
||||
.icon-plus{
|
||||
width: 28px;
|
||||
height: 46px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.stock.unavailable {
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
text-transform: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.row-tier-price {
|
||||
td {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.prices-tier {
|
||||
margin: 0 -10px 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user