• プラグイン一覧
    - 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 Wishlist お気に入りリスト > クラス > ItemPage
レファレンス
バージョン
3.1.6
絞り込み:
目的から探す
お気に入りデータを取得 お気に入りページのHTMLを取得 スナックバーアラート

目次

  • ソース
  • 関数

フック

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

ファンクション

  • データ取得
  • ユーティリティー
  • 条件判断
  • 表示系

クラス

ItemPage

Item page HTML and JS

ソース #ソース

ファイル: src/React/ItemPage/ItemPage.php

class ItemPage extends ItemPageBase
{
    const SCRIPT_HANDLE = 'wcexwl-item-react';

    /**
     * Tracks whether the current SKU hidden input has been created
     *
     * @var bool
     */
    private $skutrackerset = false;

    /**
     * Loads our React app
     *
     * @author Evan D Shaw <evandanielshaw@gmail.com>
     * @return void
     */
    protected function loadImplementationAssets() {
        $assetsmap = include(WCEXWL_PLUGIN_DIR . '/dist/js/React/ItemPage/App.asset.php');
        wp_enqueue_script(
            self::SCRIPT_HANDLE,
            WCEXWL_PLUGIN_URL . '/dist/js/React/ItemPage/App.js',
            $assetsmap['dependencies'],
            $assetsmap['version'],
            true
        );
        wp_localize_script(
            self::SCRIPT_HANDLE,
            'wcexwl',
            array_merge(
                $this->master->getScriptInjectionVariables(),
                ['postId' => (int)get_the_ID()]
            )
        );
    }

    /**
     * Updates the value of the currently selected SKU when using `wcex_sku_select`
     *
     * @author Evan D Shaw <evandanielshaw@gmail.com>
     * @param int $post_id
     * @return void
     */
    public function updateCurrentSku($post_id) {
        ?>
        $('#wcexwl_itempage_current_sku_<?php echo $post_id; ?>').val(data['sku_enc']).trigger('change');
        <?php
    }

    /**
     * Adds wishlist button next to "Add to Cart" button on item pages
     *
     * @author Evan D Shaw <evandanielshaw@gmail.com>
     * @param string $html
     * @return string
     */
    public function addWishlistButton($html) {
        global $usces;

        $currentsku = urlencode($usces->itemsku['code']);
        ob_start();
        ?>
        <div class="wcexwl item-page-buttons flex row-wrap ai-stretch jc-flex-end ml-05rem-children-not-first mt-05rem-children">
            <?php echo $html; ?>
            <?php if ($this->skutrackerset === false) : ?>
                <input
                    type="hidden"
                    id="wcexwl_itempage_current_sku_<?php echo esc_attr((int)get_the_ID()); ?>"
                    value="<?php echo esc_attr($currentsku); ?>"
                />
                <?php $this->skutrackerset = true; ?>
            <?php endif; ?>
            <div
                class="wcexwl_react_app wcexwl flex row-wrap ai-stretch"
                id="wcexwl_itempage_app_<?php echo esc_attr($currentsku); ?>"
                name="<?php echo esc_attr($currentsku); ?>"
            ></div>
        </div>
        <?php
        $html = (string)ob_get_clean();

        return $html;
    }
}

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


関数 #関数

Top ↑

  • addWishlistButton — Adds wishlist button next to "Add to Cart" button on item pages
  • loadImplementationAssets — Loads our React app
  • updateCurrentSku — Updates the value of the currently selected SKU when using `wcex_sku_select`

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

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

※Amazon、Amazon.co.jp、Amazon Payおよびそれらのロゴは、Amazon.com,inc.またはその関連会社の商標です。

© 2025 Aivec llc All Rights Reserved.