関数
CartPage::filterCartButton( string $html )
通常決済またはクイック決済チェックアウトオプションをカートページの次のボタンで返す
パラメータ パラメータ
- $html
(文字列) (必須)
ファイル: src/Views/CartPage/CartPage.php
public function filterCartButton($html) { if ($this->module->canProcessCart()) { $this->enqueueAssets(); /** * Filters the `商品を購入する` text displayed on the cart page next to the * Welcart default buttons * * @important * @param string $text */ $checkout_title = apply_filters( 'wcexaap_filter_cart_page_normal_checkout_title', esc_html__('Continue Checkout', 'wcexaap') ); /** * Filters the `ログインしてご注文いただけます。` text displayed on the cart page next to the * Welcart default buttons * * @important * @param string $text */ $checkout_message = apply_filters( 'wcexaap_filter_cart_page_normal_checkout_message', esc_html__('Login and continue checkout.', 'wcexaap') ); /** * Filters the `会員登録なしでもご注文できます。` text displayed on the cart page next to the * Welcart default buttons * * @important * @param string $text */ $checkout_submessage = apply_filters( 'wcexaap_filter_cart_page_normal_checkout_submessage', esc_html__('Non-members can also checkout.', 'wcexaap') ); // Cart button segment ob_start(); ?> <div class="cart-next"> <div class="text"> <h4><?php echo $checkout_title; ?></h4> <p> <?php echo $checkout_message; ?> <br> <span class="small"> <?php echo $checkout_submessage; ?> </span> </p> </div> <div class="cart-buttons"> <?php echo $this->getContinueShoppingButton(); ?> <input name="customerinfo" type="submit" class="pinkButton to_customerinfo_button" value="<?php echo esc_attr__('Checkout', 'wcexaap'); ?>" <?php /** * Mirrored Welcart filter * * @ignore */ echo apply_filters( 'usces_filter_cart_nextbutton', ' onclick="return uscesCart.cartNext();"' ); ?> /> </div> </div> <?php $cartbutton = ob_get_contents(); ob_end_clean(); /** * Filters the cart buttons row HTML on the cart page * * @param string $cartbutton * @param string $checkout_title See {@see 'wcexaap_filter_cart_page_normal_checkout_title'} * @param string $checkout_message See {@see 'wcexaap_filter_cart_page_normal_checkout_message'} * @param string $checkout_submessage See {@see 'wcexaap_filter_cart_page_normal_checkout_submessage'} */ $cartbutton = apply_filters( 'wcexaap_filter_cart_button_segment', $cartbutton, $checkout_title, $checkout_message, $checkout_submessage ); /** * Filters the `Amazon アカウントでも決済できます` text displayed on the cart page next to * the Amazon Pay button * * @important * @param string $text */ $qp_title = apply_filters( 'wcexaap_filter_cart_page_quickpay_title', esc_html__('Pay with Amazon', 'wcexaap') ); /** * Filters the `Amazon.co.jp に登録している情報を使って簡単にお支払いができるサービスです。` * text displayed on the cart page next to the Amazon Pay button * * @important * @param string $text */ $qp_message = apply_filters( 'wcexaap_filter_cart_page_quickpay_message', esc_html(__('Use your Amazon account details to make a purchase.', 'wcexaap')) ); // Quickpay Amazon login button segment ob_start(); ?> <div class="cart-next amazon-next"> <div class="text"> <h4> <?php echo $qp_title; ?> </h4> <p> <?php echo $qp_message; ?> <br> </p> </div> <div class="cart-buttons"> <?php echo Checkout::getAmazonPayButton(); ?> </div> </div> <?php $quickpaybutton = ob_get_contents(); ob_end_clean(); /** * Filters the Amazon Pay button row HTML on the cart page * * @param string $quickpaybutton * @param string $qp_title See {@see 'wcexaap_filter_cart_page_quickpay_title'} * @param string $qp_message See {@see 'wcexaap_filter_cart_page_quickpay_message'} */ $quickpaybutton = apply_filters( 'wcexaap_filter_cart_amzpay_button_segment', $quickpaybutton, $qp_title, $qp_message ); $opts = $this->module->getActingOpts(); $order = [ 'above' => $opts['quickpay_btn_position'] === 'above' ? $quickpaybutton : $cartbutton, 'below' => $opts['quickpay_btn_position'] === 'below' ? $quickpaybutton : $cartbutton, ]; ob_start(); ?> <div class="line clearfix"> <div></div> <div>or</div> <div></div> </div> <?php $clearfixline = ob_get_contents(); ob_end_clean(); /** * Filters the divider line HTML shown between the Amazon Pay button and Welcart * default buttons on the cart page * * @param string $line */ $clearfixline = apply_filters('wcexaap_filter_cart_page_line_divider', $clearfixline); ob_start(); ?> <div id="cart_checkout_box" class="clearfix"> <?php echo $order['above']; ?> <?php echo $clearfixline; ?> <?php echo $order['below']; ?> </div> <?php $html = ob_get_contents(); ob_end_clean(); /** * Filters all of the Amazon Pay plugin HTML shown on the cart page * * Includes the Amazon Pay button and Welcart default cart buttons * * @param string $html * @param string $cartbutton See {@see 'wcexaap_filter_cart_button_segment'} * @param string $quickpaybutton See {@see 'wcexaap_filter_cart_amzpay_button_segment'} * @param string $checkout_title See {@see 'wcexaap_filter_cart_page_normal_checkout_title'} * @param string $checkout_message See {@see 'wcexaap_filter_cart_page_normal_checkout_message'} * @param string $checkout_submessage See {@see 'wcexaap_filter_cart_page_normal_checkout_submessage'} * @param string $qp_message See {@see 'wcexaap_filter_cart_page_quickpay_message'} * @param string $qp_title See {@see 'wcexaap_filter_cart_page_quickpay_title'} * @param string $line See {@see 'wcexaap_filter_cart_page_line_divider'} */ $html = apply_filters( 'wcexaap_filter_cart_page_next_buttons', $html, $cartbutton, $quickpaybutton, $checkout_title, $checkout_message, $checkout_submessage, $qp_message, $qp_title, $clearfixline ); } return $html; }