Plugin Directory

Changeset 3016324


Ignore:
Timestamp:
01/02/2024 08:42:11 AM (2 years ago)
Author:
thanhtd
Message:

Update

Location:
gift4u-gift-cards-all-in-one-for-woo/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • gift4u-gift-cards-all-in-one-for-woo/trunk/CHANGELOG.txt

    r2959714 r3016324  
     1/**1.0.5 - 2024.01.02**/
     2– Fixed: Generate expired date in PDF file
     3
    14/**1.0.4 - 2023.08.29**/
    25– Fixed: Generate expired date
  • gift4u-gift-cards-all-in-one-for-woo/trunk/admin/admin.php

    r2959714 r3016324  
    132132    public function add_giftcard_product_options() {
    133133        ?>
    134         <div class='options_group show_if_giftcard'>
    135             <div class="gift4u-tabular-menu">
    136                 <div class="gift4u-tab-item gift4u-active" data-tab="general">
     134        <div class='options_group show_if_giftcard'>
     135            <div class="gift4u-tabular-menu">
     136                <div class="gift4u-tab-item gift4u-active" data-tab="general">
    137137                    <?php esc_html_e( 'General', 'gift4u-gift-cards-all-in-one-for-woo' ); ?>
    138                 </div>
    139                 <div class="gift4u-tab-item" data-tab="coupon">
     138                </div>
     139                <div class="gift4u-tab-item" data-tab="coupon">
    140140                    <?php esc_html_e( 'Coupon', 'gift4u-gift-cards-all-in-one-for-woo' ); ?>
    141                 </div>
    142 
    143             </div>
     141                </div>
     142
     143            </div>
    144144            <?php
    145145            include_once plugin_dir_path( __FILE__ ) . 'views/html-product-general-options.php';
    146146            include_once plugin_dir_path( __FILE__ ) . 'views/html-product-coupon-options.php';
    147147            ?>
    148         </div>
     148        </div>
    149149        <?php
    150150    }
     
    152152    private function pro_option_field( $label ) {
    153153        ?>
    154         <p class="form-field ">
    155             <label for="crosssell_ids"><?php echo esc_html( $label ) ?></label>
    156             <a href="#" target="_blank" class="button"><?php echo esc_html__( 'Unlock this feature', 'gift4u-gift-cards-all-in-one-for-woo' ) ?></a>
    157         </p>
     154        <p class="form-field ">
     155            <label for="crosssell_ids"><?php echo esc_html( $label ) ?></label>
     156            <a href="#" target="_blank" class="button"><?php echo esc_html__( 'Unlock this feature', 'gift4u-gift-cards-all-in-one-for-woo' ) ?></a>
     157        </p>
    158158        <?php
    159159    }
     
    422422        }
    423423
     424        $expiry_date = $gc_coupon->get_expiry_date();
     425        if ( ! $expiry_date ) {
     426            $coupon_options = $gc_coupon->get_coupon_options();
     427
     428            if ( ! empty( $coupon_options['expiry_date'] ) ) {
     429                $date = strtotime( "+{$coupon_options['expiry_date']} day" );
     430
     431                $gc_coupon->set_expiry_date( $date );
     432            }
     433        }
     434
     435        $gc_coupon->save();
     436
    424437        $pdf = new PDF( $gc_coupon );
    425438        $pdf->get_download();
     
    438451        if ( ! empty( $coupon_ids ) ) {
    439452            ?>
    440             <div class='gift4u-coupon-list'>
     453            <div class='gift4u-coupon-list'>
    441454                <?php
    442455                foreach ( $coupon_ids as $id ) {
     
    457470                }
    458471                ?>
    459             </div>
     472            </div>
    460473            <?php
    461474        }
  • gift4u-gift-cards-all-in-one-for-woo/trunk/gift4u-gift-cards-all-in-one-for-woo.php

    r2959715 r3016324  
    55 * Description: Unlock the potential of gift card products and see how they attract customers. Easily create, sell, and manage a WooCommerce gift card with a few simple steps.
    66 * Author: VillaTheme
    7  * Version: 1.0.4
     7 * Version: 1.0.5
    88 * Author URI: http://villatheme.com
    99 * Text Domain: gift4u-gift-cards-all-in-one-for-woo
     
    1111 * Copyright 2023 VillaTheme.com. All rights reserved.
    1212 * Requires at least: 5.0
    13  * Tested up to: 6.3
     13 * Tested up to: 6.4
    1414 * WC requires at least: 5.0
    15  * WC tested up to: 8.0
     15 * WC tested up to: 8.4
    1616 * Requires PHP: 7.0
    1717 */
     
    4141
    4242            self::$args = [
    43                 'version'       => '1.0.4',
     43                'version'       => '1.0.5',
    4444                'plugin_name'   => 'GIFT4U - Gift Cards All in One for Woo',
    4545                'slug'          => 'gift4u-gift-cards-all-in-one-for-woo',
  • gift4u-gift-cards-all-in-one-for-woo/trunk/inc/classes/email.php

    r2959714 r3016324  
    6666        }
    6767
     68        $expiry_date = $this->gc_coupon->get_expiry_date();
     69
     70        if ( ! $expiry_date ) {
     71            $coupon_options = $this->gc_coupon->get_coupon_options();
     72
     73            if ( ! empty( $coupon_options['expiry_date'] ) ) {
     74                $date = strtotime( "+{$coupon_options['expiry_date']} day" );
     75
     76                $this->gc_coupon->set_expiry_date( $date );
     77            }
     78        }
     79
    6880        $attachments = [];
    6981        $file        = $add_card_pdf_to_email ? $this->generate_card_pdf() : '';
     
    7890
    7991        if ( $result ) {
    80             $expiry_date = $this->gc_coupon->get_expiry_date();
    81 
    82             if ( ! $expiry_date ) {
    83                 $coupon_options = $this->gc_coupon->get_coupon_options();
    84 
    85                 if ( ! empty( $coupon_options['expiry_date'] ) ) {
    86                     $date = strtotime( "+{$coupon_options['expiry_date']} day" );
    87 
    88                     $this->gc_coupon->set_expiry_date( $date );
    89                 }
    90             }
    91 
    9292            $this->gc_coupon->set_delivery_status( 'sent' );
    9393            $this->gc_coupon->set_delivery_date( time() );
    94             $this->gc_coupon->save();
    9594        }
     95
     96        $this->gc_coupon->save();
    9697
    9798        if ( $file ) {
  • gift4u-gift-cards-all-in-one-for-woo/trunk/inc/utils.php

    r2885345 r3016324  
    275275            '{message}'            => $message,
    276276            '{coupon_expiry_date}' => $date_expiry instanceof \WC_DateTime ? $date_expiry->date_i18n( wc_date_format() ) : '',
    277             '{apply_coupon_url}'   => add_query_arg( [ 'gift4u_coupon' => $gc_coupon->get_coupon_code() ], site_url() ),
     277            '{apply_coupon_url}'   => add_query_arg( [ 'gift4u_coupon' => $gc_coupon->get_coupon_code() ], apply_filters( 'gift4u_apply_coupon_url', site_url() ) ),
    278278        ] );
    279279
  • gift4u-gift-cards-all-in-one-for-woo/trunk/readme.txt

    r2959715 r3016324  
    246246== Changelog ==
    247247
     248/**1.0.5 - 2024.01.02**/
     249– Fixed: Generate expired date in PDF file
     250
    248251/**1.0.4 - 2023.08.29**/
    249252– Fixed: Generate expired date
Note: See TracChangeset for help on using the changeset viewer.