Plugin Directory


Ignore:
Timestamp:
03/07/2024 07:06:31 AM (14 months ago)
Author:
wpswings
Message:

released version 2.6.7

Location:
woo-gift-cards-lite
Files:
120 added
9 edited

Legend:

Unmodified
Added
Removed
  • woo-gift-cards-lite/trunk/admin/class-woocommerce-gift-cards-lite-admin.php

    r3019308 r3046745  
    9797            wp_enqueue_style( 'woocommerce_admin_styles' );
    9898            if ( ! wps_uwgc_pro_active() ) {
    99                
    100                 wp_enqueue_style( $this->plugin_name.'tmp', plugin_dir_url( __FILE__ ) . 'css/woocommerce_gift_cards_import_tmp.css', array(), time(), 'all' );
    101                
    102             }
    103         }
    104        
     99
     100                wp_enqueue_style( $this->plugin_name . 'tmp', plugin_dir_url( __FILE__ ) . 'css/woocommerce_gift_cards_import_tmp.css', array(), time(), 'all' );
     101
     102            }
     103        }
     104
    105105    }
    106106
     
    115115        wp_enqueue_script( 'thickbox' );
    116116        if ( isset( $screen->id ) ) {
    117             if (  wps_uwgc_pro_active() ) {
    118                 wp_enqueue_script( 'pro_tag_remove_class', plugin_dir_url( __FILE__ ) . '/js/wps_wgm_gift_card_pro_admin.js',array( 'jquery' ), time(), true );
     117            if ( wps_uwgc_pro_active() ) {
     118                wp_enqueue_script( 'pro_tag_remove_class', plugin_dir_url( __FILE__ ) . '/js/wps_wgm_gift_card_pro_admin.js', array( 'jquery' ), time(), true );
    119119            }
    120120            $pagescreen = $screen->id;
     
    186186
    187187            }
    188        
    189188        }
    190189    }
     
    11901189     */
    11911190    public function wps_wgm_preview_email_template() {
    1192    
    1193         if ( isset( $_GET['wps_wgm_template'] ) ) {
    1194            
    1195             if ( isset( $_GET['wps_wgm_template'] ) == 'giftcard' ) {
    1196                 $post_id                  = isset( $_GET['post_id'] ) ? sanitize_text_field( wp_unslash( $_GET['post_id'] ) ) : '';
    1197                 $todaydate                = date_i18n( 'Y-m-d' );
    1198                 $wps_wgm_general_settings = get_option( 'wps_wgm_general_settings', false );
    1199                                 $local_expiry_day = get_post_meta( $post_id, 'wps_wgm_local_setting_giftcard_expiry', true );
    1200                 if ( empty( $local_expiry_day ) || 0 == $local_expiry_day ) {
    1201                     $expiry_date = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_expiry' );
    1202                 } else {
    1203                     $expiry_date = $local_expiry_day;
    1204                 }
    1205 
    1206                                 $expirydate_format             = $this->wps_common_fun->wps_wgm_check_expiry_date( $expiry_date );
    1207                 $wps_wgm_coupon_length_display = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_coupon_length' );
    1208 
    1209                 if ( '' == $wps_wgm_coupon_length_display ) {
    1210                     $wps_wgm_coupon_length_display = 5;
    1211                 }
    1212                 $password = '';
    1213                 for ( $i = 0;$i < $wps_wgm_coupon_length_display;$i++ ) {
    1214                     $password .= 'x';
    1215                 }
    1216                 $giftcard_prefix = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_prefix' );
    1217                 $coupon          = $giftcard_prefix . $password;
    1218                 $templateid      = $post_id;
    1219 
    1220                 $args['from']       = esc_html__( 'from@example.com', 'woo-gift-cards-lite' );
    1221                 $args['to']         = esc_html__( 'to@example.com', 'woo-gift-cards-lite' );
    1222                 $args['message']    = esc_html__( 'Your gift message will appear here which you send to your receiver. ', 'woo-gift-cards-lite' );
    1223                 $args['coupon']     = apply_filters( 'wps_wgm_static_coupon_img', $coupon );
    1224                 $args['expirydate'] = $expirydate_format;
    1225                 $args['amount']     = wc_price( 100 );
    1226                 $args['templateid'] = $templateid;
    1227                 $style              = '<style>
    1228                     table, th, tr, td {
    1229                         border: medium none;
     1191        if ( current_user_can( 'edit_others_posts' ) ) {
     1192
     1193            if ( isset( $_GET['wps_wgm_template'] ) ) {
     1194
     1195                if ( isset( $_GET['wps_wgm_template'] ) == 'giftcard' ) {
     1196                    $post_id                  = isset( $_GET['post_id'] ) ? sanitize_text_field( wp_unslash( $_GET['post_id'] ) ) : '';
     1197
     1198                    $wps_post_type = get_post_type( $post_id );
     1199                    if ( 'giftcard' == $wps_post_type ) {
     1200                        $todaydate                = date_i18n( 'Y-m-d' );
     1201                        $wps_wgm_general_settings = get_option( 'wps_wgm_general_settings', false );
     1202                                        $local_expiry_day = get_post_meta( $post_id, 'wps_wgm_local_setting_giftcard_expiry', true );
     1203                        if ( empty( $local_expiry_day ) || 0 == $local_expiry_day ) {
     1204                            $expiry_date = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_expiry' );
     1205                        } else {
     1206                            $expiry_date = $local_expiry_day;
     1207                        }
     1208
     1209                                        $expirydate_format             = $this->wps_common_fun->wps_wgm_check_expiry_date( $expiry_date );
     1210                        $wps_wgm_coupon_length_display = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_coupon_length' );
     1211
     1212                        if ( '' == $wps_wgm_coupon_length_display ) {
     1213                            $wps_wgm_coupon_length_display = 5;
     1214                        }
     1215                        $password = '';
     1216                        for ( $i = 0;$i < $wps_wgm_coupon_length_display;$i++ ) {
     1217                            $password .= 'x';
     1218                        }
     1219                        $giftcard_prefix = $this->wps_common_fun->wps_wgm_get_template_data( $wps_wgm_general_settings, 'wps_wgm_general_setting_giftcard_prefix' );
     1220                        $coupon          = $giftcard_prefix . $password;
     1221                        $templateid      = $post_id;
     1222
     1223                        $args['from']       = esc_html__( 'from@example.com', 'woo-gift-cards-lite' );
     1224                        $args['to']         = esc_html__( 'to@example.com', 'woo-gift-cards-lite' );
     1225                        $args['message']    = esc_html__( 'Your gift message will appear here which you send to your receiver. ', 'woo-gift-cards-lite' );
     1226                        $args['coupon']     = apply_filters( 'wps_wgm_static_coupon_img', $coupon );
     1227                        $args['expirydate'] = $expirydate_format;
     1228                        $args['amount']     = wc_price( 100 );
     1229                        $args['templateid'] = $templateid;
     1230                        $style              = '<style>
     1231                            table, th, tr, td {
     1232                                border: medium none;
     1233                            }
     1234                            table, th, tr, td {
     1235                                border: 0px !important;
     1236                            }
     1237                                #wps_gw_email {
     1238                            width: 630px !important;
     1239                        }
     1240                        </style>';
     1241                        $message            = $this->wps_common_fun->wps_wgm_create_gift_template( $args );
     1242                        $finalhtml          = $style . $message;
     1243
     1244                        if ( wps_uwgc_pro_active() ) {
     1245                            do_action( 'preview_email_template_for_pro', $finalhtml );
     1246                        } else {
     1247                            $allowed_tags = $this->wps_common_fun->wps_allowed_html_tags();
     1248                            // @codingStandardsIgnoreStart.
     1249                            echo wp_kses( $finalhtml, $allowed_tags );
     1250                            die();
     1251                            // @codingStandardsIgnoreEnd.
     1252                        }
    12301253                    }
    1231                     table, th, tr, td {
    1232                         border: 0px !important;
    1233                     }
    1234                         #wps_gw_email {
    1235                     width: 630px !important;
    1236                 }
    1237                 </style>';
    1238                 $message            = $this->wps_common_fun->wps_wgm_create_gift_template( $args );
    1239                 $finalhtml          = $style . $message;
    1240 
    1241                 if ( wps_uwgc_pro_active() ) {
    1242                     do_action( 'preview_email_template_for_pro', $finalhtml );
    1243                 } else {
    1244                     $allowed_tags = $this->wps_common_fun->wps_allowed_html_tags();
    1245                     // @codingStandardsIgnoreStart.
    1246                     echo wp_kses( $finalhtml, $allowed_tags );
    1247                     die();
    1248                     // @codingStandardsIgnoreEnd.
    12491254                }
    12501255            }
     
    13051310     */
    13061311    public function wps_wgm_set_cron_for_plugin_notification() {
    1307        
     1312
    13081313            $offset = get_option( 'gmt_offset' );
    13091314            $time   = time() + $offset * 60 * 60;
     
    13131318
    13141319        }
    1315    
     1320
    13161321    }
    13171322
     
    16021607            )
    16031608        );
    1604        
     1609
    16051610        if ( is_wp_error( $wps_response ) ) {
    16061611            $error_message = $wps_response->get_error_message();
     
    16961701                                                <i class="fas fa-eye wps_preview_template"></i>
    16971702                                            </a>
    1698                                             <?php
    1699                                             ?>
    1700                                             <i class="fas fa-download wps_download_template" data-id="<?php echo esc_attr( stripslashes( $temp_data['template_id'] ) ); ?>"></i>
     1703                                                                                        <i class="fas fa-download wps_download_template" data-id="<?php echo esc_attr( stripslashes( $temp_data['template_id'] ) ); ?>"></i>
    17011704                                            <div class="wps_template_import_note">
    17021705                                                <p class="wps_note"><?php esc_html_e( 'Import this template.', 'woo-gift-cards-lite' ); ?></p>
  • woo-gift-cards-lite/trunk/includes/class-makewebbetter-onboarding-helper.php

    r3019308 r3046745  
    118118            self::$version = WPS_WGC_VERSION;
    119119        } else {
    120             self::$version = '2.6.6';
     120            self::$version = '2.6.7';
    121121        }
    122122
  • woo-gift-cards-lite/trunk/includes/class-woocommerce-gift-cards-lite.php

    r3019308 r3046745  
    6767            $this->version = WPS_WGC_VERSION;
    6868        } else {
    69             $this->version = '2.6.6';
     69            $this->version = '2.6.7';
    7070        }
    7171        $this->plugin_name = 'woo-gift-cards-lite';
  • woo-gift-cards-lite/trunk/languages/woo-gift-cards-lite-en_US.po

    r3019308 r3046745  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Ultimate Gift Cards For WooCommerce 2.6.6\n"
    4 "POT-Creation-Date: 2024-01-08 15:19+0530\n"
    5 "PO-Revision-Date: 2024-01-08 15:19+0530\n"
     3"Project-Id-Version: Ultimate Gift Cards For WooCommerce 2.6.7\n"
     4"POT-Creation-Date: 2024-03-07 11:17+0530\n"
     5"PO-Revision-Date: 2024-03-07 11:27+0530\n"
    66"Last-Translator: \n"
    77"Language-Team: WP Swings\n"
     
    267267msgstr ""
    268268
    269 #: admin/class-woocommerce-gift-cards-lite-admin.php:1220
     269#: admin/class-woocommerce-gift-cards-lite-admin.php:1225
    270270msgid "from@example.com"
    271271msgstr ""
    272272
    273 #: admin/class-woocommerce-gift-cards-lite-admin.php:1221
     273#: admin/class-woocommerce-gift-cards-lite-admin.php:1226
    274274msgid "to@example.com"
    275275msgstr ""
    276276
    277 #: admin/class-woocommerce-gift-cards-lite-admin.php:1222
     277#: admin/class-woocommerce-gift-cards-lite-admin.php:1227
    278278msgid "Your gift message will appear here which you send to your receiver. "
    279279msgstr ""
    280280
    281 #: admin/class-woocommerce-gift-cards-lite-admin.php:1267
     281#: admin/class-woocommerce-gift-cards-lite-admin.php:1275
    282282#: admin/partials/woocommerce-gift-cards-lite-admin-display.php:198
    283283msgid "Demo"
    284284msgstr ""
    285285
    286 #: admin/class-woocommerce-gift-cards-lite-admin.php:1268
     286#: admin/class-woocommerce-gift-cards-lite-admin.php:1276
    287287msgid "Documentation"
    288288msgstr ""
    289289
    290 #: admin/class-woocommerce-gift-cards-lite-admin.php:1269
     290#: admin/class-woocommerce-gift-cards-lite-admin.php:1277
    291291msgid "Video"
    292292msgstr ""
    293293
    294 #: admin/class-woocommerce-gift-cards-lite-admin.php:1270
     294#: admin/class-woocommerce-gift-cards-lite-admin.php:1278
    295295msgid "Support"
    296296msgstr ""
    297297
    298 #: admin/class-woocommerce-gift-cards-lite-admin.php:1271
     298#: admin/class-woocommerce-gift-cards-lite-admin.php:1279
    299299msgid "Services"
    300300msgstr ""
    301301
    302 #: admin/class-woocommerce-gift-cards-lite-admin.php:1473
     302#: admin/class-woocommerce-gift-cards-lite-admin.php:1481
    303303msgid "Welcome to Ultimate Gift Cards For WooCommerce"
    304304msgstr ""
    305305
    306 #: admin/class-woocommerce-gift-cards-lite-admin.php:1473
     306#: admin/class-woocommerce-gift-cards-lite-admin.php:1481
    307307msgid "– Create and sell multiple gift cards with ease."
    308308msgstr ""
    309309
    310 #: admin/class-woocommerce-gift-cards-lite-admin.php:1483
     310#: admin/class-woocommerce-gift-cards-lite-admin.php:1491
    311311msgid "Enable Gift Cards"
    312312msgstr ""
    313313
    314 #: admin/class-woocommerce-gift-cards-lite-admin.php:1580
     314#: admin/class-woocommerce-gift-cards-lite-admin.php:1588
    315315msgid "Import Templates"
    316316msgstr ""
    317317
    318 #: admin/class-woocommerce-gift-cards-lite-admin.php:1580
     318#: admin/class-woocommerce-gift-cards-lite-admin.php:1588
    319319msgid "Import Templates <span style=\"color:#00FF00;\">Pro</span>"
    320320msgstr ""
    321321
    322 #: admin/class-woocommerce-gift-cards-lite-admin.php:1635
     322#: admin/class-woocommerce-gift-cards-lite-admin.php:1643
    323323msgid "Import Gift Card Templates"
    324324msgstr ""
    325325
    326 #: admin/class-woocommerce-gift-cards-lite-admin.php:1640
     326#: admin/class-woocommerce-gift-cards-lite-admin.php:1648
    327327msgid "Filter Gift Card Templates"
    328328msgstr ""
    329329
    330 #: admin/class-woocommerce-gift-cards-lite-admin.php:1644
     330#: admin/class-woocommerce-gift-cards-lite-admin.php:1652
    331331msgid "Import All Gift Card Templates At Once"
    332332msgstr ""
    333333
    334 #: admin/class-woocommerce-gift-cards-lite-admin.php:1702
     334#: admin/class-woocommerce-gift-cards-lite-admin.php:1710
    335335msgid "Import this template."
    336336msgstr ""
  • woo-gift-cards-lite/trunk/languages/woo-gift-cards-lite.pot

    r3019308 r3046745  
    22msgid ""
    33msgstr ""
    4 "Project-Id-Version: Ultimate Gift Cards For WooCommerce 2.6.6\n"
    5 "POT-Creation-Date: 2024-01-08 15:19+0530\n"
     4"Project-Id-Version: Ultimate Gift Cards For WooCommerce 2.6.7\n"
     5"POT-Creation-Date: 2024-03-07 11:27+0530\n"
    66"PO-Revision-Date: 2023-01-09 11:42+0530\n"
    77"Last-Translator: \n"
     
    268268msgstr ""
    269269
    270 #: admin/class-woocommerce-gift-cards-lite-admin.php:1220
     270#: admin/class-woocommerce-gift-cards-lite-admin.php:1225
    271271msgid "from@example.com"
    272272msgstr ""
    273273
    274 #: admin/class-woocommerce-gift-cards-lite-admin.php:1221
     274#: admin/class-woocommerce-gift-cards-lite-admin.php:1226
    275275msgid "to@example.com"
    276276msgstr ""
    277277
    278 #: admin/class-woocommerce-gift-cards-lite-admin.php:1222
     278#: admin/class-woocommerce-gift-cards-lite-admin.php:1227
    279279msgid "Your gift message will appear here which you send to your receiver. "
    280280msgstr ""
    281281
    282 #: admin/class-woocommerce-gift-cards-lite-admin.php:1267
     282#: admin/class-woocommerce-gift-cards-lite-admin.php:1275
    283283#: admin/partials/woocommerce-gift-cards-lite-admin-display.php:198
    284284msgid "Demo"
    285285msgstr ""
    286286
    287 #: admin/class-woocommerce-gift-cards-lite-admin.php:1268
     287#: admin/class-woocommerce-gift-cards-lite-admin.php:1276
    288288msgid "Documentation"
    289289msgstr ""
    290290
    291 #: admin/class-woocommerce-gift-cards-lite-admin.php:1269
     291#: admin/class-woocommerce-gift-cards-lite-admin.php:1277
    292292msgid "Video"
    293293msgstr ""
    294294
    295 #: admin/class-woocommerce-gift-cards-lite-admin.php:1270
     295#: admin/class-woocommerce-gift-cards-lite-admin.php:1278
    296296msgid "Support"
    297297msgstr ""
    298298
    299 #: admin/class-woocommerce-gift-cards-lite-admin.php:1271
     299#: admin/class-woocommerce-gift-cards-lite-admin.php:1279
    300300msgid "Services"
    301301msgstr ""
    302302
    303 #: admin/class-woocommerce-gift-cards-lite-admin.php:1473
     303#: admin/class-woocommerce-gift-cards-lite-admin.php:1481
    304304msgid "Welcome to Ultimate Gift Cards For WooCommerce"
    305305msgstr ""
    306306
    307 #: admin/class-woocommerce-gift-cards-lite-admin.php:1473
     307#: admin/class-woocommerce-gift-cards-lite-admin.php:1481
    308308msgid "– Create and sell multiple gift cards with ease."
    309309msgstr ""
    310310
    311 #: admin/class-woocommerce-gift-cards-lite-admin.php:1483
     311#: admin/class-woocommerce-gift-cards-lite-admin.php:1491
    312312msgid "Enable Gift Cards"
    313313msgstr ""
    314314
    315 #: admin/class-woocommerce-gift-cards-lite-admin.php:1580
     315#: admin/class-woocommerce-gift-cards-lite-admin.php:1588
    316316msgid "Import Templates"
    317317msgstr ""
    318318
    319 #: admin/class-woocommerce-gift-cards-lite-admin.php:1580
     319#: admin/class-woocommerce-gift-cards-lite-admin.php:1588
    320320msgid "Import Templates <span style=\"color:#00FF00;\">Pro</span>"
    321321msgstr ""
    322322
    323 #: admin/class-woocommerce-gift-cards-lite-admin.php:1635
     323#: admin/class-woocommerce-gift-cards-lite-admin.php:1643
    324324msgid "Import Gift Card Templates"
    325325msgstr ""
    326326
    327 #: admin/class-woocommerce-gift-cards-lite-admin.php:1640
     327#: admin/class-woocommerce-gift-cards-lite-admin.php:1648
    328328msgid "Filter Gift Card Templates"
    329329msgstr ""
    330330
    331 #: admin/class-woocommerce-gift-cards-lite-admin.php:1644
     331#: admin/class-woocommerce-gift-cards-lite-admin.php:1652
    332332msgid "Import All Gift Card Templates At Once"
    333333msgstr ""
    334334
    335 #: admin/class-woocommerce-gift-cards-lite-admin.php:1702
     335#: admin/class-woocommerce-gift-cards-lite-admin.php:1710
    336336msgid "Import this template."
    337337msgstr ""
  • woo-gift-cards-lite/trunk/public/class-woocommerce-gift-cards-lite-public.php

    r3012841 r3046745  
    612612                    $wps_field_nonce = isset( $_POST['wps_wgm_single_nonce_field'] ) ? stripcslashes( sanitize_text_field( wp_unslash( $_POST['wps_wgm_single_nonce_field'] ) ) ) : '';
    613613                    if ( ! isset( $wps_field_nonce ) || ! wp_verify_nonce( $wps_field_nonce, 'wps_wgm_single_nonce' ) ) {
    614                
     614
    615615                        return $the_cart_data;
    616616                    } else {
     
    10711071        $coupon_amount_deducted = wps_wgm_hpos_get_meta_data( $order_id, 'wps_wgm_coupon_amount_deducted', true );
    10721072        if ( 'deduct' !== $coupon_amount_deducted ) {
    1073             foreach ( $order->get_items('coupon') as $item_id => $item ) {
     1073            foreach ( $order->get_items( 'coupon' ) as $item_id => $item ) {
    10741074                $this->wps_wgm_woocommerce_new_order_item( $item_id, $item, $order_id );
    10751075                wps_wgm_hpos_update_meta_data( $order_id, 'wps_wgm_coupon_amount_deducted', 'deduct' );
     
    17531753     */
    17541754    public function wps_wgm_wc_shipping_enabled( $enable ) {
    1755         $wps_wgc_enable = wps_wgm_giftcard_enable();
    1756         if ( CartCheckoutUtils::is_cart_block_default() || CartCheckoutUtils::is_checkout_block_default() ) {
    1757             if ( ( true ) && $wps_wgc_enable ) {
    1758                 global $woocommerce;
    1759                 $gift_bool = false;
    1760                 $other_bool = false;
    1761                 $gift_bool_ship = false;
    1762                 if ( isset( WC()->cart ) && ! empty( WC()->cart ) ) {
    1763                     foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
    1764                         $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
    1765                         $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
    1766                         $product_types = wp_get_object_terms( $product_id, 'product_type' );
    1767                         if ( isset( $product_types[0] ) ) {
    1768                             $product_type = $product_types[0]->slug;
    1769                             if ( isset( $cart_item['product_meta'] ) ) {
    1770                                 if ( 'wgm_gift_card' == $product_type || ( isset( $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) && 'on' === $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) ) {
    1771                                     if ( 'Mail to recipient' == $cart_item['product_meta']['meta_data']['delivery_method'] || 'Downloadable' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
    1772                                         $gift_bool = true;
    1773                                     } elseif ( 'shipping' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
    1774                                         $gift_bool_ship = true;
    1775                                     }
    1776                                 } else if ( ! $cart_item['data']->is_virtual() ) {
    1777                                     $other_bool = true;
    1778                                 }
    1779                             } else if ( ! $cart_item['data']->is_virtual() ) {
    1780                                 $other_bool = true;
    1781                             }
    1782                         }
    1783                     }
    1784                     if ( $gift_bool && ! $gift_bool_ship && ! $other_bool ) {
    1785                         $enable = false;
    1786                     } else {
    1787                         $enable = true;
    1788                     }
    1789                 }
    1790             }
    1791         } else {
    1792             if ( ( is_cart() || is_checkout() ) && $wps_wgc_enable ) {
    1793                 global $woocommerce;
    1794                 $gift_bool = false;
    1795                 $other_bool = false;
    1796                 $gift_bool_ship = false;
    1797                 if ( isset( WC()->cart ) && ! empty( WC()->cart ) ) {
    1798                     foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
    1799                         $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
    1800                         $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
    1801                         $product_types = wp_get_object_terms( $product_id, 'product_type' );
    1802                         if ( isset( $product_types[0] ) ) {
    1803                             $product_type = $product_types[0]->slug;
    1804                             if ( isset( $cart_item['product_meta'] ) ) {
    1805                                 if ( 'wgm_gift_card' == $product_type || ( isset( $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) && 'on' === $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) ) {
    1806                                     if ( 'Mail to recipient' == $cart_item['product_meta']['meta_data']['delivery_method'] || 'Downloadable' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
    1807                                         $gift_bool = true;
    1808                                     } elseif ( 'shipping' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
    1809                                         $gift_bool_ship = true;
    1810                                     }
    1811                                 } else if ( ! $cart_item['data']->is_virtual() ) {
    1812                                     $other_bool = true;
    1813                                 }
    1814                             } else if ( ! $cart_item['data']->is_virtual() ) {
    1815                                 $other_bool = true;
    1816                             }
    1817                         }
    1818                     }
    1819                     if ( $gift_bool && ! $gift_bool_ship && ! $other_bool ) {
    1820                         $enable = false;
    1821                     } else {
    1822                         $enable = true;
    1823                     }
    1824                 }
    1825             }
    1826         }
    1827         return $enable;
    1828     }
     1755        $wps_wgc_enable = wps_wgm_giftcard_enable();
     1756        if ( CartCheckoutUtils::is_cart_block_default() || CartCheckoutUtils::is_checkout_block_default() ) {
     1757            if ( ( true ) && $wps_wgc_enable ) {
     1758                global $woocommerce;
     1759                $gift_bool = false;
     1760                $other_bool = false;
     1761                $gift_bool_ship = false;
     1762                if ( isset( WC()->cart ) && ! empty( WC()->cart ) ) {
     1763                    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
     1764                        $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
     1765                        $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
     1766                        $product_types = wp_get_object_terms( $product_id, 'product_type' );
     1767                        if ( isset( $product_types[0] ) ) {
     1768                            $product_type = $product_types[0]->slug;
     1769                            if ( isset( $cart_item['product_meta'] ) ) {
     1770                                if ( 'wgm_gift_card' == $product_type || ( isset( $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) && 'on' === $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) ) {
     1771                                    if ( 'Mail to recipient' == $cart_item['product_meta']['meta_data']['delivery_method'] || 'Downloadable' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
     1772                                        $gift_bool = true;
     1773                                    } elseif ( 'shipping' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
     1774                                        $gift_bool_ship = true;
     1775                                    }
     1776                                } else if ( ! $cart_item['data']->is_virtual() ) {
     1777                                    $other_bool = true;
     1778                                }
     1779                            } else if ( ! $cart_item['data']->is_virtual() ) {
     1780                                $other_bool = true;
     1781                            }
     1782                        }
     1783                    }
     1784                    if ( $gift_bool && ! $gift_bool_ship && ! $other_bool ) {
     1785                        $enable = false;
     1786                    } else {
     1787                        $enable = true;
     1788                    }
     1789                }
     1790            }
     1791        } else {
     1792            if ( ( is_cart() || is_checkout() ) && $wps_wgc_enable ) {
     1793                global $woocommerce;
     1794                $gift_bool = false;
     1795                $other_bool = false;
     1796                $gift_bool_ship = false;
     1797                if ( isset( WC()->cart ) && ! empty( WC()->cart ) ) {
     1798                    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
     1799                        $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
     1800                        $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
     1801                        $product_types = wp_get_object_terms( $product_id, 'product_type' );
     1802                        if ( isset( $product_types[0] ) ) {
     1803                            $product_type = $product_types[0]->slug;
     1804                            if ( isset( $cart_item['product_meta'] ) ) {
     1805                                if ( 'wgm_gift_card' == $product_type || ( isset( $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) && 'on' === $cart_item['product_meta']['meta_data']['sell_as_a_gc'] ) ) {
     1806                                    if ( 'Mail to recipient' == $cart_item['product_meta']['meta_data']['delivery_method'] || 'Downloadable' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
     1807                                        $gift_bool = true;
     1808                                    } elseif ( 'shipping' == $cart_item['product_meta']['meta_data']['delivery_method'] ) {
     1809                                        $gift_bool_ship = true;
     1810                                    }
     1811                                } else if ( ! $cart_item['data']->is_virtual() ) {
     1812                                    $other_bool = true;
     1813                                }
     1814                            } else if ( ! $cart_item['data']->is_virtual() ) {
     1815                                $other_bool = true;
     1816                            }
     1817                        }
     1818                    }
     1819                    if ( $gift_bool && ! $gift_bool_ship && ! $other_bool ) {
     1820                        $enable = false;
     1821                    } else {
     1822                        $enable = true;
     1823                    }
     1824                }
     1825            }
     1826        }
     1827        return $enable;
     1828    }
    18291829
    18301830    /**
     
    22982298    public function wps_uwgc_gift_card_balance_org() {
    22992299        $html = '<div class="wps_gift_card_balance_wrapper">';
    2300    
     2300
    23012301        $html .= '<div class="gift_card_balance_email"><label>' . __( 'Enter Recipient Email', 'woo-gift-cards-lite' ) . '</label>  <input type="email" id="gift_card_balance_email" class="wps_gift_balance" placeholder="' . __( 'Enter Recipient Email/Name or Sender Email.', 'woo-gift-cards-lite' ) . '" required="required"></div>';
    23022302        $html .= '<div class="gift_card_code"><label>' . __( 'Enter Gift Card Code', 'woo-gift-cards-lite' ) . '</label>    <input type="text" id="gift_card_code" class="wps_gift_balance" placeholder="' . __( 'Enter Gift Card Code', 'woo-gift-cards-lite' ) . '" required="required"></div>';
  • woo-gift-cards-lite/trunk/readme.txt

    r3019308 r3046745  
    44Tags: gift, gift card, gift certificates, woocommerce gift cards, gift vouchers, gift cards, gifts, certificate, gift cards woocommerce
    55Requires at least: 5.1.0
    6 Tested up to: 6.4.2
     6Tested up to: 6.4.3
    77WC requires at least: 5.5.0
    8 WC tested up to: 8.4.0
    9 Stable tag:  2.6.6
     8WC tested up to: 8.6.1
     9Stable tag:  2.6.7
    1010Requires PHP: 5.6
    1111License: GPL-3.0+
     
    239239== Changelog ==
    240240
     241= 2.6.7 - Released on 07 March 2024 =
     242* New: Compatibility with latest WP(6.4.3) and WC(8.6.1)
     243* FIx: WordPress security issue (getting post data using url without editor role)
     244
    241245= 2.6.6 - Released on 09 January 2024 =
    242246* New: Add Class ".wps_check_balance .button", for Customised Balance Check button
     
    453457== Upgrade Notice ==
    454458
    455 = 2.6.6 - Released on 09 January 2024 =
    456 * New: Add Class "wps_check_balance button", for Customised Balance Check button
    457 * Fix: Removed Migration Code.
     459= 2.6.7 - Released on 07 March 2024 =
     460* New: Compatibility with latest WP(6.4.3) and WC(8.6.1)
     461* FIx: WordPress security issue (getting post data using url without editor role)
  • woo-gift-cards-lite/trunk/woocommerce_gift_cards_lite.php

    r3019308 r3046745  
    1616 * Plugin URI:        https://wordpress.org/plugins/woo-gift-cards-lite/?utm_source=wpswings-giftcards-org&utm_medium=giftcards-org-backend&utm_campaign=org
    1717 * Description:       <code><strong>Ultimate Gift Cards For WooCommerce</strong></code> allows merchants to create and sell fascinating Gift Card Product with multiple price variation. <a href="https://wpswings.com/woocommerce-plugins/?utm_source=wpswings-giftcards-shop&utm_medium=giftcards-org-backend&utm_campaign=shop-page" target="_blank"> Elevate your e-commerce store by exploring more on <strong> WP Swings </strong></a>.
    18  * Version:           2.6.6
     18 * Version:           2.6.7
    1919 * Author:            WP Swings
    2020 * Author URI:        https://wpswings.com/?utm_source=wpswings-giftcards-official&utm_medium=giftcards-org-backend&utm_campaign=official
     
    2222 * License URI:       https://www.gnu.org/licenses/gpl-3.0.txt
    2323 * Text Domain:       woo-gift-cards-lite
    24  * WP Tested up to:   6.4.2
     24 * WP Tested up to:   6.4.3
    2525 * WP requires at least: 5.5.0
    26  * WC tested up to:   8.4.0
     26 * WC tested up to:   8.6.1
    2727 * WC requires at least: 5.5.0
    2828 * Domain Path:       /languages
     
    6969    define( 'WPS_WGC_URL', plugin_dir_url( __FILE__ ) );
    7070    define( 'WPS_WGC_ADMIN_URL', admin_url() );
    71     define( 'WPS_WGC_VERSION', '2.6.6' );
     71    define( 'WPS_WGC_VERSION', '2.6.7' );
    7272    define( 'WPS_WGC_ONBOARD_PLUGIN_NAME', 'Ultimate Gift Cards For WooCommerce' );
    7373    define( 'WPS_GIFT_TEMPLATE_URL', 'https://demo.wpswings.com/client-notification/' );
Note: See TracChangeset for help on using the changeset viewer.