関数
Checkout::load( string $checkoutEndpoint, string $placement, string $productType = 'PayAndShip' )
Enqueues Amazon checkout JS
パラメータ パラメータ
- $checkoutEndpoint
(文字列) (必須)
- $placement
(文字列) (必須)
- $productType
(文字列) (任意)
ファイル: src/Components/AmazonCheckout/Checkout.php
public function load($checkoutEndpoint, $placement, $productType = 'PayAndShip') { $semantic = new Semantic(); $semantic->loadToastCss(); $semantic->loadTransitionCss(); $semantic->loadSemanticJS(); wp_enqueue_script( self::AMAZON_CHECKOUT_JS_SLUG, $this->module->getActingOpts()['amzjsurl'] . '/checkout.js', [], WCEXAAP_VERSION, false ); wp_enqueue_script( self::WCEXAAP_CHECKOUT_JS_SLUG, WCEXAAP_PLUGIN_URL . '/dist/checkout.js', [self::AMAZON_CHECKOUT_JS_SLUG], WCEXAAP_VERSION, true ); wp_localize_script( self::WCEXAAP_CHECKOUT_JS_SLUG, AmazonPay::L10N, array_merge( $this->module->getScriptInjectionVariables(), $this->getCheckoutInjectionVariables(), [ 'checkoutEndpoint' => $checkoutEndpoint, 'productType' => $productType, 'placement' => $placement, ] ) ); }