• プラグイン一覧
    - WCEX Item Combo Set
    - WCEX Amazon Pay
    - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • お問い合わせ
  • サポート
    • よくある質問
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
    • リファレンス
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
新規会員登録
ログイン
新規会員登録
ログイン
カート
  • プラグイン一覧
    • - WCEX Item Combo Set
    • - WCEX Amazon Pay
    • - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • サポート
    • - よくある質問
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
    • - リファレンス
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
  • お問い合わせ
Aivec APPs > WCEX Amazon Pay > クラス > PointsForm
レファレンス
バージョン
2.6.4
絞り込み:

目次

  • ソース
  • 関数

フック

  • アクション
  • フィルター

ファンクション

    クラス

    PointsForm

    Points form Vue component

    ソース #ソース

    ファイル: src/Components/PointsForm/PointsForm.php

    class PointsForm extends VueComponent
    {
        /**
         * Loads CSS
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return void
         */
        public function init() {
            add_action('wp_enqueue_scripts', function () {
                (new Semantic())->loadButtonCss();
            });
        }
    
        /**
         * Returns component name as is recognized by Vue.
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getComponentName() {
            return 'pointsFormComponent';
        }
    
        /**
         * Points form component template.
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @global array $usces_members
         * @global array $usces_entries
         * @return void
         */
        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
        }
    }
    

    ソースを伸ばす ソースを縮める


    関数 #関数

    Top ↑

    • getComponentName — Returns component name as is recognized by Vue.
    • init — Loads CSS
    • template — Points form component template.

    • 新規会員登録
    • ログイン
      • プラグイン一覧
      • 会社概要
      • リリース情報
      • よくある質問
      • お役立ちコラム
      • お問い合わせ
      • 個人情報保護方針
      • 特定商取引法に基づく表記
      • 情報セキュリティ基本方針
      • 利用規約

    アイベック合同会社は「Welcart」「Amazon Pay」の公式パートナーです。

    ※Amazon、Amazon.co.jp、Amazon Payおよびそれらのロゴは、Amazon.com,inc.またはその関連会社の商標です。
    ※LINE Pay、およびLINE Pay 提携サービスのロゴは、法律上保護を受ける商標です。

    © 2025 Aivec llc All Rights Reserved.