Plugin Directory

Changeset 3202482


Ignore:
Timestamp:
12/04/2024 03:19:11 PM (16 months ago)
Author:
rednumber
Message:

update 2

Location:
pdf-for-woocommerce/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pdf-for-woocommerce/trunk/frontend/index.php

    r3202071 r3202482  
    217217            foreach( $data_orders as $order_id ){
    218218                $order_shortcode->set_order_id($order_id);
    219                 $id = self::get_html($id_template,$datas);
     219                $id = self::get_html($id_template,$data_attrs["datas"]);
    220220                echo do_shortcode($id); // phpcs:ignore WordPress.Security.EscapeOutput
    221221                if( $i < count($data_orders) ) {
  • pdf-for-woocommerce/trunk/pdf-for-woocommerce.php

    r3202071 r3202482  
    66 * Text Domain: pdf-for-woocommerce
    77 * Domain Path: /languages
    8  * Version: 4.5.0
     8 * Version: 4.5.1
    99 * Requires PHP: 5.6
    1010 * Author: add-ons.org
  • pdf-for-woocommerce/trunk/readme.txt

    r3202071 r3202482  
    44Requires at least: 2.0
    55Tested up to: 6.7
    6 Stable tag: 4.5.0
     6Stable tag: 4.5.1
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    104104
    105105== Changelog ==
     106= 4.5.1 =
     107- Added: Download All PDF
     108
    106109= 4.5.0 =
    107110- Fixed: columns
  • pdf-for-woocommerce/trunk/woocommerce/backend/index.php

    r3157698 r3202482  
    1717        add_action("yeepdf_builder_tab_block_addons",array($this,"block_text_addons"),9);
    1818        add_filter("superaddons_pdf_check_pro",array($this,"check_pro"));
     19        add_filter("bulk_actions-edit-shop_order",array($this,"bulk_actions_download"));
     20        //hight order
     21        add_filter("bulk_actions-woocommerce_page_wc-orders",array($this,"bulk_actions_download"));
     22        add_action('admin_enqueue_scripts', array($this,'add_libs'));
     23    }
     24    function bulk_actions_download($actions){
     25        global $wpdb;
     26        $table_name = $wpdb->prefix."vc_pdf_invoices";
     27        $datas= $wpdb->get_results("SELECT * FROM $table_name WHERE enable = 1", ARRAY_A);
     28        foreach( $datas as $data){
     29            $actions["download_pdf_".$data["template_id"]] = "Download PDF - ".$data["label"];
     30        }
     31        return $actions;
     32    }
     33    function add_libs(){
     34        wp_enqueue_script('yeepdf_woo_acction', YEEPDF_BUILDER_WOOCOMMERCE_URL . "woocommerce/backend/yeepdf.js",array("jquery"),time());
     35        $link =add_query_arg(array("pdf_preview"=>"preview","preview"=>1),get_home_url());
     36        wp_localize_script( 'yeepdf_woo_acction', 'yeepdf_woo_acction',
     37                array(
     38                    'ajax_url' => admin_url( 'admin-ajax.php' ),
     39                    'link_download' => wp_nonce_url($link,"yeepdf"),
     40                    'text_no_select_order' => esc_html__("You have to select order(s) first!","pdf-for-wpforms"),
     41                )
     42            );
    1943    }
    2044    function check_pro($pro){
    21         $check = get_option( '_redmuber_item_1708');
    22         if($check == "ok"){
    23             $pro = true;
    24         }
    25         return $pro;
    26     }
     45        $check = get_option( '_redmuber_item_1708');
     46        if($check == "ok"){
     47            $pro = true;
     48        }
     49        return $pro;
     50    }
    2751    function block_text_addons(){
    2852        ?>
  • pdf-for-woocommerce/trunk/woocommerce/emails/index.php

    r3202071 r3202482  
    7777                            $my_account_order_status = array();
    7878                        }
    79                         if(in_array($order_status,$my_account_order_status)){
     79                        if(is_array($my_account_order_status) && in_array($order_status,$my_account_order_status)){
    8080                            $available = true;
    8181                        }
     
    148148            if( isset($data["enable_order"])){
    149149                $enable_order = json_decode($data["enable_order"]);
    150                 if(in_array($order_status,$enable_order)){
     150                if( is_array($enable_order) && in_array($order_status,$enable_order)){
    151151                    $name =$data["name"];
    152152                    $order_shortcode = new Yeepdf_Addons_Woocommerce_Shortcodes();
     
    199199            if( isset($data["enable_order"])){
    200200                $enable_order = json_decode($data["enable_order"]);
    201                 if(in_array($order_status,$enable_order)){
     201                if(is_array($enable_order) && in_array($order_status,$enable_order)){
    202202                    $enable_attas = json_decode($data["attachments"]);
    203                     if(in_array($order_status,$enable_attas)){
     203                    if(is_array($enable_attas) && in_array($order_status,$enable_attas)){
    204204                        $name =$data["name"];
    205205                        $password =$data["password"];
     
    414414                                    foreach($orders_types as $key => $value){
    415415                                        $checked = "";
    416                                         if(in_array($key,$enable_order)){
     416                                        if( is_array($enable_order) && in_array($key,$enable_order)){
    417417                                            $checked = "checked";
    418418                                        }
     
    440440                                        }
    441441                                    }
    442                                     if(in_array($key,$attachments)){
     442                                    if(is_array($attachments) && in_array($key,$attachments)){
    443443                                        $checked = "checked";
    444444                                    }
     
    489489                                        }
    490490                                    }
    491                                     if(in_array($key,$my_account_order_status)){
     491                                    if( is_array($my_account_order_status) && in_array($key,$my_account_order_status)){
    492492                                        $checked = "checked";
    493493                                    }
Note: See TracChangeset for help on using the changeset viewer.