関数
PointsForm::template()
ポイントフォームコンポーネントのテンプレート
戻り値 戻り値
ファイル: src/Components/PointsForm/PointsForm.php
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | public function template() { global $usces_members , $usces_entries ; $propsAndEvents = []; if ( $this ->controlledComponent === true) { $propsAndEvents [] = 'v-bind:loading-prop="loading"' ; $propsAndEvents [] = 'v-bind:purchase-payload="purchasePayload"' ; $propsAndEvents [] = '@update-payload="updatePayload"' ; $propsAndEvents [] = '@update-order="updateOrder"' ; $propsAndEvents [] = '@update-loading="updateLoading"' ; } $allPropsAndEvents = join( ' ' , $propsAndEvents ); /** * Filters the button CSS class of the `points-form-component` Vue component shown on the Quickpay page * * @important * @param string $btnclass */ $btnclass = apply_filters( 'wcexaap_filter_checkout_review_points_form_button_class' , 'ui ' . AmazonPay::getThemeConfig()[ 'btnprimary' ] . ' basic button' ); ?> <points-form-component v-bind:usedpoint-session-val= "<?php echo (int)esc_html($usces_entries['order']['usedpoint']); ?>" <?php echo $allPropsAndEvents ; ?> inline-template > <?php ob_start(); ?> <div> <div v-cloak v- if = "errorMessage" class = "error_message" v-html= "errorMessage" ></div> <?php ob_start(); ?> <table cellspacing= "0" id= "point_table" > <tr> <td class = "c-point" ><?php echo esc_html__( 'The current point' , 'usces' ); ?></td> <td><span class = "point" ><?php echo $usces_members [ 'point' ]; ?></span>pt</td> </tr> <tr> <td class = "u-point" ><?php echo esc_html__( 'Points you are using here' , 'usces' ); ?></td> <td> <input name= "offer[usedpoint]" class = "used_point" type= "text" v-model= "usedpoints" /> pt </td> </tr> <tr> <td colspan= "2" class = "point-btn" > <?php ob_start(); ?> <button v-on:click.stop.prevent= "usePoints" class = "<?php echo esc_attr($btnclass); ?>" v-bind: class = "{ disabled: loading }" name= "use_point" > <?php esc_html_e( 'Use the points' , 'usces' ); ?> </button> <?php $buttonhtml = ob_get_clean(); /** * Filters the button HTML of the `points-form-component` Vue component shown on * the Quickpay page * * @param string $buttonhtml * @param string $btnclass See {@see 'wcexaap_filter_checkout_review_points_form_button_class'} */ echo apply_filters( 'wcexaap_checkout_review_filter_points_form_button_html' , $buttonhtml , $btnclass ); ?> </td> </tr> </table> <?php $tablehtml = ob_get_clean(); /** * Filters the table HTML of the `points-form-component` Vue component shown on * the Quickpay page * * @param string $tablehtml * @param string $btnclass See {@see 'wcexaap_filter_checkout_review_points_form_button_class'} */ echo apply_filters( 'wcexaap_checkout_review_filter_points_table' , $tablehtml , $btnclass ); /** * Mirrored Welcart action hook * * @ignore */ do_action( 'usces_action_confirm_page_point_inform' ); ?> </div> <?php $vuehtml = ob_get_clean(); /** * Filters all HTML of the `points-form-component` Vue component shown on the Quickpay page * * @param string $vuehtml * @param string $btnclass See {@see 'wcexaap_filter_checkout_review_points_form_button_class'} */ echo apply_filters( 'wcexaap_checkout_review_filter_points_form' , $vuehtml , $btnclass ); ?> </points-form-component> <?php } |