Skip to content

Commit ef86ffd

Browse files
committed
fix: Fix undefined foreach argument warning
1 parent dd286db commit ef86ffd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

woocommerce-gateway-checkout-com/woocommerce-gateway-checkout-com.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function callback_for_setting_up_scripts() {
211211
$apm_settings = get_option('woocommerce_wc_checkout_com_alternative_payments_settings');
212212
$apm_enable = $apm_settings['enabled'] == true ? true : false;
213213

214-
if ($apm_enable) {
214+
if ($apm_enable && !empty($apm_settings['ckocom_apms_selector'])) {
215215
foreach ($apm_settings['ckocom_apms_selector'] as $value) {
216216
if($value == 'klarna') {
217217
wp_enqueue_script( 'cko-klarna-script', 'https://x.klarnacdn.net/kp/lib/v1/api.js', array( 'jquery' ) );

0 commit comments

Comments
 (0)