This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="styles"/>
<body>
<referenceContainer name="content">
<block class="Magento\Backend\Block\Template" name="some_css" template="Stemcell_Sales::custom/css.phtml"/>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="sales_order_edit">
<block class="Stemcell\Sales\Block\Adminhtml\Order\Reject"
name="stemcell_order_reject_button"
template="Stemcell_Sales::order/reject.phtml"/>
</referenceBlock>
<referenceBlock name="order_tab_info">
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::order/view/tab/info.phtml</argument>
</action>
</referenceBlock>
<referenceBlock name="order_history">
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::order/view/history.phtml</argument>
</action>
</referenceBlock>
<referenceBlock name="order_info">
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::order/view/info.phtml</argument>
</action>
</referenceBlock>
<referenceBlock name="order_items">
<action method="setColumns">
<argument name="columns" xsi:type="array">
<item name="sku" xsi:type="string" translate="true">货号</item>
<item name="product" xsi:type="string" translate="true">商品名</item>
<item name="price" xsi:type="string" translate="true">经销商价格</item>
<item name="ordered-qty" xsi:type="string" translate="true">数量</item>
<item name="cd-code" xsi:type="string" translate="true">CD号</item>
<item name="quote-code" xsi:type="string" translate="true">Quote号</item>
<item name="discont" xsi:type="string" translate="true">折扣</item>
<item name="subtotal" xsi:type="string" translate="true">总金额</item>
</argument>
</action>
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::order/view/items.phtml</argument>
</action>
<block class="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer" as="default" name="default_order_items_renderer" template="Magento_Sales::order/view/items/renderer/default.phtml">
<arguments>
<argument name="columns" xsi:type="array">
<item name="sku" xsi:type="string" translate="false">col-sku</item>
<item name="product" xsi:type="string" translate="false">col-product</item>
<item name="price" xsi:type="string" translate="false">col-price</item>
<item name="qty" xsi:type="string" translate="false">col-ordered-qty</item>
<item name="cd-code" xsi:type="string" translate="true">cd-code</item>
<item name="quote-code" xsi:type="string" translate="true">quote-code</item>
<item name="discont" xsi:type="string" translate="false">col-discont</item>
<item name="subtotal" xsi:type="string" translate="false">col-subtotal</item>
</argument>
</arguments>
</block>
</referenceBlock>
<referenceBlock name="column_name">
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::items/column/name.phtml</argument>
</action>
</referenceBlock>
<referenceBlock name="column_qty">
<action method="setTemplate">
<argument name="template" xsi:type="string">Stemcell_Sales::items/column/qty.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,3 @@
<style>
.sales-order-index .data-grid-actions-cell a{text-wrap: nowrap}
</style>
@@ -0,0 +1,69 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/**
* @var $block \Magento\Sales\Block\Adminhtml\Items\Column\Name
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
*/
?>
<?php
/** @var \Magento\Catalog\Helper\Data $catalogHelper */
$catalogHelper = $block->getData('catalogHelper');
?>
<?php if ($_item = $block->getItem()): ?>
<div id="order_item_<?= (int) $_item->getId() ?>_title"
class="product-title">
<?= $block->escapeHtml($_item->getProductOptionByCode('simple_name')?? $_item->getName()) ?>
</div>
<?php if ($block->getOrderOptions()): ?>
<dl class="item-options">
<?php foreach ($block->getOrderOptions() as $_option): ?>
<dt><?= $block->escapeHtml($_option['label']) ?>:</dt>
<dd>
<?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
<?= /* @noEscape */ $block->getCustomizedOptionValue($_option) ?>
<?php else: ?>
<?php $_option = $block->getFormattedOption($_option['value']); ?>
<?php $dots = 'dots' . uniqid(); ?>
<?php $id = 'id' . uniqid(); ?>
<?= $block->escapeHtml($_option['value'], ['a', 'br']) ?>
<?php if (isset($_option['remainder']) && $_option['remainder']): ?>
<span id="<?= /* @noEscape */ $dots; ?>"> ...</span>
<span id="<?= /* @noEscape */ $id; ?>">
<?= $block->escapeHtml($_option['remainder'], ['a']) ?>
</span>
<?php $scriptString = <<<script
require(['prototype'], function() {
script;
$scriptString .= "$('" . /* @noEscape */ $id . "').hide();" . PHP_EOL;
$scriptString .= "$('" . /* @noEscape */ $id .
"').up().observe('mouseover', function(){ $('" . /* @noEscape */ $id . "').show();});" .
PHP_EOL;
$scriptString .= "$('" . /* @noEscape */ $id .
"').up().observe('mouseover', function(){ $('" . /* @noEscape */ $dots .
"').hide();});" . PHP_EOL;
$scriptString .= "$('" . /* @noEscape */ $id .
"').up().observe('mouseout', function(){ $('" . /* @noEscape */ $id .
"').hide();});" . PHP_EOL;
$scriptString .= "$('" . /* @noEscape */ $id .
"').up().observe('mouseout', function(){ $('" . /* @noEscape */ $dots .
"').show();});" . PHP_EOL . "});" . PHP_EOL;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
<?php endif; ?>
<?php endif; ?>
</dd>
<?php endforeach; ?>
</dl>
<?php endif; ?>
<?= $block->escapeHtml($_item->getDescription()) ?>
<?php endif; ?>
@@ -0,0 +1,43 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php if ($item = $block->getItem()) : ?>
<table class="qty-table">
<tr>
<th></th>
<td><?= (float) $item->getQtyOrdered() ?></td>
</tr>
<?php if ((float)$item->getQtyInvoiced()) : ?>
<tr>
<th></th>
<td><?= (float) $item->getQtyInvoiced() ?></td>
</tr>
<?php endif; ?>
<?php if ((float)$item->getQtyShipped()) : ?>
<tr>
<th></th>
<td><?= (float) $item->getQtyShipped() ?></td>
</tr>
<?php endif; ?>
<?php if ((float)$item->getQtyRefunded()) : ?>
<tr>
<th></th>
<td><?= (float) $item->getQtyRefunded() ?></td>
</tr>
<?php endif; ?>
<?php if ((float)$item->getQtyCanceled()) : ?>
<tr>
<th></th>
<td><?= (float) $item->getQtyCanceled() ?></td>
</tr>
<?php endif; ?>
</table>
<?php endif; ?>
@@ -0,0 +1,13 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
$_item = $block->getItem();
?>
<div class="price-excl-tax">
<?= /* @noEscape */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
</div>
@@ -0,0 +1,11 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
$_item = $block->getItem();
?>
<?= /* @noEscape */ $block->displayPrices($block->getBaseTotalAmount($_item), $block->getTotalAmount($_item)) ?>
@@ -0,0 +1,13 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
$_item = $block->getItem();
?>
<div class="price-excl-tax">
<?= /* @noEscape */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
</div>
@@ -0,0 +1,26 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate
?>
<?= $block->escapeHtml($block->getItem()->getName()) ?>
<div><strong><?= $block->escapeHtml(__('SKU')) ?>:</strong> <?= /* @noEscape */ implode('<br />', $this->helper(\Magento\Catalog\Helper\Data::class)->splitSku($block->escapeHtml($block->getItem()->getSku()))) ?></div>
<?php if ($block->getOrderOptions()) : ?>
<ul class="item-options">
<?php foreach ($block->getOrderOptions() as $option) : ?>
<li><strong><?= $block->escapeHtml($option['label']) ?>:</strong><br />
<?php if (is_array($option['value'])) : ?>
<?php foreach ($option['value'] as $item) : ?>
<?= $block->getValueHtml($item) ?><br />
<?php endforeach; ?>
<?php else : ?>
<?= $block->escapeHtml($option['value']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?= $block->escapeHtml($block->getItem()->getDescription()) ?>
@@ -0,0 +1,46 @@
<?php
/* @var $block \Stemcell\Sales\Block\Adminhtml\Order\Reject */
$order = $block->getOrder();
$rejectUrl = $block->getRejectUrl();
?>
<?php if ($block->canReject()): ?>
<button id="order-reject-button"
class="action-default scalable"
type="button">
驳回
</button>
<div id="reject-modal" style="display:none;">
<form id="reject-form" method="post" action="<?php echo $rejectUrl; ?>">
<input type="hidden" name="form_key" value="<?php echo $block->getFormKey(); ?>"/>
<input type="hidden" name="order_id" value="<?php echo $order->getId(); ?>"/>
<label for="reason">Reject Reason</label>
<textarea name="reason" id="reason" style="width:100%; height:150px;"></textarea>
</form>
</div>
<script type="text/javascript">
require(['jquery', 'Magento_Ui/js/modal/modal'], function ($, modal) {
var options = {
type: 'popup',
title: 'Reject Order',
responsive: true,
buttons: [{
text: 'Submit',
class: 'action-primary',
click: function () {
$('#reject-form').submit();
}
}]
};
var popup = modal(options, $('#reject-modal'));
$('#order-reject-button').on('click', function () {
$('#reject-modal').modal('openModal');
});
});
</script>
<?php endif; ?>
@@ -0,0 +1,120 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Sales\Block\Adminhtml\Order\View\History $block */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<div id="order_history_block" class="edit-order-comments">
<?php if (0 && $block->canAddComment()): ?>
<div class="order-history-block" id="history_form">
<div class="admin__field">
<label for="history_status" class="admin__field-label"><?= $block->escapeHtml(__('Status')) ?></label>
<div class="admin__field-control">
<select name="history[status]" id="history_status" class="admin__control-select">
<?php foreach ($block->getStatuses() as $_code => $_label): ?>
<option value="<?= $block->escapeHtmlAttr($_code) ?>"
<?php if ($_code == $block->getOrder()->getStatus()): ?> selected="selected"
<?php endif; ?>>
<?= $block->escapeHtml($_label) ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="admin__field">
<label for="history_comment" class="admin__field-label">
<?= $block->escapeHtml(__('Comment')) ?>
</label>
<div class="admin__field-control">
<textarea name="history[comment]"
rows="3"
cols="5"
id="history_comment"
class="admin__control-textarea"></textarea>
<div class="admin__field-note">
<span>
<?= $block->escapeHtml(
__('A status change or comment text is required to submit a comment.')
)?>
</span>
</div>
</div>
</div>
<div class="admin__field">
<div class="order-history-comments-options">
<div class="admin__field admin__field-option">
<?php if ($block->canSendCommentEmail()): ?>
<input name="history[is_customer_notified]"
type="checkbox"
id="history_notify"
class="admin__control-checkbox"
value="1" />
<label class="admin__field-label" for="history_notify">
<?= $block->escapeHtml(__('Notify Customer by Email')) ?>
</label>
<?php endif; ?>
</div>
<div class="admin__field admin__field-option">
<input name="history[is_visible_on_front]"
type="checkbox"
id="history_visible"
class="admin__control-checkbox"
value="1" />
<label class="admin__field-label" for="history_visible">
<?= $block->escapeHtml(__('Visible on Storefront')) ?>
</label>
</div>
</div>
<div class="order-history-comments-actions">
<?= $block->getChildHtml('submit_button') ?>
</div>
</div>
</div>
<?php endif;?>
<ul class="note-list">
<?php foreach ($block->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
<li class="note-list-item">
<span class="note-list-date">
<?= /* @noEscape */ $block->formatDate($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?>
</span>
<span class="note-list-time">
<?= /* @noEscape */ $block->formatTime($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?>
</span>
<span class="note-list-status"><?= $block->escapeHtml($_item->getStatusLabel()) ?></span>
<span class="note-list-customer">
<?= $block->escapeHtml(__('Customer')) ?>
<?php if ($block->isCustomerNotificationNotApplicable($_item)): ?>
<span class="note-list-customer-notapplicable">
<?= $block->escapeHtml(__('Notification Not Applicable')) ?>
</span>
<?php elseif ($_item->getIsCustomerNotified()): ?>
<span class="note-list-customer-notified"><?= $block->escapeHtml(__('Notified')) ?></span>
<?php else: ?>
<span class="note-list-customer-not-notified"><?= $block->escapeHtml(__('Not Notified')) ?></span>
<?php endif; ?>
</span>
<?php if ($_item->getComment()): ?>
<div class="note-list-comment">
<?= $block->escapeHtml($_item->getComment(), ['b', 'br', 'strong', 'i', 'u', 'a']) ?>
</div>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php $scriptString = <<<script
require(['prototype'], function(){
if($('order_status'))$('order_status').update('{$block->escapeJs($block->getOrder()->getStatusLabel())}');
});
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
</div>
@@ -0,0 +1,190 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var \Magento\Sales\Block\Adminhtml\Order\View\Info $block
*/
$order = $block->getOrder();
$baseCurrencyCode = (string)$order->getBaseCurrencyCode();
$globalCurrencyCode = (string)$order->getGlobalCurrencyCode();
$orderCurrencyCode = (string)$order->getOrderCurrencyCode();
$orderAdminDate = $block->formatDate(
$block->getOrderAdminDate($order->getCreatedAt()),
\IntlDateFormatter::MEDIUM,
true
);
$orderStoreDate = $block->formatDate(
$order->getCreatedAt(),
\IntlDateFormatter::MEDIUM,
true,
$block->getTimezoneForStore($order->getStore())
);
$customerUrl = $block->getCustomerViewUrl();
$allowedAddressHtmlTags = ['b', 'br', 'em', 'i', 'li', 'ol', 'p', 'strong', 'sub', 'sup', 'ul'];
?>
<section class="admin__page-section order-view-account-information">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Order & Account Information')) ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-information">
<?php /* Order Information */ ?>
<?php $confirmationEmailStatusMessage = $order->getEmailSent() ? __('The order confirmation email was sent') : __('The order confirmation email is not sent'); ?>
<div class="admin__page-section-item-title">
<span class="title">
<?php if ($block->getNoUseOrderLink()) : ?>
<?= $block->escapeHtml(__('Order # %1', $order->getRealOrderId())) ?> (<span><?= $block->escapeHtml($confirmationEmailStatusMessage) ?></span>)
<?php else : ?>
<a href="<?= $block->escapeUrl($block->getViewUrl($order->getId())) ?>"><?= $block->escapeHtml(__('Order # %1', $order->getRealOrderId())) ?></a>
<span>(<?= $block->escapeHtml($confirmationEmailStatusMessage) ?>)</span>
<?php endif; ?>
</span>
</div>
<div class="admin__page-section-item-content">
<table class="admin__table-secondary order-information-table">
<tr>
<th><?= $block->escapeHtml(__('Order Date')) ?></th>
<td><?= $block->escapeHtml($orderAdminDate) ?></td>
</tr>
<?php if ($orderAdminDate != $orderStoreDate) : ?>
<tr>
<th><?= $block->escapeHtml(__('Order Date (%1)', $block->getTimezoneForStore($order->getStore()))) ?></th>
<td><?= $block->escapeHtml($orderStoreDate) ?></td>
</tr>
<?php endif;?>
<tr>
<th><?= $block->escapeHtml(__('Order Status')) ?></th>
<td><span id="order_status"><?= $block->escapeHtml($order->getStatusLabel()) ?></span></td>
</tr>
<?= $block->getChildHtml() ?>
<!-- --><?php //if ($block->isSingleStoreMode() == false) : ?>
<!-- <tr>-->
<!-- <th>--><?php //= $block->escapeHtml(__('Purchased From')) ?><!--</th>-->
<!-- <td>--><?php //= $block->escapeHtml($block->getOrderStoreName(), ['br']) ?><!--</td>-->
<!-- </tr>-->
<!-- --><?php //endif; ?>
<?php if ($order->getRelationChildId()) : ?>
<tr>
<th><?= $block->escapeHtml(__('Link to the New Order')) ?></th>
<td>
<a href="<?= $block->escapeUrl($block->getViewUrl($order->getRelationChildId())) ?>">
<?= $block->escapeHtml($order->getRelationChildRealId()) ?>
</a>
</td>
</tr>
<?php endif; ?>
<?php if ($order->getRelationParentId()) : ?>
<tr>
<th><?= $block->escapeHtml(__('Link to the Previous Order')) ?></th>
<td>
<a href="<?= $block->escapeUrl($block->getViewUrl($order->getRelationParentId())) ?>">
<?= $block->escapeHtml($order->getRelationParentRealId()) ?>
</a>
</td>
</tr>
<?php endif; ?>
<!-- --><?php //if ($order->getRemoteIp() && $block->shouldDisplayCustomerIp()) : ?>
<!-- <tr>-->
<!-- <th>--><?php //= $block->escapeHtml(__('Placed from IP')) ?><!--</th>-->
<!-- <td>--><?php //= $block->escapeHtml($order->getRemoteIp()); ?><!----><?php //= $order->getXForwardedFor() ? ' (' . $block->escapeHtml($order->getXForwardedFor()) . ')' : ''; ?><!--</td>-->
<!-- </tr>-->
<!-- --><?php //endif; ?>
<?php if ($globalCurrencyCode !== $baseCurrencyCode) : ?>
<tr>
<th><?= $block->escapeHtml(__('%1 / %2 rate:', $globalCurrencyCode, $baseCurrencyCode)) ?></th>
<td><?= $block->escapeHtml($order->getBaseToGlobalRate()) ?></td>
</tr>
<?php endif; ?>
<?php if ($baseCurrencyCode !== $orderCurrencyCode && $globalCurrencyCode !== $orderCurrencyCode) : ?>
<tr>
<th><?= $block->escapeHtml(__('%1 / %2 rate:', $orderCurrencyCode, $baseCurrencyCode)) ?></th>
<td><?= $block->escapeHtml($order->getBaseToOrderRate()) ?></td>
</tr>
<?php endif; ?>
</table>
</div>
</div>
<div class="admin__page-section-item order-account-information">
<?php /* Account Information */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Account Information')) ?></span>
<div class="actions">
<?php if ($customerUrl) : ?>
<a href="<?= /* @noEscape */ $customerUrl ?>" target="_blank">
<?= $block->escapeHtml(__('Edit Customer')) ?>
</a>
<?php endif; ?>
</div>
</div>
<div class="admin__page-section-item-content">
<table class="admin__table-secondary order-account-information-table">
<tr>
<th><?= $block->escapeHtml(__('Customer Name')) ?></th>
<td>
<?php if ($customerUrl) : ?>
<a href="<?= $block->escapeUrl($customerUrl) ?>" target="_blank">
<span><?= $block->escapeHtml($order->getCustomerName()) ?></span>
</a>
<?php else : ?>
<?= $block->escapeHtml($order->getCustomerName()) ?>
<?php endif; ?>
</td>
</tr>
<tr>
<th><?= $block->escapeHtml(__('Email')) ?></th>
<td><a href="mailto:<?= $block->escapeHtmlAttr($order->getCustomerEmail()) ?>"><?= $block->escapeHtml($order->getCustomerEmail()) ?></a></td>
</tr>
<?php if ($groupName = $block->getCustomerGroupName()) : ?>
<tr>
<th><?= $block->escapeHtml(__('Customer Group')) ?></th>
<td><?= $block->escapeHtml($groupName) ?></td>
</tr>
<?php endif; ?>
<?php foreach ($block->getCustomerAccountData() as $data) : ?>
<tr>
<th><?= $block->escapeHtml($data['label']) ?></th>
<td><?= $block->escapeHtml($data['value'], ['br']) ?></td>
</tr>
<?php endforeach;?>
<?= $block->getChildHtml('extra_customer_info') ?>
</table>
</div>
</div>
</div>
</section>
<section class="admin__page-section order-addresses">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Address Information')) ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-billing-address">
<?php /* Billing Address */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Billing Address')) ?></span>
<div class="actions"><?= /* @noEscape */ $block->getAddressEditLink($order->getBillingAddress()); ?></div>
</div>
<address class="admin__page-section-item-content"><?= $block->escapeHtml($block->getFormattedAddress($order->getBillingAddress()), $allowedAddressHtmlTags); ?></address>
</div>
<?php if (!$block->getOrder()->getIsVirtual()) : ?>
<div class="admin__page-section-item order-shipping-address">
<?php /* Shipping Address */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Shipping Address')) ?></span>
<div class="actions"><?= /* @noEscape */ $block->getAddressEditLink($order->getShippingAddress()); ?></div>
</div>
<address class="admin__page-section-item-content"><?= $block->escapeHtml($block->getFormattedAddress($order->getShippingAddress()), $allowedAddressHtmlTags); ?></address>
</div>
<?php endif; ?>
</div>
</section>
@@ -0,0 +1,92 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var \Magento\Sales\Block\Adminhtml\Order\View\Items $block
*/
$_order = $block->getOrder() ?>
<div class="admin__table-wrapper">
<table class="data-table admin__table-primary edit-order-table">
<thead>
<tr class="headings">
<?php $i = 0;
$columns = $block->getColumns();
$lastItemNumber = count($columns) ?>
<?php foreach ($columns as $columnName => $columnTitle) : ?>
<?php $i++; ?>
<th class="col-<?= $block->escapeHtmlAttr($columnName) ?><?= /* @noEscape */ ($i === $lastItemNumber ? ' last' : '') ?>"><span><?= $block->escapeHtml($columnTitle) ?></span></th>
<?php endforeach; ?>
</tr>
</thead>
<?php $_items = $block->getItemsCollection();?>
<?php $i = 0; foreach ($_items as $_item) : ?>
<?php if ($_item->getParentItem()) :
continue;
else :
$i++;
endif; ?>
<tbody class="<?= /* @noEscape */ $i%2 ? 'even' : 'odd' ?>">
<?= $block->getItemHtml($_item) ?>
<?= $block->getItemExtraInfoHtml($_item) ?>
</tbody>
<?php endforeach; ?>
</table>
</div>
<div id="reject-order-modal" style="display:none;">
<form id="reject_order_form"
method="post"
action="<?= $block->getUrl('stemcell_sales/order/reject') ?>"
enctype="multipart/form-data">
<?= $block->getBlockHtml('formkey'); ?>
<label>原因:</label>
<textarea name="reason" id="reject_reason" style="width:100%;height:120px;"></textarea>
<input type="hidden" name="order_id" value="<?= $block->getOrder()->getId(); ?>" />
</form>
</div>
<script type="text/javascript">
require([
'jquery',
'Magento_Ui/js/modal/modal'
], function ($, modal) {
window.orderReject = function () {
var modalEl = $('#reject-order-modal');
var options = {
type: 'popup',
title: '订单驳回',
modalClass: 'reject-order-popup',
buttons: [
{
text: 'Submit',
class: 'action-primary',
click: function () {
var reason = $('#reject_reason').val();
if (!reason) {
alert('请填写驳回的原因');
return;
}
$("#reject_order_form").submit();
}
}
]
};
modal(options, modalEl);
modalEl.modal('openModal');
};
});
</script>
@@ -0,0 +1,127 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Sales\Block\Adminhtml\Order\View\Tab\Info */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php $_order = $block->getOrder() ?>
<div id="order-messages">
<?= $block->getChildHtml('order_messages') ?>
</div>
<?= $block->getChildHtml('order_info') ?>
<input type="hidden" name="order_id" value="<?= (int) $_order->getId() ?>"/>
<section class="admin__page-section order-view-billing-shipping">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Payment &amp; Shipping Method')) ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-payment-method<?= ($_order->getIsVirtual() ?
' order-payment-method-virtual' : '') ?>">
<?php /* Payment Method */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Payment Information')) ?></span>
</div>
<div class="admin__page-section-item-content">
<div class="order-payment-method-title"><?= $block->getPaymentHtml() ?></div>
<div class="order-payment-currency">
<?= $block->escapeHtml(__('The order was placed using %1.', $_order->getOrderCurrencyCode())) ?>
</div>
<div class="order-payment-additional">
<?= $block->getChildHtml('order_payment_additional') ?>
<?= $block->getChildHtml('payment_additional_info') ?>
</div>
</div>
</div>
<?= $block->getChildHtml('order_shipping_view') ?>
</div>
</section>
<?= $block->getChildHtml('order_additional_info') ?>
<?= $block->getGiftOptionsHtml() ?>
<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Items Ordered')) ?></span>
</div>
<?= $block->getItemsHtml() ?>
</section>
<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Order Total')) ?></span>
</div>
<div class="admin__page-section-content" style="display: flex; gap: 30px">
<div class="admin__page-section-item order-totals" style="float: none">
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Order Totals')) ?></span>
</div>
<?= $block->getChildHtml('order_totals') ?>
</div>
<div class="admin__page-section-item order-comments-history" style="float: none">
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Notes for this Order')) ?></span>
</div>
<?= $block->getChildHtml('order_history') ?>
</div>
</div>
</section>
<?= $block->getChildHtml('popup_window') ?>
<style>
.page-columns .side-col {
display: none;
}
@media (min-width: 768px) {
.page-layout-admin-2columns-left .page-columns .main-col {
width: 100%;
float: none;
}
.page-layout-admin-2columns-left .page-columns {
margin-left: 0px;
}
}
</style>
<?php $scriptString = <<<script
require([
"prototype",
"Magento_Sales/order/giftoptions_tooltip"
], function(){
//<![CDATA[
/**
* Retrieve gift options tooltip content
*/
function getGiftOptionsTooltipContent(itemId) {
var contentLines = [];
var headerLine = null;
var contentLine = null;
\$$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
if (element.down(0)) {
headerLine = element.down(0).innerHTML;
contentLine = element.down(0).next().innerHTML;
if (contentLine.length > 30) {
contentLine = contentLine.slice(0,30) + '...';
}
contentLines.push(headerLine + ' ' + contentLine);
}
});
return contentLines.join('<br/>');
}
giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
//]]>
});
script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
@@ -0,0 +1,305 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<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">sales_order_grid.sales_order_grid_data_source</item>
</item>
</argument>
<settings>
<buttons>
<button name="add">
<url path="sales/order_create/start"/>
<class>primary</class>
<label translate="true">Create New Order</label>
<aclResource>Magento_Sales::create</aclResource>
</button>
</buttons>
<spinner>sales_order_columns</spinner>
<deps>
<dep>sales_order_grid.sales_order_grid_data_source</dep>
</deps>
</settings>
<dataSource name="sales_order_grid_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<updateUrl path="mui/index/render"/>
</settings>
<aclResource>Magento_Sales::sales_order</aclResource>
<dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="sales_order_grid_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>main_table.entity_id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<listingToolbar name="listing_top">
<settings>
<sticky>true</sticky>
</settings>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters">
<filterSelect name="store_id" provider="${ $.parentName }">
<settings>
<options class="Magento\Store\Ui\Component\Listing\Column\Store\Options"/>
<caption translate="true">All Store Views</caption>
<label translate="true">Purchase Point</label>
<dataScope>store_id</dataScope>
<imports>
<link name="visible">ns = ${ $.ns }, index = ${ $.index }:visible</link>
</imports>
</settings>
</filterSelect>
</filters>
<massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
<action name="cancel">
<settings>
<url path="sales/order/massCancel"/>
<type>cancel</type>
<label translate="true">Cancel</label>
</settings>
</action>
<action name="mass_review">
<settings>
<url path="stemcell_sales/*/massReview"/>
<type>mass_review</type>
<label translate="true">批量审核</label>
</settings>
</action>
<action name="hold_order">
<settings>
<url path="sales/order/massHold"/>
<type>hold_order</type>
<label translate="true">Hold</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="unhold_order">
<settings>
<url path="sales/order/massUnhold"/>
<type>unhold_order</type>
<label translate="true">Unhold</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="pdfinvoices_order">
<settings>
<url path="sales/order/pdfinvoices"/>
<type>pdfinvoices_order</type>
<label translate="true">Print Invoices</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="pdfshipments_order">
<settings>
<url path="sales/order/pdfshipments"/>
<type>pdfshipments_order</type>
<label translate="true">Print Packing Slips</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="pdfcreditmemos_order">
<settings>
<url path="sales/order/pdfcreditmemos"/>
<type>pdfcreditmemos_order</type>
<label translate="true">Print Credit Memos</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="pdfdocs_order">
<settings>
<url path="sales/order/pdfdocs"/>
<type>pdfdocs_order</type>
<label translate="true">Print All</label>
<actionDisable>true</actionDisable>
</settings>
</action>
<action name="print_shipping_label">
<settings>
<url path="adminhtml/order_shipment/massPrintShippingLabel"/>
<type>print_shipping_label</type>
<label translate="true">Print Shipping Labels</label>
<actionDisable>true</actionDisable>
</settings>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="sales_order_columns">
<settings>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">sales_order_grid.sales_order_grid.sales_order_columns.actions</item>
<item name="target" xsi:type="string">applyAction</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">view</item>
<item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
</item>
</param>
</childDefaults>
</settings>
<selectionsColumn name="ids" component="Magento_Sales/js/grid/columns/multiselect">
<settings>
<indexField>entity_id</indexField>
</settings>
</selectionsColumn>
<column name="increment_id">
<settings>
<filter>text</filter>
<label translate="true">ID</label>
</settings>
</column>
<column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store">
<settings>
<label translate="true">Purchase Point</label>
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
<sortable>false</sortable>
<visible>false</visible>
</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">Purchase Date</label>
<sorting>desc</sorting>
</settings>
</column>
<column name="billing_name">
<settings>
<filter>text</filter>
<label translate="true">Sold-to Name</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_name">
<settings>
<filter>text</filter>
<label translate="true">Ship-to Name</label>
</settings>
</column>
<column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
<settings>
<filter>textRange</filter>
<label translate="true">Grand Total (Base)</label>
</settings>
</column>
<column name="grand_total" class="Magento\Sales\Ui\Component\Listing\Column\PurchasedPrice">
<settings>
<filter>textRange</filter>
<label translate="true">Grand Total (Purchased)</label>
</settings>
</column>
<column name="status" component="Magento_Ui/js/grid/columns/select">
<settings>
<filter>select</filter>
<options class="Magento\Sales\Ui\Component\Listing\Column\Status\Options"/>
<dataType>select</dataType>
<label translate="true">Status</label>
</settings>
</column>
<column name="billing_address" class="Magento\Sales\Ui\Component\Listing\Column\Address">
<settings>
<filter>text</filter>
<label translate="true">Billing Address</label>
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
<visible>false</visible>
</settings>
</column>
<column name="shipping_address" class="Magento\Sales\Ui\Component\Listing\Column\Address">
<settings>
<filter>text</filter>
<label translate="true">Shipping Address</label>
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
<visible>false</visible>
</settings>
</column>
<column name="shipping_information">
<settings>
<filter>text</filter>
<label translate="true">Shipping Information</label>
<visible>false</visible>
</settings>
</column>
<column name="customer_email">
<settings>
<filter>text</filter>
<label translate="true">Customer Email</label>
<visible>false</visible>
</settings>
</column>
<column name="customer_group" component="Magento_Ui/js/grid/columns/select">
<settings>
<filter>select</filter>
<options class="Magento\Customer\Ui\Component\Listing\Column\Group\Options"/>
<dataType>select</dataType>
<label translate="true">Customer Group</label>
<visible>false</visible>
</settings>
</column>
<column name="subtotal" class="Magento\Sales\Ui\Component\Listing\Column\Price">
<settings>
<filter>textRange</filter>
<label translate="true">Subtotal</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_and_handling" class="Magento\Sales\Ui\Component\Listing\Column\Price">
<settings>
<filter>textRange</filter>
<label translate="true">Shipping and Handling</label>
<visible>false</visible>
</settings>
</column>
<column name="customer_name">
<settings>
<filter>text</filter>
<label translate="true">Customer Name</label>
<visible>false</visible>
</settings>
</column>
<column name="salesperson_name">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="sortable" xsi:type="boolean">false</item>
<item name="filter" xsi:type="string">false</item>
<item name="label" xsi:type="string" translate="true">销售</item>
</item>
</argument>
</column>
<column name="payment_method" component="Magento_Ui/js/grid/columns/select">
<settings>
<filter>select</filter>
<options class="Magento\Payment\Ui\Component\Listing\Column\Method\Options"/>
<dataType>select</dataType>
<label translate="true">Payment Method</label>
<visible>false</visible>
</settings>
</column>
<column name="total_refunded" class="Magento\Sales\Ui\Component\Listing\Column\PurchasedPrice">
<settings>
<filter>textRange</filter>
<label translate="true">Total Refunded</label>
<visible>false</visible>
</settings>
</column>
<actionsColumn name="actions" class="Magento\Sales\Ui\Component\Listing\Column\ViewAction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="viewUrlPath" xsi:type="string">sales/order/view</item>
<item name="urlEntityParamName" xsi:type="string">order_id</item>
</item>
</argument>
<settings>
<indexField>entity_id</indexField>
</settings>
</actionsColumn>
</columns>
</listing>
@@ -0,0 +1,49 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<!--@subject {{trans "在线商城-新订单"}} @-->
<!--@vars {
"var formattedBillingAddress|raw":"Billing Address",
"var order_data.email_customer_note|escape|nl2br":"Email Order Note",
"var order.increment_id":"Order Id",
"layout handle=\"sales_email_order_items\" order=$order area=\"frontend\"":"Order Items Grid",
"var payment_html|raw":"Payment Details",
"var formattedShippingAddress|raw":"Shipping Address",
"var order.shipping_description":"Shipping Description",
"var shipping_msg":"Shipping message",
"var created_at_formatted":"Order Created At (datetime)",
"var store.frontend_name":"Store Frontend Name",
"var store_phone":"Store Phone",
"var store_email":"Store Email",
"var store_hours":"Store Hours",
"var this.getUrl($store,'customer/account/',[_nosid:1])":"Customer Account URL",
"var order_data.is_not_virtual":"Order Type",
"var order":"Order",
"var order_id": "Order DB Id",
"var order_data.customer_name":"Customer Name"
} @-->
{{template config_path="design/email/header_template"}}
<table style="width: 100%">
<tr class="email-intro">
<td>
<p>
会员名称:{{trans "%customer_name," customer_name=$order_data.customer_name}}
</p>
<p>
{{trans '订单编号: <span class="no-link">#%increment_id</span>' increment_id=$order.increment_id |raw}}
</p>
</td>
</tr>
<tr class="email-information">
<td>
{{layout handle="sales_email_order_salesperson_items" order_id=$order_data.order_id order_items=$orderItems salesperson=$salesperson area="frontend"}}
</td>
</tr>
</table>
{{template config_path="design/email/footer_template"}}
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom">
<update handle="sales_email_order_renderers"/>
<update handle="sales_email_item_price"/>
<body>
<block class="Stemcell\Sales\Block\Order\Email\Items" name="items" template="Magento_Sales::email/items.phtml" cacheable="false">
<block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.renderers" as="renderer.list"/>
<block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="Magento_Sales::order/totals.phtml">
<arguments>
<argument name="label_properties" xsi:type="string">colspan="2"</argument>
</arguments>
<block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="Magento_Tax::order/tax.phtml">
<action method="setIsPlaneMode">
<argument name="value" xsi:type="string">1</argument>
</action>
</block>
</block>
</block>
<block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/>
</body>
</page>
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Order Items List" design_abstraction="custom">
<update handle="sales_email_order_renderers"/>
<update handle="sales_email_item_price"/>
<body>
<block class="Stemcell\Sales\Block\Order\Email\Salesperson\Items" name="items" template="Magento_Sales::email/salesperson/items.phtml" cacheable="false">
<block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.renderers" as="renderer.list"/>
<block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="Magento_Sales::order/totals.phtml">
<arguments>
<argument name="label_properties" xsi:type="string">colspan="2"</argument>
</arguments>
<block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="Magento_Tax::order/tax.phtml">
<action method="setIsPlaneMode">
<argument name="value" xsi:type="string">1</argument>
</action>
</block>
</block>
</block>
<block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/>
</body>
</page>