• Fatal error: Cannot redeclare pr() in /xxx.com/wp-content/plugins/woocommerce-easy-table-rate-shipping/woocommerce-table-rate-plugin.php on line 1837 after upgraded to Version 2.0.0 on 25 May 2018

    
    function pr($pr_data) {
        ?>
        <script>
            jQuery(document).ready(function () {
                jQuery("#checkall-checkbox-id").change(function () {
                    var checked = jQuery(this).is(':checked'); // Checkbox state
                    // Select all
                    if (checked) {
                        jQuery('.chkItems').each(function () {
                            jQuery(this).prop('checked', 'checked');
                            jQuery('#jem_table_rate_remove_selected_method').prop('disabled', false);
                        });
                    } else {
                        // Deselect All
                        jQuery('.chkItems').each(function () {
                            jQuery(this).prop('checked', false);
                            jQuery('#jem_table_rate_remove_selected_method').prop('disabled', true);
                        });
                    }
    
                });
            });
    		
        //        jQuery(document).on("click",".wc-shipping-zone-method-settings",function(){
        //            var a_href = jQuery('.wc-shipping-zone-method-settings').attr('href');
        //            var templateUrl = '<?= admin_url(); ?>'+ a_href;
        //            jQuery(".wc-shipping-zone-method-settings").attr("target","_blank"); 
        //            alert(templateUrl);
        //});
        </script><?php
        echo "<pre>";
        print_r($pr_data);
        echo "</pre>";
    }
    //add_action('admin_head', 'pr');
    add_action('admin_footer', 'pr');

    so have to deactivated it…

    Please look into this error

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tonytanlh

    (@tonytanlh)

    perhaps can temporary make use of this to solve the problem

    if ( ! function_exists( 'pr' ) ) {
      function pr($pr_data) {
      //whatever the original contents here....
         }
    }
    • This reply was modified 6 years, 10 months ago by tonytanlh.
    Plugin Author merlinmonmouth

    (@merlinmonmouth)

    Thanks for the heads up – we’ll take a look…

    Thread Starter tonytanlh

    (@tonytanlh)

    One more issue is that the new version remove all previously set table rate by early version, means after upgrading, have to manually set up the table rate again for all different zones.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error: Cannot redeclare pr() in line 1837 after upgraded to Version 2.0.0’ is closed to new replies.