init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Company $block */
|
||||
?>
|
||||
<div class="field company <?= $block->isRequired() ? 'required' : '' ?>">
|
||||
<label for="company" class="label">
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('公司名称')) ?>
|
||||
</span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<?php
|
||||
$_validationClass = $block->escapeHtmlAttr(
|
||||
$this->helper(\Magento\Customer\Helper\Address::class)
|
||||
->getAttributeValidationClass('company')
|
||||
);
|
||||
?>
|
||||
<input type="text"
|
||||
name="company"
|
||||
id="company"
|
||||
value="<?= $block->escapeHtmlAttr($block->getCompany()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Company')) ?>"
|
||||
class="input-text <?= $_validationClass ?: '' ?>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
|
||||
/** @var \Magento\Customer\Block\Widget\Dob $block */
|
||||
|
||||
/*
|
||||
<?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
|
||||
->setDate($block->getCustomer()->getDob())
|
||||
->toHtml() ?>
|
||||
|
||||
For checkout/onepage/billing.phtml:
|
||||
|
||||
<?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
|
||||
->setDate($block->getCustomer()->getDob())
|
||||
->setFieldIdFormat('billing:%s')
|
||||
->setFieldNameFormat('billing[%s]')
|
||||
->toHtml() ?>
|
||||
|
||||
NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css. Alternatively we could calculate widths
|
||||
automatically using block input parameters.
|
||||
*/
|
||||
|
||||
$translatedCalendarConfigJson = $block->getTranslatedCalendarConfigJson();
|
||||
$fieldCssClass = 'field date field-' . $block->getHtmlId();
|
||||
$fieldCssClass .= $block->isRequired() ? ' required' : '';
|
||||
?>
|
||||
<div class="<?= $block->escapeHtmlAttr($fieldCssClass) ?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getHtmlId()) ?>">
|
||||
<span><?= $block->escapeHtml($block->getStoreLabel('dob')) ?></span>
|
||||
</label>
|
||||
<div class="control customer-dob">
|
||||
<?= $block->getFieldHtml() ?>
|
||||
<?php if ($_message = $block->getAdditionalDescription()): ?>
|
||||
<div class="note"><?= $block->escapeHtml($_message) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"*": {
|
||||
"Magento_Customer/js/validation": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php $scriptString = <<<code
|
||||
|
||||
require([
|
||||
'jquery',
|
||||
'jquery-ui-modules/datepicker'
|
||||
], function($){
|
||||
|
||||
//<![CDATA[
|
||||
$.extend(true, $, {
|
||||
calendarConfig: {$translatedCalendarConfigJson}
|
||||
});
|
||||
//]]>
|
||||
|
||||
});
|
||||
code;
|
||||
?>
|
||||
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Fax $block */
|
||||
?>
|
||||
|
||||
<div class="field fax <?= $block->isRequired() ? 'required' : '' ?>">
|
||||
<label for="fax" class="label">
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('Fax')) ?>
|
||||
</span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<?php
|
||||
$_validationClass = $block->escapeHtmlAttr(
|
||||
$this->helper(\Magento\Customer\Helper\Address::class)
|
||||
->getAttributeValidationClass('fax')
|
||||
);
|
||||
?>
|
||||
<input type="text"
|
||||
name="fax"
|
||||
id="fax"
|
||||
value="<?= $block->escapeHtmlAttr($block->getFax()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Fax')) ?>"
|
||||
class="input-text <?= $_validationClass ?: '' ?>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Gender $block */
|
||||
?>
|
||||
<div class="field gender<?= $block->isRequired() ? ' required' : ''?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('gender')) ?>"><span><?= $block->escapeHtml($block->getStoreLabel('gender')) ?></span></label>
|
||||
<div class="control">
|
||||
<select id="<?= $block->escapeHtmlAttr($block->getFieldId('gender')) ?>" name="<?= $block->escapeHtmlAttr($block->getFieldName('gender')) ?>" title="<?= $block->escapeHtmlAttr($block->getStoreLabel('gender')) ?>"<?php if ($block->isRequired()) : ?> class="validate-select" data-validate="{required:true}"<?php endif; ?>>
|
||||
<?php $options = $block->getGenderOptions(); ?>
|
||||
<?php $value = $block->getGender(); ?>
|
||||
<?php foreach ($options as $option) : ?>
|
||||
<option value="<?= $block->escapeHtmlAttr($option->getValue()) ?>"<?= ($option->getValue() == $value) ? ' selected="selected"' : '' ?>><?= $block->escapeHtml(__($option->getLabel())) ?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Name $block */
|
||||
|
||||
/*
|
||||
<?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')
|
||||
->setObject($block->getAddress())
|
||||
->toHtml() ?>
|
||||
|
||||
For checkout/onepage/shipping.phtml:
|
||||
|
||||
<?= $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')
|
||||
->setObject($block->getAddress())
|
||||
->setFieldIdFormat('shipping:%s')
|
||||
->setFieldNameFormat('shipping[%s]')
|
||||
->toHtml() ?>
|
||||
*/
|
||||
|
||||
$prefix = $block->showPrefix();
|
||||
$middle = $block->showMiddlename();
|
||||
$suffix = $block->showSuffix();
|
||||
?>
|
||||
<?php if (($prefix || $middle || $suffix) && !$block->getNoWrap()): ?>
|
||||
<div class="field required fullname <?= $block->escapeHtmlAttr($block->getContainerClassName()) ?>">
|
||||
<label for="<?= $block->escapeHtmlAttr($block->getFieldId('firstname')) ?>" class="label">
|
||||
<span><?= $block->escapeHtml(__('Name')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<fieldset class="fieldset fieldset-fullname">
|
||||
<div class="fields">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($prefix): ?>
|
||||
<div class="field field-name-prefix<?= $block->isPrefixRequired() ? ' required' : '' ?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('prefix')) ?>">
|
||||
<span><?= $block->escapeHtml($block->getStoreLabel('prefix')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<?php if ($block->getPrefixOptions() === false): ?>
|
||||
<input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('prefix')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('prefix')) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($block->getObject()->getPrefix()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('prefix')) ?>"
|
||||
class="input-text
|
||||
<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('prefix')) ?>"
|
||||
<?= $block->isPrefixRequired() ? ' data-validate="{required:true}"' : '' ?>>
|
||||
<?php else: ?>
|
||||
<select id="<?= $block->escapeHtmlAttr($block->getFieldId('prefix')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('prefix')) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('prefix')) ?>"
|
||||
class="<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('prefix')) ?>"
|
||||
<?= $block->isPrefixRequired() ? ' data-validate="{required:true}"' : '' ?> >
|
||||
<?php foreach ($block->getPrefixOptions() as $_option): ?>
|
||||
<option value="<?= $block->escapeHtmlAttr(__($_option)) ?>"
|
||||
<?php if ($block->getObject()->getPrefix() == $_option): ?>
|
||||
selected="selected"<?php endif; ?>>
|
||||
<?= $block->escapeHtml(__($_option)) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="field field-name-firstname required">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('firstname')) ?>">
|
||||
<span>经销商名称</span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('firstname')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('firstname')) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($block->getObject()->getFirstname()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('firstname')) ?>"
|
||||
class="input-text
|
||||
<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('firstname')) ?>"
|
||||
<?= ($block->getAttributeValidationClass('firstname') == 'required-entry') ? '
|
||||
data-validate="{required:true}"' : '' ?>>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($middle): ?>
|
||||
<?php $isMiddlenameRequired = $block->isMiddlenameRequired(); ?>
|
||||
<div class="field field-name-middlename<?= $isMiddlenameRequired ? ' required' : '' ?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('middlename')) ?>">
|
||||
<span><?= $block->escapeHtml($block->getStoreLabel('middlename')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('middlename')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('middlename')) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($block->getObject()->getMiddlename()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('middlename')) ?>"
|
||||
class="input-text
|
||||
<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('middlename')) ?>"
|
||||
<?= $isMiddlenameRequired ? ' data-validate="{required:true}"' : '' ?>>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($suffix): ?>
|
||||
<div class="field field-name-suffix<?= $block->isSuffixRequired() ? ' required' : '' ?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('suffix')) ?>">
|
||||
<span><?= $block->escapeHtml($block->getStoreLabel('suffix')) ?></span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<?php if ($block->getSuffixOptions() === false): ?>
|
||||
<input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('suffix')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('suffix')) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($block->getObject()->getSuffix()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('suffix')) ?>"
|
||||
class="input-text
|
||||
<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('suffix')) ?>"
|
||||
<?= $block->isSuffixRequired() ? ' data-validate="{required:true}"' : '' ?>>
|
||||
<?php else: ?>
|
||||
<select id="<?= $block->escapeHtmlAttr($block->getFieldId('suffix')) ?>"
|
||||
name="<?= $block->escapeHtmlAttr($block->getFieldName('suffix')) ?>"
|
||||
title="<?= $block->escapeHtmlAttr($block->getStoreLabel('suffix')) ?>"
|
||||
class="<?= $block->escapeHtmlAttr($block->getAttributeValidationClass('suffix')) ?>"
|
||||
<?= $block->isSuffixRequired() ? ' data-validate="{required:true}"' : '' ?>>
|
||||
<?php foreach ($block->getSuffixOptions() as $_option): ?>
|
||||
<option value="<?= $block->escapeHtmlAttr(__($_option)) ?>"
|
||||
<?php if ($block->getObject()->getSuffix() == $_option): ?>
|
||||
selected="selected"<?php endif; ?>>
|
||||
<?= $block->escapeHtml(__($_option)) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($prefix || $middle || $suffix) && !$block->getNoWrap()): ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Taxvat $block */
|
||||
?>
|
||||
<div class="field taxvat<?= $block->isRequired() ? ' required' : ''; ?>">
|
||||
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>"><span><?= $block->escapeHtml($block->getStoreLabel('taxvat')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>" name="<?= $block->escapeHtmlAttr($block->getFieldName('taxvat')) ?>" value="<?= $block->escapeHtmlAttr($block->getTaxvat()) ?>" title="<?= $block->escapeHtmlAttr($block->getStoreLabel('taxvat')) ?>" class="input-text <?= $block->escapeHtmlAttr($this->helper(\Magento\Customer\Helper\Address::class)->getAttributeValidationClass('taxvat')) ?>" <?= $block->isRequired() ? ' data-validate="{required:true}"' : '' ?>>
|
||||
</div>
|
||||
</div>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var \Magento\Customer\Block\Widget\Telephone $block */
|
||||
?>
|
||||
|
||||
<div class="field telephone <?= $block->isRequired() ? 'required' : '' ?>">
|
||||
<label for="telephone" class="label">
|
||||
<span>
|
||||
<?= $block->escapeHtml(__('电话号码')) ?>
|
||||
</span>
|
||||
</label>
|
||||
<div class="control">
|
||||
<input type="tel"
|
||||
name="telephone"
|
||||
id="telephone"
|
||||
value="<?= $block->escapeHtmlAttr($block->getTelephone()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>"
|
||||
class="input-text <?= $block->escapeHtmlAttr(
|
||||
$block->getAttributeValidationClass('telephone')
|
||||
) ?>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user