init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="main.swatches_visual">
|
||||
<arguments>
|
||||
<argument name="view_model" xsi:type="object">Esun\Catalog\ViewModel\Adminhtml\ColorOptionSwatchConfig</argument>
|
||||
</arguments>
|
||||
<action method="setTemplate">
|
||||
<argument name="template" xsi:type="string">Esun_Catalog::catalog/product/attribute/visual.phtml</argument>
|
||||
</action>
|
||||
</referenceBlock>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\CertificationType\EditBlock"
|
||||
name="esun.catalog.certification.type.edit"
|
||||
template="Esun_Catalog::certification_type/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\CertificationType\ListBlock"
|
||||
name="esun.catalog.certification.type.list"
|
||||
template="Esun_Catalog::certification_type/list.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="esun_catalog_certificationtype_edit"/>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\ColorOption\EditBlock"
|
||||
name="esun.catalog.color.option.edit"
|
||||
template="Esun_Catalog::color_option/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\ColorOption\ListBlock"
|
||||
name="esun.catalog.color.option.list"
|
||||
template="Esun_Catalog::color_option/list.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\ColorOption\EditBlock"
|
||||
name="esun.catalog.color.option.new"
|
||||
template="Esun_Catalog::color_option/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\Faq\EditBlock"
|
||||
name="esun.catalog.faq.edit"
|
||||
template="Esun_Catalog::faq/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\Faq\ListBlock"
|
||||
name="esun.catalog.faq.list"
|
||||
template="Esun_Catalog::faq/list.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="esun_catalog_faq_edit"/>
|
||||
</page>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<css src="Esun_Catalog::css/mix-step-pricing.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\MixStepPricing\Form" name="esun.mix.step.pricing.delete">
|
||||
<arguments>
|
||||
<argument name="mode" xsi:type="string">delete</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<head>
|
||||
<css src="Esun_Catalog::css/mix-step-pricing.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\MixStepPricing\Form" name="esun.mix.step.pricing.import">
|
||||
<arguments>
|
||||
<argument name="mode" xsi:type="string">import</argument>
|
||||
</arguments>
|
||||
</block>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\ProductRecommendation\ImportForm"
|
||||
name="esun.product.recommendation.import"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\SpecificationBrand\EditBlock"
|
||||
name="esun.catalog.specification.brand.edit"
|
||||
template="Esun_Catalog::specification_brand/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<uiComponent name="esun_specification_brand_listing"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="esun_catalog_specificationbrand_edit"/>
|
||||
</page>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<block class="Esun\Catalog\Block\Adminhtml\SpecificationImport\EditBlock"
|
||||
name="esun.catalog.specification.import.edit"
|
||||
template="Esun_Catalog::specification_import/edit.phtml"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceContainer name="content">
|
||||
<uiComponent name="esun_specification_import_listing"/>
|
||||
</referenceContainer>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<update handle="esun_catalog_specificationimport_edit"/>
|
||||
</page>
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/**
|
||||
* @var $block \Esun\Catalog\Block\Adminhtml\Attribute\Edit\Options\Visual
|
||||
* @var $escaper \Magento\Framework\Escaper
|
||||
*/
|
||||
$stores = $block->getStoresSortedBySortOrder();
|
||||
$viewModel = $block->getData('view_model');
|
||||
$jsonConfig = $viewModel instanceof \Esun\Catalog\ViewModel\Adminhtml\ColorOptionSwatchConfig
|
||||
? $viewModel->enrichJsonConfig((string)$block->getJsonConfig())
|
||||
: (string)$block->getJsonConfig();
|
||||
$isColorAttribute = $viewModel instanceof \Esun\Catalog\ViewModel\Adminhtml\ColorOptionSwatchConfig
|
||||
&& $viewModel->isColorAttribute((int)$block->getRequest()->getParam('attribute_id'));
|
||||
?>
|
||||
<fieldset class="admin__fieldset fieldset">
|
||||
<legend class="legend">
|
||||
<span><?= $escaper->escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?></span>
|
||||
</legend><br />
|
||||
<div class="admin__control-table-wrapper" id="swatch-visual-options-panel">
|
||||
<table class="data-table clearfix" cellspacing="0">
|
||||
<thead>
|
||||
<tr id="swatch-visual-options-table">
|
||||
<th class="col-draggable"></th>
|
||||
<th class="col-default"><span><?= $escaper->escapeHtml(__('Is Default')) ?></span></th>
|
||||
<th><span><?= $escaper->escapeHtml(__('Swatch')) ?></span></th>
|
||||
<?php foreach ($stores as $_store): ?>
|
||||
<th<?= ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' class="_required"' : '' ?>>
|
||||
<span><?= $escaper->escapeHtml($_store->getName()) ?></span>
|
||||
</th>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($isColorAttribute): ?>
|
||||
<th><span><?= $escaper->escapeHtml(__('Hot Sale')) ?></span></th>
|
||||
<?php endif; ?>
|
||||
<th><span><?= $escaper->escapeHtml(__('Swatch Colors')) ?></span></th>
|
||||
<th><span><?= $escaper->escapeHtml(__('Color Ball Image')) ?></span></th>
|
||||
<?php $colTotal = count($stores) * 2 + 5 + (int)$isColorAttribute; ?>
|
||||
<th class="col-delete"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-role="swatch-visual-options-container" class="ignore-validate"></tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="<?= (int)$colTotal ?>">
|
||||
<input type="hidden" class="required-visual-swatch-entry" name="visual_swatch_validation"/>
|
||||
<input type="hidden" class="required-visual-swatch-unique" name="visual_swatch_validation_unique"/>
|
||||
<input type="hidden" name="reset_is-default_option"/>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="<?= (int)$colTotal ?>" class="col-actions-add">
|
||||
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
|
||||
<button id="add_new_swatch_visual_option_button"
|
||||
title="<?= $escaper->escapeHtml(__('Add Swatch')) ?>"
|
||||
type="button" class="action- scalable add">
|
||||
<span><?= $escaper->escapeHtml(__('Add Swatch')) ?></span>
|
||||
</button>
|
||||
|
||||
<button id="reset_default_swatch_visual_option_button"
|
||||
title="<?= $escaper->escapeHtml(__('Reset Is Default')) ?>"
|
||||
type="button" class="action- scalable reset">
|
||||
<span><?= $escaper->escapeHtml(__('Reset Is Default')) ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<input type="hidden" id="swatch-visual-option-count-check" value="" />
|
||||
</div>
|
||||
<style>
|
||||
.esun-color-option-col {
|
||||
min-width: 190px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.esun-color-option-col .note {
|
||||
color: #777;
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.esun-color-ball-preview {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.esun-color-ball-preview img {
|
||||
border: 1px solid #d6d6d6;
|
||||
border-radius: 50%;
|
||||
height: 42px;
|
||||
object-fit: contain;
|
||||
width: 42px;
|
||||
}
|
||||
</style>
|
||||
<script id="swatch-visual-row-template" type="text/x-magento-template">
|
||||
<tr>
|
||||
<td class="col-draggable">
|
||||
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
|
||||
<div data-role="draggable-handle" class="draggable-handle"
|
||||
title="<?= $escaper->escapeHtml(__('Sort Option')) ?>"></div>
|
||||
<?php endif; ?>
|
||||
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
|
||||
</td>
|
||||
<td class="col-default">
|
||||
<input class="input-radio" type="<%- data.intype %>" name="defaultvisual[]" value="<%- data.id %>" <%- data.checked %><?= ($block->getReadOnly()) ? ' disabled="disabled"' : '' ?>/>
|
||||
</td>
|
||||
<td class="swatches-visual-col col-default <%- data.empty_class %>">
|
||||
<input id="swatch_visual_value_<%- data.id %>" type="hidden" name="swatchvisual[value][<%- data.id %>]" value="<%- data.defaultswatch0 %>" />
|
||||
<div class="swatch_window" id="swatch_window_option_<%- data.id %>" style="<%- data.swatch0 %>"></div>
|
||||
<div class="swatch_sub-menu_container" id="swatch_container_option_<%- data.id %>">
|
||||
<div class="swatch_row position-relative">
|
||||
<div class="swatch_row_name colorpicker_handler">
|
||||
<p><?= $escaper->escapeHtml(__('Choose a color')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swatch_row">
|
||||
<div class="swatch_row_name btn_choose_file_upload" id="swatch_choose_file_option_<%- data.id %>">
|
||||
<p><?= $escaper->escapeHtml(__('Upload a file')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swatch_row">
|
||||
<div class="swatch_row_name btn_remove_swatch">
|
||||
<p><?= $escaper->escapeHtml(__('Clear')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php foreach ($stores as $_store): ?>
|
||||
<td class="swatch-col-<%- data.id %>">
|
||||
<input name="optionvisual[value][<%- data.id %>][<?= (int)$_store->getId() ?>]"
|
||||
value="<%- data.store<?= (int) $_store->getId() ?> %>"
|
||||
class="input-text<?= ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' required-option required-unique' : '' ?>"
|
||||
type="text" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($isColorAttribute): ?>
|
||||
<td class="col-default">
|
||||
<input type="hidden"
|
||||
name="esun_color_option[<%- data.id %>][is_hot_sale]"
|
||||
value="0" />
|
||||
<input class="admin__control-checkbox"
|
||||
id="esun-color-hot-sale-<%- data.id %>"
|
||||
type="checkbox"
|
||||
name="esun_color_option[<%- data.id %>][is_hot_sale]"
|
||||
value="1"
|
||||
aria-label="<?= $escaper->escapeHtmlAttr(__('Hot Sale')) ?>"
|
||||
<% if (data.esun_is_hot_sale) { %>checked="checked"<% } %>
|
||||
<?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?> />
|
||||
<label for="esun-color-hot-sale-<%- data.id %>"
|
||||
title="<?= $escaper->escapeHtmlAttr(__('Hot Sale')) ?>"></label>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="esun-color-option-col">
|
||||
<input class="input-text"
|
||||
type="text"
|
||||
name="esun_color_option[<%- data.id %>][swatch_colors]"
|
||||
value="<%- data.esun_swatch_colors %>"
|
||||
placeholder="#FF0000,#FFD800,#18A957" />
|
||||
<span class="note"><?= $escaper->escapeHtml(__('Used only for the product-page color swatch selector.')) ?></span>
|
||||
</td>
|
||||
<td class="esun-color-option-col">
|
||||
<input type="hidden" name="esun_color_option[<%- data.id %>][ball_image]" value="<%- data.esun_ball_image %>" data-role="esun-ball-image-existing" />
|
||||
<input type="hidden" name="esun_color_option[<%- data.id %>][ball_image_base64]" value="<%- data.esun_ball_image_base64 %>" data-role="esun-ball-image-base64" />
|
||||
<input type="hidden" name="esun_color_option[<%- data.id %>][ball_image_name]" value="<%- data.esun_ball_image_name %>" data-role="esun-ball-image-name" />
|
||||
<input type="hidden" name="esun_color_option[<%- data.id %>][delete_ball_image]" value="<%- data.esun_delete_ball_image %>" data-role="esun-delete-ball-image" />
|
||||
<input type="file" class="admin__control-file esun-color-ball-input" accept=".jpg,.jpeg,.png,.gif,.webp" />
|
||||
<div class="esun-color-ball-preview" data-role="esun-ball-preview" <% if (!data.esun_ball_image_url) { %>style="display:none"<% } %>>
|
||||
<img src="<%- data.esun_ball_image_url %>" alt="" data-role="esun-ball-preview-image" />
|
||||
<button type="button" class="action-default esun-color-ball-remove">
|
||||
<span><?= $escaper->escapeHtml(__('Remove')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<span class="note"><?= $escaper->escapeHtml(__('Used only in Available Colors.')) ?></span>
|
||||
</td>
|
||||
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
|
||||
<input type="hidden" class="delete-flag" name="optionvisual[delete][<%- data.id %>]" value="" />
|
||||
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
|
||||
<button title="<?= $escaper->escapeHtml(__('Delete')) ?>" type="button"
|
||||
class="action- scalable delete delete-option">
|
||||
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
|
||||
</button>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
</script>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"*": {
|
||||
"Magento_Swatches/js/visual": <?= /* @noEscape */ $jsonConfig ?> ,
|
||||
"Esun_Catalog/js/color-option-swatch-admin": {},
|
||||
"Magento_Catalog/catalog/product/attribute/unique-validate": {
|
||||
"element": "required-visual-swatch-unique",
|
||||
"message": "<?= $escaper->escapeHtml(__("The value of Admin must be unique.")) ?>"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</fieldset>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\CertificationType\EditBlock $block */
|
||||
$type = $block->getTypeModel();
|
||||
$icon = (string)$type->getData('icon');
|
||||
?>
|
||||
<div class="page-main-actions">
|
||||
<div class="page-actions">
|
||||
<a class="action-secondary" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
|
||||
<?= $block->escapeHtml(__('Back')) ?>
|
||||
</a>
|
||||
<button class="action-primary" type="submit" form="esun-certification-type-form">
|
||||
<?= $block->escapeHtml(__('Save Certification Type')) ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="esun-certification-type-form"
|
||||
class="admin__fieldset"
|
||||
action="<?= $block->escapeUrl($block->getSaveUrl()) ?>"
|
||||
method="post"
|
||||
enctype="multipart/form-data">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="type_id" value="<?= (int)$type->getId() ?>">
|
||||
|
||||
<div class="admin__field _required">
|
||||
<label class="admin__field-label" for="certification-name">
|
||||
<span><?= $block->escapeHtml(__('Certification Type Name')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="certification-name"
|
||||
class="admin__control-text required-entry"
|
||||
type="text"
|
||||
name="name"
|
||||
value="<?= $block->escapeHtmlAttr((string)$type->getData('name')) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="certification-icon">
|
||||
<span><?= $block->escapeHtml(__('Icon')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<?php if ($icon !== ''): ?>
|
||||
<p>
|
||||
<img src="<?= $block->escapeUrl($block->getIconUrl($icon)) ?>"
|
||||
alt=""
|
||||
style="height:70px;max-width:120px;object-fit:contain;">
|
||||
</p>
|
||||
<label>
|
||||
<input type="checkbox" name="delete_icon" value="1">
|
||||
<?= $block->escapeHtml(__('Delete current icon')) ?>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<input id="certification-icon"
|
||||
class="admin__control-file"
|
||||
type="file"
|
||||
name="icon"
|
||||
accept=".jpg,.jpeg,.png,.gif,.webp,.svg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="certification-status">
|
||||
<span><?= $block->escapeHtml(__('Status')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<select id="certification-status" class="admin__control-select" name="status">
|
||||
<option value="1"<?= (int)$type->getData('status') !== 0 ? ' selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('Enabled')) ?>
|
||||
</option>
|
||||
<option value="0"<?= (int)$type->getData('status') === 0 ? ' selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('Disabled')) ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="certification-sort-order">
|
||||
<span><?= $block->escapeHtml(__('Sort Order')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="certification-sort-order"
|
||||
class="admin__control-text"
|
||||
type="number"
|
||||
name="sort_order"
|
||||
value="<?= (int)$type->getData('sort_order') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\CertificationType\ListBlock $block */
|
||||
$types = $block->getTypes();
|
||||
?>
|
||||
<div class="page-main-actions">
|
||||
<div class="page-actions">
|
||||
<a class="action-primary" href="<?= $block->escapeUrl($block->getNewUrl()) ?>">
|
||||
<?= $block->escapeHtml(__('Add Certification Type')) ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="data-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('ID')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Icon')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Certification Type Name')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Status')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Sort Order')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Action')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($types->getSize()): ?>
|
||||
<?php foreach ($types as $type): ?>
|
||||
<tr>
|
||||
<td><?= (int)$type->getId() ?></td>
|
||||
<td>
|
||||
<?php if ((string)$type->getData('icon') !== ''): ?>
|
||||
<img src="<?= $block->escapeUrl($block->getIconUrl((string)$type->getData('icon'))) ?>"
|
||||
alt=""
|
||||
style="height:44px;max-width:80px;object-fit:contain;">
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= $block->escapeHtml((string)$type->getData('name')) ?></td>
|
||||
<td><?= $block->escapeHtml((int)$type->getData('status') === 1 ? __('Enabled') : __('Disabled')) ?></td>
|
||||
<td><?= (int)$type->getData('sort_order') ?></td>
|
||||
<td>
|
||||
<a href="<?= $block->escapeUrl($block->getEditUrl((int)$type->getId())) ?>">
|
||||
<?= $block->escapeHtml(__('Edit')) ?>
|
||||
</a>
|
||||
|
|
||||
<a href="<?= $block->escapeUrl($block->getDeleteUrl((int)$type->getId())) ?>"
|
||||
onclick="return confirm('<?= $block->escapeJs(__('Are you sure you want to delete this certification type?')) ?>');">
|
||||
<?= $block->escapeHtml(__('Delete')) ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="6"><?= $block->escapeHtml(__('No certification types found.')) ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\ColorOption\EditBlock $block */
|
||||
$item = $block->getItem();
|
||||
$ballImage = (string)$item->getData('ball_image');
|
||||
?>
|
||||
<div class="page-main-actions">
|
||||
<div class="page-actions">
|
||||
<a class="action-secondary" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
|
||||
<?= $block->escapeHtml(__('Back')) ?>
|
||||
</a>
|
||||
<button class="action-primary" type="submit" form="esun-color-option-form">
|
||||
<?= $block->escapeHtml(__('Save Color Option')) ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="esun-color-option-form"
|
||||
class="admin__fieldset"
|
||||
action="<?= $block->escapeUrl($block->getSaveUrl()) ?>"
|
||||
method="post"
|
||||
enctype="multipart/form-data">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="entity_id" value="<?= (int)$item->getId() ?>">
|
||||
|
||||
<div class="admin__field _required">
|
||||
<label class="admin__field-label" for="color-option-id">
|
||||
<span><?= $block->escapeHtml(__('Color Option')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<select id="color-option-id" class="admin__control-select required-entry" name="option_id">
|
||||
<option value=""><?= $block->escapeHtml(__('-- Please Select --')) ?></option>
|
||||
<?php foreach ($block->getColorOptions() as $option): ?>
|
||||
<?php $optionId = (int)$option['value']; ?>
|
||||
<option value="<?= $optionId ?>"<?= (int)$item->getData('option_id') === $optionId ? ' selected' : '' ?>>
|
||||
<?= $block->escapeHtml((string)$option['label']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-display-name">
|
||||
<span><?= $block->escapeHtml(__('Display Name')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="color-display-name"
|
||||
class="admin__control-text"
|
||||
type="text"
|
||||
name="display_name"
|
||||
value="<?= $block->escapeHtmlAttr((string)$item->getData('display_name')) ?>">
|
||||
<div class="admin__field-note">
|
||||
<?= $block->escapeHtml(__('Leave empty to use the Magento color option label.')) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-swatch-colors">
|
||||
<span><?= $block->escapeHtml(__('Swatch Colors')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="color-swatch-colors"
|
||||
class="admin__control-text"
|
||||
type="text"
|
||||
name="swatch_colors"
|
||||
value="<?= $block->escapeHtmlAttr((string)$item->getData('swatch_colors')) ?>"
|
||||
placeholder="#FF0000,#FFD800,#18A957">
|
||||
<div class="admin__field-note">
|
||||
<?= $block->escapeHtml(__('Comma-separated hex colors. These are used only for the product-page color swatch selector.')) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-ball-image">
|
||||
<span><?= $block->escapeHtml(__('Color Ball Image')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<?php if ($ballImage !== ''): ?>
|
||||
<p>
|
||||
<img src="<?= $block->escapeUrl($block->getImageUrl($ballImage)) ?>"
|
||||
alt=""
|
||||
style="height:80px;width:80px;object-fit:contain;">
|
||||
</p>
|
||||
<label>
|
||||
<input type="checkbox" name="delete_ball_image" value="1">
|
||||
<?= $block->escapeHtml(__('Delete current image')) ?>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<input id="color-ball-image"
|
||||
class="admin__control-file"
|
||||
type="file"
|
||||
name="ball_image"
|
||||
accept=".jpg,.jpeg,.png,.gif,.webp">
|
||||
<div class="admin__field-note">
|
||||
<?= $block->escapeHtml(__('This image is used only in the Available Colors section.')) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-is-hot-sale">
|
||||
<span><?= $block->escapeHtml(__('Hot Sale')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input type="hidden" name="is_hot_sale" value="0">
|
||||
<input id="color-is-hot-sale"
|
||||
class="admin__control-checkbox"
|
||||
type="checkbox"
|
||||
name="is_hot_sale"
|
||||
value="1"<?= (int)$item->getData('is_hot_sale') === 1 ? ' checked' : '' ?>>
|
||||
<label for="color-is-hot-sale">
|
||||
<span><?= $block->escapeHtml(__('Show this color as a Hot Sale color in category filters.')) ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-status">
|
||||
<span><?= $block->escapeHtml(__('Status')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<select id="color-status" class="admin__control-select" name="status">
|
||||
<option value="1"<?= (int)$item->getData('status') !== 0 ? ' selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('Enabled')) ?>
|
||||
</option>
|
||||
<option value="0"<?= (int)$item->getData('status') === 0 ? ' selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('Disabled')) ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label" for="color-sort-order">
|
||||
<span><?= $block->escapeHtml(__('Sort Order')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="color-sort-order"
|
||||
class="admin__control-text"
|
||||
type="number"
|
||||
name="sort_order"
|
||||
value="<?= (int)$item->getData('sort_order') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\ColorOption\ListBlock $block */
|
||||
$items = $block->getItems();
|
||||
?>
|
||||
<div class="page-main-actions">
|
||||
<div class="page-actions">
|
||||
<a class="action-primary" href="<?= $block->escapeUrl($block->getNewUrl()) ?>">
|
||||
<?= $block->escapeHtml(__('Add Color Option')) ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="data-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('ID')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Color Option')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Display Name')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Swatch Colors')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Color Ball')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Hot Sale')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Status')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Sort Order')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Action')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($items->getSize()): ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?php
|
||||
$swatchColors = array_filter(array_map('trim', explode(',', (string)$item->getData('swatch_colors'))));
|
||||
$ballImage = (string)$item->getData('ball_image');
|
||||
?>
|
||||
<tr>
|
||||
<td><?= (int)$item->getId() ?></td>
|
||||
<td><?= $block->escapeHtml($block->getColorOptionLabel((int)$item->getData('option_id'))) ?></td>
|
||||
<td><?= $block->escapeHtml((string)$item->getData('display_name')) ?></td>
|
||||
<td>
|
||||
<?php foreach ($swatchColors as $color): ?>
|
||||
<span title="<?= $block->escapeHtmlAttr($color) ?>"
|
||||
style="display:inline-block;width:22px;height:22px;border:1px solid #ccc;border-radius:50%;background:<?= $block->escapeHtmlAttr($color) ?>;"></span>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($ballImage !== ''): ?>
|
||||
<img src="<?= $block->escapeUrl($block->getImageUrl($ballImage)) ?>"
|
||||
alt=""
|
||||
style="height:44px;width:44px;object-fit:contain;">
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= $block->escapeHtml((int)$item->getData('is_hot_sale') === 1 ? __('Yes') : __('No')) ?></td>
|
||||
<td><?= $block->escapeHtml((int)$item->getData('status') === 1 ? __('Enabled') : __('Disabled')) ?></td>
|
||||
<td><?= (int)$item->getData('sort_order') ?></td>
|
||||
<td>
|
||||
<a href="<?= $block->escapeUrl($block->getEditUrl((int)$item->getId())) ?>">
|
||||
<?= $block->escapeHtml(__('Edit')) ?>
|
||||
</a>
|
||||
|
|
||||
<a href="<?= $block->escapeUrl($block->getDeleteUrl((int)$item->getId())) ?>"
|
||||
onclick="return confirm('<?= $block->escapeJs(__('Are you sure you want to delete this color option?')) ?>');">
|
||||
<?= $block->escapeHtml(__('Delete')) ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="9"><?= $block->escapeHtml(__('No color options found.')) ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\Faq\EditBlock $block */
|
||||
$faq = $block->getFaqModel();
|
||||
$selectedStores = array_map('intval', explode(',', (string)($faq->getData('store_ids') ?: '0')));
|
||||
?>
|
||||
<form method="post" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="faq_id" value="<?= (int)$faq->getId() ?>">
|
||||
<div class="page-main-actions"><div class="page-actions">
|
||||
<a class="action-secondary" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
|
||||
<span><?= $block->escapeHtml(__('Back')) ?></span>
|
||||
</a>
|
||||
<button class="action-primary" type="submit"><span><?= $block->escapeHtml(__('Save FAQ')) ?></span></button>
|
||||
</div></div>
|
||||
<fieldset class="admin__fieldset">
|
||||
<div class="admin__field _required">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Title')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<input class="admin__control-text" type="text" name="title" required
|
||||
value="<?= $block->escapeHtmlAttr((string)$faq->getData('title')) ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Stores')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<select class="admin__control-multiselect" name="store_ids[]" multiple size="8">
|
||||
<?php foreach ($block->getStoreOptions() as $group): ?>
|
||||
<?php if (isset($group['value']) && is_array($group['value'])): ?>
|
||||
<optgroup label="<?= $block->escapeHtmlAttr((string)$group['label']) ?>">
|
||||
<?php foreach ($group['value'] as $store): ?>
|
||||
<option value="<?= (int)$store['value'] ?>" <?= in_array((int)$store['value'], $selectedStores, true) ? 'selected' : '' ?>>
|
||||
<?= $block->escapeHtml((string)$store['label']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</optgroup>
|
||||
<?php else: ?>
|
||||
<option value="<?= (int)$group['value'] ?>" <?= in_array((int)$group['value'], $selectedStores, true) ? 'selected' : '' ?>>
|
||||
<?= $block->escapeHtml((string)$group['label']) ?>
|
||||
</option>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Content')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<?= /* @noEscape */ $block->getContentEditorHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Status')) ?></span></label>
|
||||
<div class="admin__field-control"><select class="admin__control-select" name="status">
|
||||
<option value="1" <?= !$faq->getId() || (int)$faq->getData('status') === 1 ? 'selected' : '' ?>><?= $block->escapeHtml(__('Enabled')) ?></option>
|
||||
<option value="0" <?= $faq->getId() && (int)$faq->getData('status') === 0 ? 'selected' : '' ?>><?= $block->escapeHtml(__('Disabled')) ?></option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Sort Order')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<input class="admin__control-text" type="number" name="sort_order"
|
||||
value="<?= (int)$faq->getData('sort_order') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\Faq\ListBlock $block */
|
||||
?>
|
||||
<div class="page-main-actions">
|
||||
<div class="page-actions">
|
||||
<a class="action-primary" href="<?= $block->escapeUrl($block->getNewUrl()) ?>">
|
||||
<span><?= $block->escapeHtml(__('Add FAQ')) ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="data-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('ID')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Title')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Stores')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Status')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Sort Order')) ?></th>
|
||||
<th class="data-grid-th"><?= $block->escapeHtml(__('Actions')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($block->getFaqs() as $faq): ?>
|
||||
<tr>
|
||||
<td><?= (int)$faq->getId() ?></td>
|
||||
<td><?= $block->escapeHtml((string)$faq->getData('title')) ?></td>
|
||||
<td><?= $block->escapeHtml((string)$faq->getData('store_ids')) ?></td>
|
||||
<td><?= $block->escapeHtml((int)$faq->getData('status') ? __('Enabled') : __('Disabled')) ?></td>
|
||||
<td><?= (int)$faq->getData('sort_order') ?></td>
|
||||
<td>
|
||||
<a href="<?= $block->escapeUrl($block->getEditUrl((int)$faq->getId())) ?>"><?= $block->escapeHtml(__('Edit')) ?></a>
|
||||
|
|
||||
<a href="<?= $block->escapeUrl($block->getDeleteUrl((int)$faq->getId())) ?>"
|
||||
onclick="return confirm('<?= $block->escapeJs(__('Delete this FAQ?')) ?>')">
|
||||
<?= $block->escapeHtml(__('Delete')) ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Esun\Catalog\Block\Adminhtml\MixStepPricing\Form $block
|
||||
* @var \Magento\Framework\Escaper $escaper
|
||||
*/
|
||||
$state = $block->getValidationState();
|
||||
$stats = (array)($state['stats'] ?? []);
|
||||
$preview = (array)($state['preview'] ?? []);
|
||||
$invalidPreview = (array)($state['invalid_preview'] ?? []);
|
||||
$isDelete = $block->isDelete();
|
||||
?>
|
||||
<div class="admin__fieldset-wrapper">
|
||||
<div class="admin__fieldset-wrapper-title">
|
||||
<strong class="title">
|
||||
<span><?= $escaper->escapeHtml($isDelete ? __('Batch Delete') : __('Batch Import')) ?></span>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="admin__fieldset-wrapper-content">
|
||||
<fieldset class="admin__fieldset">
|
||||
<div class="admin__field">
|
||||
<div class="admin__field-control">
|
||||
<p>
|
||||
<?php if ($isDelete): ?>
|
||||
<?= $escaper->escapeHtml(__('Deletes all Mix Step Pricing for each sku + website across every Store View.')) ?>
|
||||
<?php else: ?>
|
||||
<?= $escaper->escapeHtml(__('Replaces the complete Mix Step Pricing tier set for each sku + website across every Store View.')) ?>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<p>
|
||||
<a class="action-secondary" href="<?= $escaper->escapeUrl($block->getTemplateUrl()) ?>">
|
||||
<span><?= $escaper->escapeHtml(__('Download Excel Template')) ?></span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="<?= $escaper->escapeUrl($block->getValidateUrl()) ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="form_key" type="hidden" value="<?= $escaper->escapeHtmlAttr($block->getFormKey()) ?>"/>
|
||||
<div class="admin__field required">
|
||||
<label class="admin__field-label" for="mix-step-pricing-file">
|
||||
<span><?= $escaper->escapeHtml(__('Excel File')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="mix-step-pricing-file" class="admin__control-file" type="file"
|
||||
name="excel_file" accept=".xlsx,.xls" required/>
|
||||
<div class="note"><?= $escaper->escapeHtml(__('The file is validated before any data is changed.')) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__actions">
|
||||
<button class="action-primary" type="submit">
|
||||
<span><?= $escaper->escapeHtml(__('Validate File')) ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($state): ?>
|
||||
<div class="admin__fieldset-wrapper">
|
||||
<div class="admin__fieldset-wrapper-title">
|
||||
<strong class="title"><span><?= $escaper->escapeHtml(__('Validation Preview')) ?></span></strong>
|
||||
</div>
|
||||
<div class="admin__fieldset-wrapper-content">
|
||||
<fieldset class="admin__fieldset">
|
||||
<p>
|
||||
<?= $escaper->escapeHtml(__(
|
||||
'%1 valid data rows; %2 sku + website groups; %3 Store View writes.',
|
||||
(int)($stats['valid_rows'] ?? 0),
|
||||
(int)($stats['groups'] ?? 0),
|
||||
(int)($stats['store_view_writes'] ?? 0)
|
||||
)) ?>
|
||||
</p>
|
||||
<?php if ($preview): ?>
|
||||
<div class="admin__data-grid-wrap">
|
||||
<table class="data-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Excel Row')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('SKU')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Website')) ?></th>
|
||||
<?php if (!$isDelete): ?>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Combined Qty From')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Pricing Method')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Discount % / Unit Price')) ?></th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($preview as $item): ?>
|
||||
<tr class="data-row">
|
||||
<td><?= $escaper->escapeHtml((string)($item['row'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['sku'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['website'] ?? '')) ?></td>
|
||||
<?php if (!$isDelete): ?>
|
||||
<td><?= $escaper->escapeHtml((string)($item['combined_qty_from'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['pricing_method'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['value'] ?? '')) ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($state['preview_truncated'])): ?>
|
||||
<p class="note"><?= $escaper->escapeHtml(__('Preview is limited to the first 100 valid rows.')) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($invalidPreview): ?>
|
||||
<div class="mix-step-pricing-invalid-data">
|
||||
<h3><?= $escaper->escapeHtml(__('Invalid Data')) ?></h3>
|
||||
<p>
|
||||
<?= $escaper->escapeHtml(__('%1 invalid rows.', (int)($stats['invalid_rows'] ?? 0))) ?>
|
||||
</p>
|
||||
<div class="admin__data-grid-wrap">
|
||||
<table class="data-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Excel Row')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('SKU')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Website')) ?></th>
|
||||
<?php if (!$isDelete): ?>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Combined Qty From')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Pricing Method')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Discount % / Unit Price')) ?></th>
|
||||
<?php endif; ?>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Reason')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($invalidPreview as $item): ?>
|
||||
<tr class="data-row">
|
||||
<td><?= $escaper->escapeHtml((string)($item['row'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['sku'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['website'] ?? '')) ?></td>
|
||||
<?php if (!$isDelete): ?>
|
||||
<td><?= $escaper->escapeHtml((string)($item['combined_qty_from'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['pricing_method'] ?? '')) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)($item['value'] ?? '')) ?></td>
|
||||
<?php endif; ?>
|
||||
<td><?= $escaper->escapeHtml((string)($item['reason'] ?? '')) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (!empty($state['invalid_preview_truncated'])): ?>
|
||||
<p class="note">
|
||||
<?= $escaper->escapeHtml(__('Invalid data is limited to the first 100 rows.')) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($state['valid'])): ?>
|
||||
<form action="<?= $escaper->escapeUrl($block->getRunUrl()) ?>" method="post">
|
||||
<input name="form_key" type="hidden" value="<?= $escaper->escapeHtmlAttr($block->getFormKey()) ?>"/>
|
||||
<?php if ($isDelete): ?>
|
||||
<div class="admin__field required">
|
||||
<div class="admin__field-control">
|
||||
<input id="confirm-delete-all-tiers" type="checkbox" name="confirm_delete" value="1" required/>
|
||||
<label for="confirm-delete-all-tiers">
|
||||
<?= $escaper->escapeHtml(__('I understand this permanently deletes all tiers for every listed sku + website.')) ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button class="<?= $isDelete ? 'action-delete' : 'action-primary' ?>" type="submit">
|
||||
<span><?= $escaper->escapeHtml($isDelete ? __('Delete Validated Prices') : __('Import Validated Prices')) ?></span>
|
||||
</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Esun\Catalog\Block\Adminhtml\ProductRecommendation\ImportForm $block
|
||||
* @var \Magento\Framework\Escaper $escaper
|
||||
*/
|
||||
$state = $block->getValidationState();
|
||||
$stats = (array)($state['stats'] ?? []);
|
||||
$preview = (array)($state['preview'] ?? []);
|
||||
?>
|
||||
<div class="admin__fieldset-wrapper">
|
||||
<div class="admin__fieldset-wrapper-title">
|
||||
<strong class="title"><span><?= $escaper->escapeHtml(__('Excel Import')) ?></span></strong>
|
||||
</div>
|
||||
<div class="admin__fieldset-wrapper-content">
|
||||
<fieldset class="admin__fieldset">
|
||||
<p><?= $escaper->escapeHtml(__('Each source SKU + website group completely replaces its existing recommendation set. Partial changes must be made on the product edit page.')) ?></p>
|
||||
<p><a class="action-secondary" href="<?= $escaper->escapeUrl($block->getTemplateUrl()) ?>">
|
||||
<span><?= $escaper->escapeHtml(__('Download Excel Template')) ?></span>
|
||||
</a></p>
|
||||
<form action="<?= $escaper->escapeUrl($block->getValidateUrl()) ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="form_key" type="hidden" value="<?= $escaper->escapeHtmlAttr($block->getFormKey()) ?>"/>
|
||||
<div class="admin__field required">
|
||||
<label class="admin__field-label" for="product-recommendation-file">
|
||||
<span><?= $escaper->escapeHtml(__('Excel File')) ?></span>
|
||||
</label>
|
||||
<div class="admin__field-control">
|
||||
<input id="product-recommendation-file" class="admin__control-file" type="file"
|
||||
name="excel_file" accept=".xlsx,.xls" required/>
|
||||
<div class="note"><?= $escaper->escapeHtml(__('The file is validated before any data is changed.')) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="action-primary" type="submit"><span><?= $escaper->escapeHtml(__('Validate File')) ?></span></button>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($state): ?>
|
||||
<div class="admin__fieldset-wrapper">
|
||||
<div class="admin__fieldset-wrapper-title">
|
||||
<strong class="title"><span><?= $escaper->escapeHtml(__('Replacement Preview')) ?></span></strong>
|
||||
</div>
|
||||
<div class="admin__fieldset-wrapper-content">
|
||||
<fieldset class="admin__fieldset">
|
||||
<p><?= $escaper->escapeHtml(__(
|
||||
'%1 rows define %2 product + website sets containing %3 recommendations.',
|
||||
(int)($stats['rows'] ?? 0),
|
||||
(int)($stats['groups'] ?? 0),
|
||||
(int)($stats['recommendations'] ?? 0)
|
||||
)) ?></p>
|
||||
<?php if ($preview): ?>
|
||||
<div class="admin__data-grid-wrap"><table class="data-grid">
|
||||
<thead><tr>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Source SKU')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Website')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Recommended SKUs (display order)')) ?></th>
|
||||
<th class="data-grid-th"><?= $escaper->escapeHtml(__('Count')) ?></th>
|
||||
</tr></thead>
|
||||
<tbody><?php foreach ($preview as $item): ?><tr class="data-row">
|
||||
<td><?= $escaper->escapeHtml((string)$item['source_sku']) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)$item['website']) ?></td>
|
||||
<td><?= $escaper->escapeHtml((string)$item['recommended_skus']) ?></td>
|
||||
<td><?= (int)$item['count'] ?></td>
|
||||
</tr><?php endforeach; ?></tbody>
|
||||
</table></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($state['preview_truncated'])): ?>
|
||||
<p class="note"><?= $escaper->escapeHtml(__('Preview is limited to the first 100 groups.')) ?></p>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($state['valid'])): ?>
|
||||
<form action="<?= $escaper->escapeUrl($block->getRunUrl()) ?>" method="post">
|
||||
<input name="form_key" type="hidden" value="<?= $escaper->escapeHtmlAttr($block->getFormKey()) ?>"/>
|
||||
<button class="action-primary" type="submit">
|
||||
<span><?= $escaper->escapeHtml(__('Import and Replace Recommendations')) ?></span>
|
||||
</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\SpecificationBrand\EditBlock $block */
|
||||
$brand = $block->getBrand();
|
||||
$logo = (string)$brand->getData('brand_logo');
|
||||
?>
|
||||
<form method="post" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>" enctype="multipart/form-data">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="brand_id" value="<?= (int)$brand->getId() ?>">
|
||||
<div class="page-main-actions"><div class="page-actions">
|
||||
<a class="action-secondary" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
|
||||
<span><?= $block->escapeHtml(__('Back')) ?></span>
|
||||
</a>
|
||||
<button class="action-primary" type="submit"><span><?= $block->escapeHtml(__('Save Brand')) ?></span></button>
|
||||
</div></div>
|
||||
<fieldset class="admin__fieldset">
|
||||
<div class="admin__field _required">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Brand Name')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<input class="admin__control-text" type="text" name="brand_name" required
|
||||
value="<?= $block->escapeHtmlAttr((string)$brand->getData('brand_name')) ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Brand Logo')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<?php if ($logo !== ''): ?>
|
||||
<div style="margin-bottom:1.5rem">
|
||||
<img src="<?= $block->escapeUrl($block->getMediaUrl($logo)) ?>"
|
||||
alt=""
|
||||
style="display:block;max-width:16rem;max-height:8rem;margin-bottom:1rem;border:1px solid #d6d6d6;background:#fff;padding:.5rem">
|
||||
<label>
|
||||
<input type="checkbox" name="delete_logo" value="1">
|
||||
<?= $block->escapeHtml(__('Delete current logo')) ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<input type="file" name="brand_logo" accept="image/jpeg,image/png,image/gif,image/webp,image/svg+xml">
|
||||
<p class="note"><?= $block->escapeHtml(__('Allowed: JPG, PNG, GIF, WebP and SVG.')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Product Specific')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<select class="admin__control-select" name="is_product_specific">
|
||||
<option value="1" <?= (int)$brand->getData('is_product_specific') !== 0 ? 'selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('Yes - match files by product name')) ?>
|
||||
</option>
|
||||
<option value="0" <?= (int)$brand->getData('is_product_specific') === 0 ? 'selected' : '' ?>>
|
||||
<?= $block->escapeHtml(__('No - files are common for all products')) ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Status')) ?></span></label>
|
||||
<div class="admin__field-control"><select class="admin__control-select" name="status">
|
||||
<option value="1" <?= !$brand->getId() || (int)$brand->getData('status') === 1 ? 'selected' : '' ?>><?= $block->escapeHtml(__('Enabled')) ?></option>
|
||||
<option value="0" <?= $brand->getId() && (int)$brand->getData('status') === 0 ? 'selected' : '' ?>><?= $block->escapeHtml(__('Disabled')) ?></option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="admin__field">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Sort Order')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<input class="admin__control-text" type="number" name="sort_order"
|
||||
value="<?= (int)$brand->getData('sort_order') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/** @var \Esun\Catalog\Block\Adminhtml\SpecificationImport\EditBlock $block */
|
||||
$import = $block->getImport();
|
||||
?>
|
||||
<form method="post" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>" enctype="multipart/form-data">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="import_id" value="<?= (int)$import->getId() ?>">
|
||||
<div class="page-main-actions"><div class="page-actions">
|
||||
<a class="action-secondary" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
|
||||
<span><?= $block->escapeHtml(__('Back')) ?></span>
|
||||
</a>
|
||||
<button class="action-primary" type="submit"><span><?= $block->escapeHtml(__('Save and Import ZIP')) ?></span></button>
|
||||
</div></div>
|
||||
<fieldset class="admin__fieldset">
|
||||
<div class="admin__field _required">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Brand')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<select class="admin__control-select" name="brand_id" required>
|
||||
<option value=""><?= $block->escapeHtml(__('Please select')) ?></option>
|
||||
<?php foreach ($block->getBrands() as $brand): ?>
|
||||
<option value="<?= (int)$brand->getId() ?>"
|
||||
<?= (int)$import->getData('brand_id') === (int)$brand->getId() ? 'selected' : '' ?>>
|
||||
<?= $block->escapeHtml((string)$brand->getData('brand_name')) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="note">
|
||||
<a href="<?= $block->escapeUrl($block->getBrandUrl()) ?>" target="_blank" rel="noopener">
|
||||
<?= $block->escapeHtml(__('Create a new brand')) ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin__field <?= $import->getId() ? '' : '_required' ?>">
|
||||
<label class="admin__field-label"><span><?= $block->escapeHtml(__('Specifications ZIP')) ?></span></label>
|
||||
<div class="admin__field-control">
|
||||
<?php if ((string)$import->getData('archive_file') !== ''): ?>
|
||||
<p>
|
||||
<a href="<?= $block->escapeUrl($block->getMediaUrl((string)$import->getData('archive_file'))) ?>"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
<?= $block->escapeHtml(basename((string)$import->getData('archive_file'))) ?>
|
||||
</a>
|
||||
</p>
|
||||
<p class="note"><?= $block->escapeHtml(__('Uploading a new ZIP replaces all existing parsed files for this brand.')) ?></p>
|
||||
<?php endif; ?>
|
||||
<input type="file" name="archive_file" accept=".zip" <?= $import->getId() ? '' : 'required' ?>>
|
||||
<p class="note"><?= $block->escapeHtml(__('Only ZIP files are supported. The ZIP should contain Brand / Model / specification files.')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="js_config" xsi:type="array">
|
||||
<item name="provider" xsi:type="string">esun_specification_brand_listing.esun_specification_brand_listing_data_source</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<buttons>
|
||||
<button name="add">
|
||||
<url path="esun_catalog/specificationbrand/new"/>
|
||||
<class>primary</class>
|
||||
<label translate="true">Add Brand</label>
|
||||
</button>
|
||||
</buttons>
|
||||
<spinner>esun_specification_brand_columns</spinner>
|
||||
<deps>
|
||||
<dep>esun_specification_brand_listing.esun_specification_brand_listing_data_source</dep>
|
||||
</deps>
|
||||
</settings>
|
||||
<dataSource name="esun_specification_brand_listing_data_source" component="Magento_Ui/js/grid/provider">
|
||||
<settings>
|
||||
<storageConfig>
|
||||
<param name="indexField" xsi:type="string">brand_id</param>
|
||||
</storageConfig>
|
||||
<updateUrl path="mui/index/render"/>
|
||||
</settings>
|
||||
<aclResource>Esun_Catalog::specification_brands</aclResource>
|
||||
<dataProvider class="Esun\Catalog\Ui\DataProvider\SpecificationBrand\ListingDataProvider"
|
||||
name="esun_specification_brand_listing_data_source">
|
||||
<settings>
|
||||
<requestFieldName>id</requestFieldName>
|
||||
<primaryFieldName>brand_id</primaryFieldName>
|
||||
</settings>
|
||||
</dataProvider>
|
||||
</dataSource>
|
||||
<listingToolbar name="listing_top">
|
||||
<settings>
|
||||
<sticky>true</sticky>
|
||||
</settings>
|
||||
<bookmark name="bookmarks"/>
|
||||
<columnsControls name="columns_controls"/>
|
||||
<filterSearch name="fulltext"/>
|
||||
<filters name="listing_filters"/>
|
||||
<paging name="listing_paging"/>
|
||||
</listingToolbar>
|
||||
<columns name="esun_specification_brand_columns">
|
||||
<column name="brand_id">
|
||||
<settings>
|
||||
<filter>textRange</filter>
|
||||
<sorting>desc</sorting>
|
||||
<label translate="true">ID</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="logo"
|
||||
class="Esun\Catalog\Ui\Component\Listing\Column\SpecificationBrandLogo"
|
||||
component="Magento_Ui/js/grid/columns/thumbnail">
|
||||
<settings>
|
||||
<altField>brand_name</altField>
|
||||
<hasPreview>1</hasPreview>
|
||||
<label translate="true">Logo</label>
|
||||
<sortable>false</sortable>
|
||||
<filter>false</filter>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="brand_name">
|
||||
<settings>
|
||||
<filter>text</filter>
|
||||
<label translate="true">Brand Name</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="is_product_specific" component="Magento_Ui/js/grid/columns/select">
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Source\BooleanOptions"/>
|
||||
<filter>select</filter>
|
||||
<dataType>select</dataType>
|
||||
<label translate="true">Product Specific</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="status" component="Magento_Ui/js/grid/columns/select">
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Source\BooleanOptions"/>
|
||||
<filter>select</filter>
|
||||
<dataType>select</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="sort_order">
|
||||
<settings>
|
||||
<filter>textRange</filter>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="updated_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
|
||||
<settings>
|
||||
<filter>dateRange</filter>
|
||||
<dataType>date</dataType>
|
||||
<label translate="true">Updated</label>
|
||||
</settings>
|
||||
</column>
|
||||
<actionsColumn name="actions" class="Esun\Catalog\Ui\Component\Listing\Column\SpecificationBrandActions">
|
||||
<settings>
|
||||
<indexField>brand_id</indexField>
|
||||
<resizeEnabled>false</resizeEnabled>
|
||||
<resizeDefaultWidth>110</resizeDefaultWidth>
|
||||
</settings>
|
||||
</actionsColumn>
|
||||
</columns>
|
||||
</listing>
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="js_config" xsi:type="array">
|
||||
<item name="provider" xsi:type="string">esun_specification_import_listing.esun_specification_import_listing_data_source</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<buttons>
|
||||
<button name="add">
|
||||
<url path="esun_catalog/specificationimport/new"/>
|
||||
<class>primary</class>
|
||||
<label translate="true">Upload ZIP</label>
|
||||
</button>
|
||||
</buttons>
|
||||
<spinner>esun_specification_import_columns</spinner>
|
||||
<deps>
|
||||
<dep>esun_specification_import_listing.esun_specification_import_listing_data_source</dep>
|
||||
</deps>
|
||||
</settings>
|
||||
<dataSource name="esun_specification_import_listing_data_source" component="Magento_Ui/js/grid/provider">
|
||||
<settings>
|
||||
<storageConfig>
|
||||
<param name="indexField" xsi:type="string">file_id</param>
|
||||
</storageConfig>
|
||||
<updateUrl path="mui/index/render"/>
|
||||
</settings>
|
||||
<aclResource>Esun_Catalog::specification_imports</aclResource>
|
||||
<dataProvider class="Esun\Catalog\Ui\DataProvider\SpecificationFile\ListingDataProvider"
|
||||
name="esun_specification_import_listing_data_source">
|
||||
<settings>
|
||||
<requestFieldName>id</requestFieldName>
|
||||
<primaryFieldName>file_id</primaryFieldName>
|
||||
</settings>
|
||||
</dataProvider>
|
||||
</dataSource>
|
||||
<listingToolbar name="listing_top">
|
||||
<settings>
|
||||
<sticky>true</sticky>
|
||||
</settings>
|
||||
<bookmark name="bookmarks"/>
|
||||
<columnsControls name="columns_controls"/>
|
||||
<filterSearch name="fulltext"/>
|
||||
<filters name="listing_filters"/>
|
||||
<paging name="listing_paging"/>
|
||||
</listingToolbar>
|
||||
<columns name="esun_specification_import_columns">
|
||||
<column name="file_id">
|
||||
<settings>
|
||||
<filter>textRange</filter>
|
||||
<sorting>desc</sorting>
|
||||
<label translate="true">ID</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="brand_name">
|
||||
<settings>
|
||||
<filter>text</filter>
|
||||
<label translate="true">Brand</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="model_name">
|
||||
<settings>
|
||||
<filter>text</filter>
|
||||
<label translate="true">Model</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="file_name">
|
||||
<settings>
|
||||
<filter>text</filter>
|
||||
<label translate="true">File Name</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="is_product_specific" component="Magento_Ui/js/grid/columns/select">
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Source\BooleanOptions"/>
|
||||
<filter>select</filter>
|
||||
<dataType>select</dataType>
|
||||
<label translate="true">Product Specific</label>
|
||||
</settings>
|
||||
</column>
|
||||
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
|
||||
<settings>
|
||||
<filter>dateRange</filter>
|
||||
<dataType>date</dataType>
|
||||
<label translate="true">Created</label>
|
||||
</settings>
|
||||
</column>
|
||||
<actionsColumn name="actions" class="Esun\Catalog\Ui\Component\Listing\Column\SpecificationImportActions">
|
||||
<settings>
|
||||
<indexField>file_id</indexField>
|
||||
<resizeEnabled>false</resizeEnabled>
|
||||
<resizeDefaultWidth>110</resizeDefaultWidth>
|
||||
</settings>
|
||||
</actionsColumn>
|
||||
</columns>
|
||||
</listing>
|
||||
@@ -0,0 +1,593 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
|
||||
<settings>
|
||||
<buttons>
|
||||
<button name="preview" class="Esun\Catalog\Block\Adminhtml\Product\Edit\Button\Preview"/>
|
||||
</buttons>
|
||||
</settings>
|
||||
|
||||
<fieldset name="esun_product_detail_content" sortOrder="95">
|
||||
<settings>
|
||||
<label translate="true">Product Detail Content</label>
|
||||
<collapsible>true</collapsible>
|
||||
<opened>false</opened>
|
||||
<dataScope>data.product</dataScope>
|
||||
</settings>
|
||||
|
||||
<dynamicRows name="esun_industry_applications" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Industry Applications</label>
|
||||
<addButtonLabel translate="true">Add Application</addButtonLabel>
|
||||
<dndConfig>
|
||||
<param name="enabled" xsi:type="boolean">true</param>
|
||||
</dndConfig>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="position" formElement="input" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="label" formElement="input" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Label</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="icon" formElement="imageUploader" sortOrder="40">
|
||||
<settings>
|
||||
<elementTmpl>ui/form/element/uploader/image</elementTmpl>
|
||||
<dataType>string</dataType>
|
||||
<label translate="true">Icon</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<imageUploader>
|
||||
<settings>
|
||||
<uploaderConfig>
|
||||
<param xsi:type="url" name="url" path="esun_catalog/product_image/upload"/>
|
||||
</uploaderConfig>
|
||||
<previewTmpl>Magento_Catalog/image-preview</previewTmpl>
|
||||
<openDialogTitle>Media Gallery</openDialogTitle>
|
||||
<allowedExtensions>jpg jpeg gif png webp</allowedExtensions>
|
||||
<maxFileSize>4194304</maxFileSize>
|
||||
</settings>
|
||||
</imageUploader>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="image" formElement="imageUploader" sortOrder="50">
|
||||
<settings>
|
||||
<elementTmpl>ui/form/element/uploader/image</elementTmpl>
|
||||
<dataType>string</dataType>
|
||||
<label translate="true">Large Image</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<imageUploader>
|
||||
<settings>
|
||||
<uploaderConfig>
|
||||
<param xsi:type="url" name="url" path="esun_catalog/product_image/upload"/>
|
||||
</uploaderConfig>
|
||||
<previewTmpl>Magento_Catalog/image-preview</previewTmpl>
|
||||
<openDialogTitle>Media Gallery</openDialogTitle>
|
||||
<allowedExtensions>jpg jpeg gif png webp</allowedExtensions>
|
||||
<maxFileSize>8388608</maxFileSize>
|
||||
</settings>
|
||||
</imageUploader>
|
||||
</formElements>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
|
||||
<dynamicRows name="esun_detail_gallery" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="20">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Detail Gallery</label>
|
||||
<notice translate="true">Upload images for the Gallery section. Images are stored under media/esun/catalog/product-detail.</notice>
|
||||
<addButtonLabel translate="true">Add Gallery Image</addButtonLabel>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="position" formElement="input" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="label" formElement="input" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Alt Text</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="image" formElement="imageUploader" sortOrder="40">
|
||||
<settings>
|
||||
<elementTmpl>ui/form/element/uploader/image</elementTmpl>
|
||||
<dataType>string</dataType>
|
||||
<label translate="true">Image</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<imageUploader>
|
||||
<settings>
|
||||
<uploaderConfig>
|
||||
<param xsi:type="url" name="url" path="esun_catalog/product_image/upload"/>
|
||||
</uploaderConfig>
|
||||
<previewTmpl>Magento_Catalog/image-preview</previewTmpl>
|
||||
<openDialogTitle>Media Gallery</openDialogTitle>
|
||||
<allowedExtensions>jpg jpeg gif png webp</allowedExtensions>
|
||||
<maxFileSize>8388608</maxFileSize>
|
||||
</settings>
|
||||
</imageUploader>
|
||||
</formElements>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
|
||||
<dynamicRows name="esun_creative_video_ids" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="30">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Creative Videos</label>
|
||||
<notice translate="true">Select enabled videos from Esun Video Management. Cover images are loaded automatically from the video record.</notice>
|
||||
<addButtonLabel translate="true">Add Video</addButtonLabel>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="position" formElement="input" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="video_id" formElement="select" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Video</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<select>
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Config\Source\VideoOptions"/>
|
||||
</settings>
|
||||
</select>
|
||||
</formElements>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
|
||||
<dynamicRows name="esun_certification_downloads" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="40">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Certification Download</label>
|
||||
<notice translate="true">Upload PDF, Word (DOC/DOCX), ZIP, RAR, or 7Z certification files for the Download section.</notice>
|
||||
<addButtonLabel translate="true">Add Certification</addButtonLabel>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="position" formElement="input" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="type_id" formElement="select" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Certification Type</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<select>
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Config\Source\CertificationTypeOptions"/>
|
||||
</settings>
|
||||
</select>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="file" formElement="fileUploader" sortOrder="40">
|
||||
<settings>
|
||||
<elementTmpl>ui/form/element/uploader/uploader</elementTmpl>
|
||||
<dataType>string</dataType>
|
||||
<label translate="true">Certification File</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<fileUploader>
|
||||
<settings>
|
||||
<uploaderConfig>
|
||||
<param xsi:type="url" name="url" path="esun_catalog/product_certification/upload"/>
|
||||
</uploaderConfig>
|
||||
<allowedExtensions>pdf doc docx zip rar 7z</allowedExtensions>
|
||||
<maxFileSize>52428800</maxFileSize>
|
||||
<isMultipleFiles>false</isMultipleFiles>
|
||||
</settings>
|
||||
</fileUploader>
|
||||
</formElements>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
|
||||
<dynamicRows name="esun_product_faqs" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="50">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Product FAQs</label>
|
||||
<notice translate="true">These FAQs are merged with public Product FAQ records.</notice>
|
||||
<addButtonLabel translate="true">Add FAQ</addButtonLabel>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="position" formElement="input" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Sort Order</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="title" formElement="input" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Question</label>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="content" template="ui/form/field" formElement="wysiwyg" sortOrder="40">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="wysiwygConfigData" xsi:type="array">
|
||||
<item name="is_pagebuilder_enabled" xsi:type="boolean">true</item>
|
||||
<item name="pagebuilder_button" xsi:type="boolean">true</item>
|
||||
<item name="add_variables" xsi:type="boolean">false</item>
|
||||
<item name="add_widgets" xsi:type="boolean">true</item>
|
||||
<item name="add_images" xsi:type="boolean">true</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Answer</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<wysiwyg>
|
||||
<settings>
|
||||
<wysiwyg>true</wysiwyg>
|
||||
</settings>
|
||||
</wysiwyg>
|
||||
</formElements>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="esun_mix_step_pricing" sortOrder="94">
|
||||
<settings>
|
||||
<label translate="true">Mix Step Pricing</label>
|
||||
<collapsible>true</collapsible>
|
||||
<opened>false</opened>
|
||||
<dataScope>data.product</dataScope>
|
||||
</settings>
|
||||
|
||||
<dynamicRows name="esun_mix_step_prices" component="Magento_Ui/js/dynamic-rows/dynamic-rows" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<additionalClasses>
|
||||
<class name="admin__field-wide">true</class>
|
||||
</additionalClasses>
|
||||
<label translate="true">Parent-level Mix Tiers</label>
|
||||
<notice translate="true">Percentage discounts preserve price differences between variants. Fixed unit prices make every eligible variant use the same price.</notice>
|
||||
<addButtonLabel translate="true">Add Mix Tier</addButtonLabel>
|
||||
<componentType>dynamicRows</componentType>
|
||||
</settings>
|
||||
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="isTemplate" xsi:type="boolean">true</item>
|
||||
<item name="is_collection" xsi:type="boolean">true</item>
|
||||
<item name="componentType" xsi:type="string">container</item>
|
||||
</item>
|
||||
</argument>
|
||||
<field name="enabled" formElement="checkbox" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="default" xsi:type="number">1</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>boolean</dataType>
|
||||
<label translate="true">Enabled</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<checkbox>
|
||||
<settings>
|
||||
<valueMap>
|
||||
<map name="false" xsi:type="number">0</map>
|
||||
<map name="true" xsi:type="number">1</map>
|
||||
</valueMap>
|
||||
<prefer>toggle</prefer>
|
||||
</settings>
|
||||
</checkbox>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="customer_group_id" formElement="select" sortOrder="20">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Customer Group</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<select>
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Config\Source\MixCustomerGroupOptions"/>
|
||||
</settings>
|
||||
</select>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="qty" formElement="input" sortOrder="30">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Combined Qty From</label>
|
||||
<validation>
|
||||
<rule name="required-entry" xsi:type="boolean">true</rule>
|
||||
<rule name="validate-digits" xsi:type="boolean">true</rule>
|
||||
<rule name="validate-greater-than-zero" xsi:type="boolean">true</rule>
|
||||
</validation>
|
||||
</settings>
|
||||
</field>
|
||||
<field name="price_type" formElement="select" sortOrder="40">
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Pricing Method</label>
|
||||
</settings>
|
||||
<formElements>
|
||||
<select>
|
||||
<settings>
|
||||
<options class="Esun\Catalog\Model\Config\Source\MixPriceTypeOptions"/>
|
||||
</settings>
|
||||
</select>
|
||||
</formElements>
|
||||
</field>
|
||||
<field name="value" formElement="input" sortOrder="50">
|
||||
<settings>
|
||||
<dataType>number</dataType>
|
||||
<label translate="true">Discount % / Unit Price</label>
|
||||
<validation>
|
||||
<rule name="required-entry" xsi:type="boolean">true</rule>
|
||||
<rule name="validate-number" xsi:type="boolean">true</rule>
|
||||
<rule name="validate-greater-than-zero" xsi:type="boolean">true</rule>
|
||||
</validation>
|
||||
</settings>
|
||||
</field>
|
||||
<actionDelete name="action_delete" sortOrder="90">
|
||||
<settings>
|
||||
<label translate="true">Delete</label>
|
||||
</settings>
|
||||
</actionDelete>
|
||||
</container>
|
||||
</dynamicRows>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="esun_product_recommendations" sortOrder="96">
|
||||
<settings>
|
||||
<label translate="true">Recommended Products</label>
|
||||
<collapsible>true</collapsible>
|
||||
<opened>false</opened>
|
||||
<dataScope>data.product</dataScope>
|
||||
</settings>
|
||||
<field name="esun_recommendations" formElement="textarea" sortOrder="10">
|
||||
<argument name="data" xsi:type="array">
|
||||
<item name="config" xsi:type="array">
|
||||
<item name="source" xsi:type="string">product</item>
|
||||
</item>
|
||||
</argument>
|
||||
<settings>
|
||||
<dataType>text</dataType>
|
||||
<label translate="true">Recommended Products</label>
|
||||
<notice translate="true">Enter one SKU per line, or separate SKUs with commas. The order is the display order. All Store Views sets the default; store view changes apply to the entire website. An empty custom list shows no recommendations.</notice>
|
||||
</settings>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,24 @@
|
||||
.mix-step-pricing-invalid-data {
|
||||
border: 1px solid #e22626;
|
||||
margin-top: 2rem;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.mix-step-pricing-invalid-data h3,
|
||||
.mix-step-pricing-invalid-data > p {
|
||||
color: #c62828;
|
||||
}
|
||||
|
||||
.mix-step-pricing-invalid-data .data-grid-th {
|
||||
background: #b71c1c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mix-step-pricing-invalid-data .data-row td {
|
||||
background: #fff5f5;
|
||||
}
|
||||
|
||||
.mix-step-pricing-invalid-data .data-row td:last-child {
|
||||
color: #c62828;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
define(['jquery'], function ($) {
|
||||
'use strict';
|
||||
|
||||
return function () {
|
||||
function readFile($input, file) {
|
||||
var reader = new FileReader(),
|
||||
$row = $input.closest('tr'),
|
||||
$preview = $row.find('[data-role="esun-ball-preview"]'),
|
||||
$image = $row.find('[data-role="esun-ball-preview-image"]');
|
||||
|
||||
reader.onload = function (event) {
|
||||
$row.find('[data-role="esun-ball-image-base64"]').val(String(event.target.result || ''));
|
||||
$row.find('[data-role="esun-ball-image-name"]').val(file.name || 'color-ball.png');
|
||||
$row.find('[data-role="esun-delete-ball-image"]').val('');
|
||||
$image.attr('src', String(event.target.result || ''));
|
||||
$preview.show();
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
$(document).on('change', '.esun-color-ball-input', function () {
|
||||
var file = this.files && this.files.length ? this.files[0] : null;
|
||||
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
||||
readFile($(this), file);
|
||||
});
|
||||
|
||||
$(document).on('click', '.esun-color-ball-remove', function () {
|
||||
var $row = $(this).closest('tr');
|
||||
|
||||
$row.find('[data-role="esun-ball-image-existing"]').val('');
|
||||
$row.find('[data-role="esun-ball-image-base64"]').val('');
|
||||
$row.find('[data-role="esun-ball-image-name"]').val('');
|
||||
$row.find('[data-role="esun-delete-ball-image"]').val('1');
|
||||
$row.find('.esun-color-ball-input').val('');
|
||||
$row.find('[data-role="esun-ball-preview-image"]').attr('src', '');
|
||||
$row.find('[data-role="esun-ball-preview"]').hide();
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user