関数
GiftForm::template()
納品書コンポーネントテンプレートを印刷する
戻り値 戻り値
ファイル: src/Components/GiftForm/GiftForm.php
public function template() { $entries = isset($_SESSION['usces_entry']) ? $_SESSION['usces_entry'] : []; $entries['customer']['name1'] = isset($entries['customer']['name1']) ? $entries['customer']['name1'] : ''; $entries['customer']['name2'] = isset($entries['customer']['name2']) ? $entries['customer']['name2'] : ''; $entries['customer']['name3'] = isset($entries['customer']['name3']) ? $entries['customer']['name3'] : ''; $entries['customer']['name4'] = isset($entries['customer']['name4']) ? $entries['customer']['name4'] : ''; $propsAndEvents = []; if ($this->controlledComponent === true) { $propsAndEvents[] = '@update-gift-shipping="updateGiftShipping"'; } $allPropsAndEvents = join(' ', $propsAndEvents); ?> <gift-form-component inline-template <?php echo $allPropsAndEvents; ?>> <?php ob_start(); ?> <div> <table class="customer_form" id="gift_form"> <tbody> <tr> <th rowspan="2" scope="row"><?php _e('Gift shipping', 'wcexaap'); ?></th> <td> <div class="ui checkbox checkbox-wrapper"> <input v-model="gift_checkbox" @change="$emit('update-gift-shipping', $event.target.checked)" id="gift_checkbox" type="checkbox" class="hidden" > <label for="gift_checkbox" style="cursor:pointer;"> <?php _e('Check here if the delivery address is different from your home address', 'wcexaap'); ?> </label> </div> </td> </tr> </tbody> </table> <table v-show="gift_checkbox === true" border="0" cellpadding="0" cellspacing="0" class="customer_form" id="gift_fields_t" > <thead> <tr> <th colspan="3"> <div id="gift-form-header"> <h3><?php _e('Please enter your address details below', 'wcexaap'); ?></h3> </div> </th> </tr> </thead> <tr id="readonly_email_row"> <th scope="row"><?php _e('e-mail adress', 'usces'); ?></th> <td colspan="2"><span><?php echo esc_html($entries['customer']['mailaddress1']); ?></span></td> </tr> <?php $this->customerAddressForm('customer', $entries); ?> </table> </div> <?php $vuehtml = ob_get_clean(); ?> <?php /** * Filters the `gift-form-component` Vue component HTML shown on the Quickpay page * * @param string $vuehtml * @param \Aivec\Welcart\SettlementModules\AmazonPay\Components\GiftForm\GiftForm $instance */ echo apply_filters('wcexaap_checkout_review_filter_gift_form', $vuehtml, $this); ?> </gift-form-component> <?php }