Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions woocommerce/payment-gateway/class-sv-wc-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,19 @@ protected function enqueue_payment_form_assets() {

$handle = 'sv-wc-payment-gateway-payment-form';
$versioned_handle = $handle . '-v5_15_13';
$wc_version = defined( 'WC_VERSION' ) ? WC_VERSION : WC()->version;
if (! $wc_version) {
$wc_version = $this->get_plugin()->get_assets_version();
}

// jquery.payment
wp_register_script( 'jquery-payment', WC()->plugin_url() . '/assets/js/jquery-payment/jquery.payment.min.js', [ 'jquery' ], $wc_version );

// Frontend JS
wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-payment' ), SV_WC_Plugin::VERSION, true );
wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', [ 'jquery-payment' ], SV_WC_Plugin::VERSION, true );

// Frontend CSS
wp_enqueue_style( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array(), SV_WC_Plugin::VERSION );
wp_enqueue_style( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', [], SV_WC_Plugin::VERSION );

// localized JS params
$this->localize_script( $versioned_handle, $this->get_payment_form_js_localized_script_params(), 'sv_wc_payment_gateway_payment_form_params' );
Expand Down
Loading