関数
ChangeActions::load( string $checkoutSessionId, array $changeAddressIds, array $changePaymentMethodIds = array() )
Enqueues Amazon checkout JS and bind change actions
パラメータ パラメータ
- $checkoutSessionId
(文字列) (必須)
- $changeAddressIds
(配列) (必須)
- $changePaymentMethodIds
(配列) (任意)
ファイル: src/Components/AmazonChangeActions/ChangeActions.php
public function load($checkoutSessionId, $changeAddressIds, $changePaymentMethodIds = []) { wp_enqueue_script( Checkout::AMAZON_CHECKOUT_JS_SLUG, $this->module->getActingOpts()['amzjsurl'] . '/checkout.js', [], WCEXAAP_VERSION, false ); wp_enqueue_script( self::WCEXAAP_CHANGE_ACTIONS_JS_SLUG, WCEXAAP_PLUGIN_URL . '/dist/amazonChangeActions.js', [Checkout::AMAZON_CHECKOUT_JS_SLUG], WCEXAAP_VERSION, true ); wp_localize_script( self::WCEXAAP_CHANGE_ACTIONS_JS_SLUG, AmazonPay::L10N, array_merge( $this->module->getScriptInjectionVariables(), [ 'changeAddressIds' => $changeAddressIds, 'changePaymentMethodIds' => $changePaymentMethodIds, 'checkoutSessionId' => $checkoutSessionId, ] ) ); }