@@ -20,18 +20,18 @@ discard block |
||
20 | 20 | ini_set('memory_limit', '512M'); |
21 | 21 | |
22 | 22 | /** Check if file is include. No direct access possible with file url */ |
23 | -if ( !defined( 'ABSPATH' ) ) { |
|
24 | - die( 'Access is not allowed by this way' ); |
|
23 | +if (!defined('ABSPATH')) { |
|
24 | + die('Access is not allowed by this way'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** Allows to refresh css and js file in final user browser */ |
28 | 28 | DEFINE('WPSHOP_VERSION', '1.4.1.6'); |
29 | 29 | |
30 | 30 | /** Allows to avoid problem with theme not supporting thumbnail for post */ |
31 | -add_theme_support( 'post-thumbnails' ); |
|
32 | -add_image_size( 'wpshop-product-galery', 270, 270, true ); |
|
33 | -add_image_size( 'wps-categorie-mini-display', 80, 80, true ); |
|
34 | -add_image_size( 'wps-categorie-display', 480, 340, true ); |
|
31 | +add_theme_support('post-thumbnails'); |
|
32 | +add_image_size('wpshop-product-galery', 270, 270, true); |
|
33 | +add_image_size('wps-categorie-mini-display', 80, 80, true); |
|
34 | +add_image_size('wps-categorie-display', 480, 340, true); |
|
35 | 35 | |
36 | 36 | /** First thing we define the main directory for our plugin in a super global var */ |
37 | 37 | DEFINE('WPSHOP_PLUGIN_DIR', basename(dirname(__FILE__))); |
@@ -39,26 +39,26 @@ discard block |
||
39 | 39 | /** Get the current language to translate the different text in plugin */ |
40 | 40 | $locale = get_locale(); |
41 | 41 | global $wpdb; |
42 | -if ( defined("ICL_LANGUAGE_CODE") ) { |
|
42 | +if (defined("ICL_LANGUAGE_CODE")) { |
|
43 | 43 | $query = $wpdb->prepare("SELECT locale FROM " . $wpdb->prefix . "icl_locale_map WHERE code = %s", ICL_LANGUAGE_CODE); |
44 | 44 | $local = $wpdb->get_var($query); |
45 | 45 | $locale = !empty($local) ? $local : $locale; |
46 | 46 | } |
47 | 47 | DEFINE('WPSHOP_CURRENT_LOCALE', $locale); |
48 | 48 | /** Load plugin translation */ |
49 | -load_plugin_textdomain( 'wpshop', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/'); |
|
49 | +load_plugin_textdomain('wpshop', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
50 | 50 | |
51 | 51 | /** Include the config file */ |
52 | 52 | require(WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR . '/includes/config.php'); |
53 | 53 | |
54 | 54 | /** Allow to get errors back when debug mode is set to true */ |
55 | -if ( WPSHOP_DEBUG_MODE && (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP)) ) ) { |
|
55 | +if (WPSHOP_DEBUG_MODE && (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP)))) { |
|
56 | 56 | ini_set('display_errors', true); |
57 | 57 | error_reporting(E_ALL); |
58 | 58 | } |
59 | 59 | |
60 | 60 | include_once(WPSHOP_LIBRAIRIES_DIR . 'init.class.php'); |
61 | -$current_installation_step = get_option( 'wps-installation-current-step', 1 ); |
|
61 | +$current_installation_step = get_option('wps-installation-current-step', 1); |
|
62 | 62 | |
63 | 63 | /** Get current plugin version */ |
64 | 64 | $current_db_version = get_option('wpshop_db_options', 0); |
@@ -76,32 +76,32 @@ discard block |
||
76 | 76 | |
77 | 77 | /** Call function to create the main left menu */ |
78 | 78 | //if ( ( WPSINSTALLER_STEPS_COUNT <= $current_installation_step ) || ( !empty( $current_db_version ) && !empty( $current_db_version[ 'db_version' ] ) && ( 51 < $current_db_version[ 'db_version' ] ) ) || ( !empty( $_GET ) && !empty( $_GET[ 'installation_state' ] ) && ( "ignored" == $_GET[ 'installation_state' ] ) ) ) { |
79 | - add_action('admin_menu', array( 'wpshop_init', 'admin_menu' ) ); |
|
80 | - add_action( 'menu_order', array( 'wpshop_init', 'admin_menu_order' ) ); |
|
81 | - add_action( 'custom_menu_order', array( 'wpshop_init', 'admin_custom_menu_order' ) ); |
|
79 | + add_action('admin_menu', array('wpshop_init', 'admin_menu')); |
|
80 | + add_action('menu_order', array('wpshop_init', 'admin_menu_order')); |
|
81 | + add_action('custom_menu_order', array('wpshop_init', 'admin_custom_menu_order')); |
|
82 | 82 | |
83 | 83 | /* Call function for new wordpress element creating [term (product_category) / post (product)] */ |
84 | - add_action( 'init', array( 'wpshop_init', 'add_new_wp_type' ) ); |
|
84 | + add_action('init', array('wpshop_init', 'add_new_wp_type')); |
|
85 | 85 | |
86 | 86 | /* Call function allowing to change element front output */ |
87 | - add_action( 'the_content', array( 'wpshop_display', 'products_page' ), 1 ); |
|
87 | + add_action('the_content', array('wpshop_display', 'products_page'), 1); |
|
88 | 88 | // add_action('archive_template', array('wpshop_categories', 'category_template_switcher')); |
89 | 89 | //} |
90 | 90 | |
91 | 91 | /** On plugin activation create the default parameters to use the ecommerce */ |
92 | -register_activation_hook( __FILE__ , array('wpshop_install', 'install_on_activation') ); |
|
92 | +register_activation_hook(__FILE__, array('wpshop_install', 'install_on_activation')); |
|
93 | 93 | |
94 | 94 | /** On plugin deactivation call the function to clean the wordpress installation */ |
95 | -register_deactivation_hook( __FILE__ , array('wpshop_install', 'uninstall_wpshop') ); |
|
95 | +register_deactivation_hook(__FILE__, array('wpshop_install', 'uninstall_wpshop')); |
|
96 | 96 | |
97 | 97 | /** Get current plugin version */ |
98 | 98 | $current_db_version = get_option('wpshop_db_options', 0); |
99 | 99 | |
100 | 100 | /** Add the database content */ |
101 | 101 | add_action('admin_init', array('wpshop_install', 'update_wpshop')); |
102 | -if ( ( defined( 'WPSINSTALLER_STEPS_COUNT' ) && ( WPSINSTALLER_STEPS_COUNT <= $current_installation_step ) ) || ( !empty( $current_db_version ) && !empty( $current_db_version[ 'db_version' ] ) && ( 51 < $current_db_version[ 'db_version' ] ) ) || ( !empty( $current_db_version ) && !empty( $current_db_version[ 'installation_state' ] ) && ( "ignore" == $current_db_version[ 'installation_state' ] ) ) ) { |
|
103 | - if ( in_array( long2ip( ip2long($_SERVER['REMOTE_ADDR'] ) ), unserialize( WPSHOP_DEBUG_MODE_ALLOWED_IP ) ) ) { |
|
104 | - add_action( 'admin_init', array( 'wpshop_install', 'update_wpshop_dev' ) ); |
|
102 | +if ((defined('WPSINSTALLER_STEPS_COUNT') && (WPSINSTALLER_STEPS_COUNT <= $current_installation_step)) || (!empty($current_db_version) && !empty($current_db_version['db_version']) && (51 < $current_db_version['db_version'])) || (!empty($current_db_version) && !empty($current_db_version['installation_state']) && ("ignore" == $current_db_version['installation_state']))) { |
|
103 | + if (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP))) { |
|
104 | + add_action('admin_init', array('wpshop_install', 'update_wpshop_dev')); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * The template for displaying Archive pages. |
4 | 4 | * |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * We reset this later so we can run the loop |
24 | 24 | * properly with a call to rewind_posts(). |
25 | 25 | */ |
26 | - if ( have_posts() ) |
|
26 | + if (have_posts()) |
|
27 | 27 | the_post(); |
28 | 28 | |
29 | 29 | |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | $category_has_content = false; |
35 | 35 | $category_has_sub_content = false; |
36 | 36 | /* Check what must be outputed on the page (Defined in plugin option) */ |
37 | - if(!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_description', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
37 | + if (!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_description', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
38 | 38 | $category_has_content = true; |
39 | 39 | |
40 | 40 | $taxonomy_informations = get_option(WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES . '_' . $wp_query->queried_object->term_id); |
41 | - if ( !empty($taxonomy_informations['wpshop_category_picture']) ) { |
|
42 | - $image_post = wp_get_attachment_image( $taxonomy_informations['wpshop_category_picture'], 'wps-categorie-mini-display', false, array('class' => 'category_thumbnail_preview') ); |
|
41 | + if (!empty($taxonomy_informations['wpshop_category_picture'])) { |
|
42 | + $image_post = wp_get_attachment_image($taxonomy_informations['wpshop_category_picture'], 'wps-categorie-mini-display', false, array('class' => 'category_thumbnail_preview')); |
|
43 | 43 | } |
44 | - $category_thumbnail_preview = ( !empty($image_post) ) ? $image_post : ''; |
|
44 | + $category_thumbnail_preview = (!empty($image_post)) ? $image_post : ''; |
|
45 | 45 | ?> |
46 | 46 | <div class="wps-taxonomy-wrapper"> |
47 | 47 | <?php echo do_shortcode('[wpshop_filter_search]'); ?> |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | <div class="wps-entry-thumbnail"><?php echo $category_thumbnail_preview; ?></div> |
51 | 51 | <div class="wps-entry-caption"> |
52 | 52 | <h1 class="wps-entry-title"><?php echo $wp_query->queried_object->name; ?></h1> |
53 | - <p class="wps-entry-description"><?php echo do_shortcode( wp_trim_words( $wp_query->queried_object->description, 30, ' [...]' ) ); ?></p> |
|
53 | + <p class="wps-entry-description"><?php echo do_shortcode(wp_trim_words($wp_query->queried_object->description, 30, ' [...]')); ?></p> |
|
54 | 54 | </div> |
55 | 55 | </header><!-- .entry-header --> |
56 | 56 | <?php |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | <div class="wps-categorie-wrapper" > |
60 | 60 | <?php |
61 | 61 | /* Check what must be outputed on the page (Defined in plugin option) */ |
62 | - if(!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_subcategory', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
62 | + if (!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_subcategory', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
63 | 63 | $category_tree = wpshop_categories::category_tree($wp_query->queried_object->term_id); |
64 | - if(is_array($category_tree) && (count($category_tree) > 0)): |
|
64 | + if (is_array($category_tree) && (count($category_tree) > 0)): |
|
65 | 65 | $category_has_content = true; |
66 | 66 | $category_has_sub_content = true; |
67 | 67 | ?> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <div class="wps-categorie-content <?php echo $wpshop_display_option['wpshop_display_list_type'] ?>wrapper<?php echo $wpshop_display_option['wpshop_display_grid_element_number'] ?>" > |
70 | 70 | <!-- <h2 class="category_content_part_title" ><?php _e('Category\'s sub-category list', 'wpshop'); ?></h2> --> |
71 | 71 | <?php |
72 | - foreach($category_tree as $sub_category_id => $sub_category_content){ |
|
72 | + foreach ($category_tree as $sub_category_id => $sub_category_content) { |
|
73 | 73 | $sub_category_definition = get_term($sub_category_id, WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES); |
74 | 74 | echo wpshop_categories::category_mini_output($sub_category_definition, $output_type); |
75 | 75 | } |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | <?php |
83 | 83 | |
84 | 84 | /* Check what must be outputed on the page (Defined in plugin option) */ |
85 | - if(!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_subproduct', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
86 | - if ( count( wpshop_categories::get_product_of_category( $wp_query->queried_object->term_taxonomy_id ) ) > 0 ) : |
|
85 | + if (!is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) || in_array('category_subproduct', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
86 | + if (count(wpshop_categories::get_product_of_category($wp_query->queried_object->term_taxonomy_id)) > 0) : |
|
87 | 87 | $category_has_content = true; |
88 | 88 | $category_has_sub_content = true; |
89 | - echo do_shortcode('[wpshop_products cid="'.$wp_query->queried_object->term_id.'" type="'.$output_type.'"]'); |
|
89 | + echo do_shortcode('[wpshop_products cid="' . $wp_query->queried_object->term_id . '" type="' . $output_type . '"]'); |
|
90 | 90 | endif; |
91 | - elseif(is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) && !in_array('category_subproduct', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
91 | + elseif (is_array($wpshop_display_option['wpshop_display_cat_sheet_output']) && !in_array('category_subproduct', $wpshop_display_option['wpshop_display_cat_sheet_output'])): |
|
92 | 92 | $category_has_sub_content = true; |
93 | 93 | endif; |
94 | 94 | ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * The template for displaying Archive pages. |
4 | 6 | * |
@@ -23,8 +25,9 @@ discard block |
||
23 | 25 | * We reset this later so we can run the loop |
24 | 26 | * properly with a call to rewind_posts(). |
25 | 27 | */ |
26 | - if ( have_posts() ) |
|
27 | - the_post(); |
|
28 | + if ( have_posts() ) { |
|
29 | + the_post(); |
|
30 | + } |
|
28 | 31 | |
29 | 32 | |
30 | 33 | //$wpshop_display_option = get_option('wpshop_display_option'); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | 3 | /* Wordpress - Ajax functionnality activation */ |
4 | 4 | DEFINE('DOING_AJAX', true); |
@@ -12,21 +12,21 @@ discard block |
||
12 | 12 | $mode = (!empty($_GET['mode'])) ? wpshop_tools::varSanitizer($_GET['mode']) : 'html'; |
13 | 13 | $is_credit_slip = (!empty($_GET['credit_slip'])) ? wpshop_tools::varSanitizer($_GET['credit_slip']) : null; |
14 | 14 | $user_id = get_current_user_id(); |
15 | - if ( !empty($order_id) && $user_id != 0 ) { |
|
15 | + if (!empty($order_id) && $user_id != 0) { |
|
16 | 16 | /** Order reading */ |
17 | 17 | $order_postmeta = get_post_meta($order_id, '_order_postmeta', true); |
18 | 18 | |
19 | 19 | /** Start invoice display */ |
20 | - if ( !empty( $is_credit_slip) ) { |
|
21 | - $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref, 'credit_slip'); |
|
20 | + if (!empty($is_credit_slip)) { |
|
21 | + $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref, 'credit_slip'); |
|
22 | 22 | } |
23 | 23 | else { |
24 | - $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref); |
|
24 | + $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref); |
|
25 | 25 | |
26 | 26 | } |
27 | 27 | |
28 | - if ( $mode == 'pdf') { |
|
29 | - require_once(WPSHOP_LIBRAIRIES_DIR.'HTML2PDF/html2pdf.class.php'); |
|
28 | + if ($mode == 'pdf') { |
|
29 | + require_once(WPSHOP_LIBRAIRIES_DIR . 'HTML2PDF/html2pdf.class.php'); |
|
30 | 30 | try { |
31 | 31 | //$html_content = wpshop_display::display_template_element('invoice_print_page_content_css', array(), array(), 'common') . '<page>' . $html_content . '</page>'; |
32 | 32 | $html_content = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common') . '<page>' . $html_content . '</page>'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $html2pdf->setDefaultFont('Arial'); |
36 | 36 | $html2pdf->writeHTML($html_content); |
37 | 37 | |
38 | - $html2pdf->Output('order_' .$order_id. '.pdf', 'D'); |
|
38 | + $html2pdf->Output('order_' . $order_id . '.pdf', 'D'); |
|
39 | 39 | } |
40 | 40 | catch (HTML2PDF_exception $e) { |
41 | 41 | echo $e; |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | } |
44 | 44 | } |
45 | 45 | else { |
46 | - $order_invoice_ref = ( !empty($order_postmeta['order_invoice_ref']) ) ? $order_postmeta['order_invoice_ref'] : ''; |
|
47 | - $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
|
46 | + $order_invoice_ref = (!empty($order_postmeta['order_invoice_ref'])) ? $order_postmeta['order_invoice_ref'] : ''; |
|
47 | + $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
|
48 | 48 | $tpl_component['INVOICE_MAIN_PAGE'] = $html_content; |
49 | - $tpl_component['INVOICE_TITLE_PAGE'] = sprintf( __('Invoice %1$s for order %3$s (#%2$s)', 'wpshop'), $order_invoice_ref, $order_id, $order_postmeta['order_key']); |
|
49 | + $tpl_component['INVOICE_TITLE_PAGE'] = sprintf(__('Invoice %1$s for order %3$s (#%2$s)', 'wpshop'), $order_invoice_ref, $order_id, $order_postmeta['order_key']); |
|
50 | 50 | echo wpshop_display::display_template_element('invoice_page', $tpl_component, array(), 'common'); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /* Wordpress - Ajax functionnality activation */ |
4 | 6 | DEFINE('DOING_AJAX', true); |
@@ -19,8 +21,7 @@ discard block |
||
19 | 21 | /** Start invoice display */ |
20 | 22 | if ( !empty( $is_credit_slip) ) { |
21 | 23 | $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref, 'credit_slip'); |
22 | - } |
|
23 | - else { |
|
24 | + } else { |
|
24 | 25 | $html_content = wpshop_modules_billing::generate_html_invoice($order_id, $invoice_ref); |
25 | 26 | |
26 | 27 | } |
@@ -36,13 +37,11 @@ discard block |
||
36 | 37 | $html2pdf->writeHTML($html_content); |
37 | 38 | |
38 | 39 | $html2pdf->Output('order_' .$order_id. '.pdf', 'D'); |
39 | - } |
|
40 | - catch (HTML2PDF_exception $e) { |
|
40 | + } catch (HTML2PDF_exception $e) { |
|
41 | 41 | echo $e; |
42 | 42 | exit; |
43 | 43 | } |
44 | - } |
|
45 | - else { |
|
44 | + } else { |
|
46 | 45 | $order_invoice_ref = ( !empty($order_postmeta['order_invoice_ref']) ) ? $order_postmeta['order_invoice_ref'] : ''; |
47 | 46 | $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
48 | 47 | $tpl_component['INVOICE_MAIN_PAGE'] = $html_content; |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /* Wordpress - Ajax functionnality activation */ |
3 | 5 | DEFINE('DOING_AJAX', true); |
4 | 6 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
@@ -19,8 +21,7 @@ discard block |
||
19 | 21 | $html2pdf->setDefaultFont('Arial'); |
20 | 22 | $html2pdf->writeHTML($html_content); |
21 | 23 | $html2pdf->Output('product-' .$_GET['pid'].'-'.$product_post->post_name.'.pdf', 'D'); |
22 | - } |
|
23 | - catch (HTML2PDF_exception $e) { |
|
24 | + } catch (HTML2PDF_exception $e) { |
|
24 | 25 | echo $e; |
25 | 26 | exit; |
26 | 27 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /* Wordpress - Ajax functionnality activation */ |
3 | 3 | DEFINE('DOING_AJAX', true); |
4 | 4 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
@@ -6,19 +6,19 @@ discard block |
||
6 | 6 | /* Wordpress - Admin page that define some needed vars and include file */ |
7 | 7 | require_once(ABSPATH . 'wp-admin/includes/admin.php'); |
8 | 8 | |
9 | -$product_id = ( !empty($_GET['pid']) ) ? (int) $_GET['pid'] : null; |
|
9 | +$product_id = (!empty($_GET['pid'])) ? (int)$_GET['pid'] : null; |
|
10 | 10 | $user_id = get_current_user_id(); |
11 | -if( !empty($product_id) && get_post_type( $product_id ) == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT && $user_id != 0 && current_user_can( 'manage_options' ) ) { |
|
11 | +if (!empty($product_id) && get_post_type($product_id) == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT && $user_id != 0 && current_user_can('manage_options')) { |
|
12 | 12 | $wps_product_administration_ctr = new wps_product_administration_ctr(); |
13 | - $html_content = $wps_product_administration_ctr->generate_product_sheet_datas( $product_id ); |
|
14 | - $product_post = get_post( $product_id ); |
|
15 | - require_once(WPSHOP_LIBRAIRIES_DIR.'HTML2PDF/html2pdf.class.php'); |
|
13 | + $html_content = $wps_product_administration_ctr->generate_product_sheet_datas($product_id); |
|
14 | + $product_post = get_post($product_id); |
|
15 | + require_once(WPSHOP_LIBRAIRIES_DIR . 'HTML2PDF/html2pdf.class.php'); |
|
16 | 16 | try { |
17 | 17 | $html2pdf = new HTML2PDF('P', 'A4', 'fr'); |
18 | 18 | $html2pdf->pdf->SetDisplayMode('fullpage'); |
19 | 19 | $html2pdf->setDefaultFont('Arial'); |
20 | 20 | $html2pdf->writeHTML($html_content); |
21 | - $html2pdf->Output('product-' .$product_id.'-'.$product_post->post_name.'.pdf', 'D'); |
|
21 | + $html2pdf->Output('product-' . $product_id . '-' . $product_post->post_name . '.pdf', 'D'); |
|
22 | 22 | } |
23 | 23 | catch (HTML2PDF_exception $e) { |
24 | 24 | echo $e; |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
3 | 3 | require_once('../../../../../wp-load.php'); |
4 | 4 | header('Content-Type: text/html; charset=' . get_bloginfo('charset')); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $display_option_display_type = true; |
11 | 11 | $display_option_grouped = true; |
12 | 12 | $display_search_form = true; |
13 | -if ( !empty($type) ) { |
|
13 | +if (!empty($type)) { |
|
14 | 14 | switch ($type) { |
15 | 15 | case 'attribute_value': |
16 | 16 | $display_option_grouped = false; |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | case 'product': |
38 | 38 | $query = $wpdb->prepare("SELECT COUNT(ID) as WPSHOP_PRODUCT_NB FROM " . $wpdb->posts . " WHERE post_type=%s AND post_status=%s", WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, 'publish'); |
39 | 39 | $wpshop_product_nb = $wpdb->get_var($query); |
40 | - $content = sprintf(__('Due to product number, you have to search for product or click on "%s" button', 'wpshop'), __('View all element','wpshop')); |
|
41 | - if ( $wpshop_product_nb <= 100 ) { |
|
40 | + $content = sprintf(__('Due to product number, you have to search for product or click on "%s" button', 'wpshop'), __('View all element', 'wpshop')); |
|
41 | + if ($wpshop_product_nb <= 100) { |
|
42 | 42 | $content = wpshop_products::product_list(true); |
43 | 43 | } |
44 | 44 | $wpshop_wysiwyg_shortcode_inserter_shortcode_main_identifier = 'wpshop_products pid'; |
@@ -64,30 +64,30 @@ discard block |
||
64 | 64 | <script type="text/javascript" src="<?php echo bloginfo('url'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script> |
65 | 65 | <script type="text/javascript" src="<?php echo bloginfo('url'); ?>/wp-includes/js/jquery/jquery.js"></script> |
66 | 66 | <?php wpshop_init::admin_print_js(); ?> |
67 | - <script type="text/javascript" src="<?php echo WPSHOP_JS_URL; ?>pages/wpshop_wysiwyg.js?v=<?php echo WPSHOP_VERSION;?>" ></script> |
|
68 | - <script type="text/javascript" src="<?php echo WPSHOP_JS_URL; ?>jquery-libs/chosen.jquery.min.js?v=<?php echo WPSHOP_VERSION;?>" ></script> |
|
67 | + <script type="text/javascript" src="<?php echo WPSHOP_JS_URL; ?>pages/wpshop_wysiwyg.js?v=<?php echo WPSHOP_VERSION; ?>" ></script> |
|
68 | + <script type="text/javascript" src="<?php echo WPSHOP_JS_URL; ?>jquery-libs/chosen.jquery.min.js?v=<?php echo WPSHOP_VERSION; ?>" ></script> |
|
69 | 69 | <script type="text/javascript"> |
70 | 70 | var WPSHOP_AJAX_FILE_URL = "<?php echo admin_url('admin-ajax.php'); ?>"; |
71 | 71 | var wpshop_wysiwyg_shortcode_insertion_search = "<?php echo wp_create_nonce('wpshop_element_search'); ?>"; |
72 | 72 | var WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT = "<?php echo WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT; ?>"; |
73 | 73 | </script> |
74 | 74 | |
75 | - <?php wp_admin_css( 'wp-admin', true ); ?> |
|
76 | - <link rel='stylesheet' href="<?php echo WPSHOP_CSS_URL; ?>pages/wpshop_wysiwyg_dialog.css?v=<?php echo WPSHOP_VERSION;?>" type="text/css" media="all" /> |
|
77 | - <link rel='stylesheet' href="<?php echo WPSHOP_CSS_URL; ?>jquery-libs/chosen.css?v=<?php echo WPSHOP_VERSION;?>" type="text/css" media="all" /> |
|
75 | + <?php wp_admin_css('wp-admin', true); ?> |
|
76 | + <link rel='stylesheet' href="<?php echo WPSHOP_CSS_URL; ?>pages/wpshop_wysiwyg_dialog.css?v=<?php echo WPSHOP_VERSION; ?>" type="text/css" media="all" /> |
|
77 | + <link rel='stylesheet' href="<?php echo WPSHOP_CSS_URL; ?>jquery-libs/chosen.css?v=<?php echo WPSHOP_VERSION; ?>" type="text/css" media="all" /> |
|
78 | 78 | </head> |
79 | 79 | <body> |
80 | 80 | <form onsubmit="wpShop_Dialog_Action.insert();" action="#"> |
81 | 81 | <input type="hidden" value="<?php echo $wpshop_wysiwyg_shortcode_inserter_shortcode_main_identifier; ?>" id="wpshop_wysiwyg_shortcode_inserter_shortcode_main_identifier" /> |
82 | 82 | <input type="hidden" value="<?php echo $type; ?>" id="wpshop_wysiwyg_shortcode_inserter_type" /> |
83 | -<?php if ( !empty($type) ) : ?> |
|
83 | +<?php if (!empty($type)) : ?> |
|
84 | 84 | <?php |
85 | 85 | if ($display_search_form) { |
86 | 86 | ?> |
87 | 87 | <div class="search_element_container" > |
88 | - <input type="text" value="" placeholder="<?php _e('Search...','wpshop'); ?>" id="search_element_text" /> |
|
89 | - <button type="button" name="search_element_button" id="search_element_button" ><?php _e('Search','wpshop'); ?></button> |
|
90 | - <button type="button" name="view_all_element_button" id="view_all_element_button" ><?php _e('View all element','wpshop'); ?></button> |
|
88 | + <input type="text" value="" placeholder="<?php _e('Search...', 'wpshop'); ?>" id="search_element_text" /> |
|
89 | + <button type="button" name="search_element_button" id="search_element_button" ><?php _e('Search', 'wpshop'); ?></button> |
|
90 | + <button type="button" name="view_all_element_button" id="view_all_element_button" ><?php _e('View all element', 'wpshop'); ?></button> |
|
91 | 91 | </div> |
92 | 92 | <?php |
93 | 93 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | if ($display_option_display_type) { |
108 | 108 | ?> |
109 | - <?php if ( !empty($specific_options) ) : ?><p><?php _e('Generic options', 'wpshop'); ?></p><?php endif; ?> |
|
109 | + <?php if (!empty($specific_options)) : ?><p><?php _e('Generic options', 'wpshop'); ?></p><?php endif; ?> |
|
110 | 110 | <div class="wpshop_wysiwyg_shortcode_display_type_container" > |
111 | 111 | <?php _e('Display as', 'wpshop'); ?> |
112 | 112 | <input type="radio" name="wpshop_wysiwyg_shortcode_display_type" id="wpshop_wysiwyg_shortcode_display_type_grid" class="wpshop_wysiwyg_shortcode_display_option wpshop_wysiwyg_shortcode_display_type" value="grid" checked > <label for="wpshop_wysiwyg_shortcode_display_type_grid" ><?php _e('Grid', 'wpshop'); ?></label> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
3 | 5 | require_once('../../../../../wp-load.php'); |
4 | 6 | header('Content-Type: text/html; charset=' . get_bloginfo('charset')); |
@@ -140,8 +142,11 @@ discard block |
||
140 | 142 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="wpShop_Dialog_Action.insert();" /> |
141 | 143 | </div> |
142 | 144 | </div> |
143 | -<?php else: ?> |
|
144 | - <span class="wpshop_wysiwyg_error_msg" ><?php _e('You are not allowed to continue here', 'wpshop'); ?></span> |
|
145 | +<?php else { |
|
146 | + : ?> |
|
147 | + <span class="wpshop_wysiwyg_error_msg" ><?php _e('You are not allowed to continue here', 'wpshop'); |
|
148 | +} |
|
149 | +?></span> |
|
145 | 150 | <?php endif; ?> |
146 | 151 | </form> |
147 | 152 | </body> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /* Wordpress - Ajax functionnality activation */ |
4 | 6 | DEFINE('DOING_AJAX', true); |
@@ -216,8 +218,7 @@ discard block |
||
216 | 218 | $html2pdf->writeHTML($html_content); |
217 | 219 | |
218 | 220 | $html2pdf->Output( __('Bank deposit', 'wpshop') . ' - ' . mysql2date( get_option( 'date_format' ), $_GET['fromdate'] ) . '.pdf', 'D'); |
219 | - } |
|
220 | - catch (HTML2PDF_exception $e) { |
|
221 | + } catch (HTML2PDF_exception $e) { |
|
221 | 222 | echo $e; |
222 | 223 | exit; |
223 | 224 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | 3 | /* Wordpress - Ajax functionnality activation */ |
4 | 4 | DEFINE('DOING_AJAX', true); |
@@ -7,23 +7,23 @@ discard block |
||
7 | 7 | /* Wordpress - Admin page that define some needed vars and include file */ |
8 | 8 | require_once(ABSPATH . 'wp-admin/includes/admin.php'); |
9 | 9 | |
10 | - $fromdate = empty( $fromdate ) ? date( 'Y-m-d' ) : sanitize_text_field( $_GET['fromdate'] ); |
|
11 | - $method = empty( $_GET['method'] ) ? 'all' : sanitize_text_field( $_GET['method'] ); |
|
12 | - $mode = !empty( $_GET['mode'] ) ? sanitize_text_field( $_GET['mode'] ) : ''; |
|
10 | + $fromdate = empty($fromdate) ? date('Y-m-d') : sanitize_text_field($_GET['fromdate']); |
|
11 | + $method = empty($_GET['method']) ? 'all' : sanitize_text_field($_GET['method']); |
|
12 | + $mode = !empty($_GET['mode']) ? sanitize_text_field($_GET['mode']) : ''; |
|
13 | 13 | |
14 | 14 | $valid_dates = array(); |
15 | 15 | $valid_dates['relation'] = 'OR'; |
16 | 16 | |
17 | - $from_to = !empty( $_GET['todate'] ) : sanitize_text_field( $_GET['todate'] ) : date( 'Y-m-d' ); |
|
17 | + $from_to = !empty($_GET['todate']) : sanitize_text_field($_GET['todate']) : date('Y-m-d'); |
|
18 | 18 | |
19 | - $fromdate = DateTime::createFromFormat( 'Y-m-d', $fromdate ); |
|
20 | - $todate = DateTime::createFromFormat( 'Y-m-d', ($from_to) ? $from_to : $fromdate ); |
|
21 | - $datePeriod = new DatePeriod( $fromdate, new DateInterval('P1D'), $todate->modify('+1 day') ); |
|
19 | + $fromdate = DateTime::createFromFormat('Y-m-d', $fromdate); |
|
20 | + $todate = DateTime::createFromFormat('Y-m-d', ($from_to) ? $from_to : $fromdate); |
|
21 | + $datePeriod = new DatePeriod($fromdate, new DateInterval('P1D'), $todate->modify('+1 day')); |
|
22 | 22 | |
23 | - foreach($datePeriod as $date) { |
|
23 | + foreach ($datePeriod as $date) { |
|
24 | 24 | $valid_dates[] = array( |
25 | 25 | 'key' => '_order_postmeta', |
26 | - 'value' => serialize( 'date' ) . 's:19:"' . $date->format( 'Y-m-d' ), |
|
26 | + 'value' => serialize('date') . 's:19:"' . $date->format('Y-m-d'), |
|
27 | 27 | 'compare' => 'LIKE', |
28 | 28 | ); |
29 | 29 | } |
@@ -36,30 +36,30 @@ discard block |
||
36 | 36 | 'relation' => 'AND', |
37 | 37 | array( |
38 | 38 | 'key' => '_order_postmeta', |
39 | - 'value' => serialize( 'order_status' ) . serialize( 'pos' ), |
|
39 | + 'value' => serialize('order_status') . serialize('pos'), |
|
40 | 40 | 'compare' => 'LIKE', |
41 | 41 | ), |
42 | 42 | $valid_dates, |
43 | 43 | ), |
44 | 44 | ); |
45 | - if( $method != 'all' ) { |
|
45 | + if ($method != 'all') { |
|
46 | 46 | $args['meta_query'][] = array( |
47 | 47 | 'key' => '_order_postmeta', |
48 | - 'value' => serialize( 'method' ) . serialize( $method ), |
|
48 | + 'value' => serialize('method') . serialize($method), |
|
49 | 49 | 'compare' => 'LIKE', |
50 | 50 | ); |
51 | 51 | } |
52 | - $query = new WP_Query( $args ); |
|
52 | + $query = new WP_Query($args); |
|
53 | 53 | |
54 | 54 | $orders = $query->posts; |
55 | 55 | $orders_date = array(); |
56 | 56 | |
57 | - foreach( $orders as $order ) { |
|
58 | - $order->_order_postmeta = get_post_meta( $order->ID, '_order_postmeta', true ); |
|
59 | - foreach( $order->_order_postmeta['order_payment']['received'] as $payment_received ) { |
|
60 | - if( $payment_received['status'] == 'payment_received' ) { |
|
57 | + foreach ($orders as $order) { |
|
58 | + $order->_order_postmeta = get_post_meta($order->ID, '_order_postmeta', true); |
|
59 | + foreach ($order->_order_postmeta['order_payment']['received'] as $payment_received) { |
|
60 | + if ($payment_received['status'] == 'payment_received') { |
|
61 | 61 | $payment_received['order'] = $order; |
62 | - if( !isset( $orders_date[$payment_received['method']] ) ) { $orders_date[$payment_received['method']]['amount_total'] = 0; } |
|
62 | + if (!isset($orders_date[$payment_received['method']])) { $orders_date[$payment_received['method']]['amount_total'] = 0; } |
|
63 | 63 | @$orders_date[$payment_received['method']]['amount_total'] += $payment_received['received_amount']; |
64 | 64 | @$orders_date[$payment_received['method']]['list'][] = $payment_received; |
65 | 65 | @$orders_date['all']['amount_total'] += $payment_received['received_amount']; |
@@ -143,18 +143,18 @@ discard block |
||
143 | 143 | <td class="width-15"><?php echo $company['company_street']; ?></td> |
144 | 144 | <td class="valign-top width-075"><?php _e('Date', 'wpshop'); ?>:</td> |
145 | 145 | <td class="align-right width-075"> |
146 | - <?php if( $from_to ) { ?> |
|
147 | - <span class="force-one-line"><?php echo __( 'From', 'wpshop' ) . ' ' . mysql2date( get_option( 'date_format' ), $fromdate, true ); ?></span> |
|
148 | - <span class="force-one-line"><?php echo __( 'to', 'wpshop' ) . ' ' . mysql2date( get_option( 'date_format' ), $from_to, true ); ?></span> |
|
146 | + <?php if ($from_to) { ?> |
|
147 | + <span class="force-one-line"><?php echo __('From', 'wpshop') . ' ' . mysql2date(get_option('date_format'), $fromdate, true); ?></span> |
|
148 | + <span class="force-one-line"><?php echo __('to', 'wpshop') . ' ' . mysql2date(get_option('date_format'), $from_to, true); ?></span> |
|
149 | 149 | <?php } else { ?> |
150 | - <span class="force-one-line"><?php echo mysql2date( get_option( 'date_format' ), $fromdate, true ); ?></span> |
|
150 | + <span class="force-one-line"><?php echo mysql2date(get_option('date_format'), $fromdate, true); ?></span> |
|
151 | 151 | <?php } ?> |
152 | 152 | </td> |
153 | 153 | </tr> |
154 | 154 | <tr> |
155 | 155 | <td class="width-15"><?php echo $company['company_postcode'] . ' ' . $company['company_country']; ?></td> |
156 | - <td class="width-075"><?php _e('Method', 'wpshop' ); ?>:</td> |
|
157 | - <td class="align-right width-075"><?php _e( $method, 'wpshop' ); ?></td> |
|
156 | + <td class="width-075"><?php _e('Method', 'wpshop'); ?>:</td> |
|
157 | + <td class="align-right width-075"><?php _e($method, 'wpshop'); ?></td> |
|
158 | 158 | </tr> |
159 | 159 | </table> |
160 | 160 | <br> |
@@ -162,40 +162,40 @@ discard block |
||
162 | 162 | <thead class="border"> |
163 | 163 | <tr> |
164 | 164 | <th class="margin-sides"><?php _e('Invoice', 'wps-pos-i18n'); ?></th> |
165 | - <th class="margin-sides"><?php echo ( $from_to ) ? __('Date', 'wps-pos-i18n') : __('Hour', 'wpshop'); ?></th> |
|
165 | + <th class="margin-sides"><?php echo ($from_to) ? __('Date', 'wps-pos-i18n') : __('Hour', 'wpshop'); ?></th> |
|
166 | 166 | <th class="margin-sides"><?php _e('Order', 'wpshop'); ?></th> |
167 | 167 | <th class="width-100"><?php _e('Products', 'wpshop'); ?></th> |
168 | 168 | <th class="margin-sides"><?php _e('Amount', 'wps-pos-i18n'); ?></th> |
169 | 169 | </tr> |
170 | 170 | </thead> |
171 | 171 | <tbody class="border"> |
172 | - <?php if( empty( $orders_date[$method] ) ) { $orders_date[$method] = array(); $orders_date[$method]['list'] = array(); $orders_date[$method]['amount_total'] = 0; } ?> |
|
173 | - <?php foreach( $orders_date[$method]['list'] as $payment_received ) : ?> |
|
172 | + <?php if (empty($orders_date[$method])) { $orders_date[$method] = array(); $orders_date[$method]['list'] = array(); $orders_date[$method]['amount_total'] = 0; } ?> |
|
173 | + <?php foreach ($orders_date[$method]['list'] as $payment_received) : ?> |
|
174 | 174 | <tr> |
175 | - <td class="margin-sides"><?php echo ( !empty($payment_received['invoice_ref']) ) ? $payment_received['invoice_ref'] : ''; ?></td> |
|
176 | - <td class="force-one-line margin-sides"><?php echo ( !empty($payment_received['date']) ) ? ( $from_to ) ? mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $payment_received['date'], true ) : mysql2date( get_option( 'time_format' ), $payment_received['date'], true ) : ''; ?></td> |
|
177 | - <td class="margin-sides"><?php echo ( !empty($payment_received['order']->_order_postmeta['order_key']) ) ? $payment_received['order']->_order_postmeta['order_key'] : ''; ?></td> |
|
175 | + <td class="margin-sides"><?php echo (!empty($payment_received['invoice_ref'])) ? $payment_received['invoice_ref'] : ''; ?></td> |
|
176 | + <td class="force-one-line margin-sides"><?php echo (!empty($payment_received['date'])) ? ($from_to) ? mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $payment_received['date'], true) : mysql2date(get_option('time_format'), $payment_received['date'], true) : ''; ?></td> |
|
177 | + <td class="margin-sides"><?php echo (!empty($payment_received['order']->_order_postmeta['order_key'])) ? $payment_received['order']->_order_postmeta['order_key'] : ''; ?></td> |
|
178 | 178 | <td class="max-width align-center force-one-line"><?php |
179 | - if( !empty($payment_received['order']->_order_postmeta['order_items']) ) { |
|
179 | + if (!empty($payment_received['order']->_order_postmeta['order_items'])) { |
|
180 | 180 | $first = true; |
181 | - foreach( $payment_received['order']->_order_postmeta['order_items'] as $item ) { |
|
182 | - if( $first ) { |
|
181 | + foreach ($payment_received['order']->_order_postmeta['order_items'] as $item) { |
|
182 | + if ($first) { |
|
183 | 183 | $first = !$first; |
184 | 184 | echo $item['item_name']; |
185 | 185 | } else { |
186 | - echo ', ' .$item['item_name']; |
|
186 | + echo ', ' . $item['item_name']; |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | } |
190 | 190 | ?></td> |
191 | - <td class="align-right margin-sides"><?php echo ( !empty($payment_received['received_amount']) ) ? number_format( $payment_received['received_amount'], 2, '.', '' ) : ''; ?><?php echo wpshop_tools::wpshop_get_currency(); ?></td> |
|
191 | + <td class="align-right margin-sides"><?php echo (!empty($payment_received['received_amount'])) ? number_format($payment_received['received_amount'], 2, '.', '') : ''; ?><?php echo wpshop_tools::wpshop_get_currency(); ?></td> |
|
192 | 192 | </tr> |
193 | 193 | <?php endforeach; ?> |
194 | 194 | </tbody> |
195 | 195 | <tfoot class="border"> |
196 | 196 | <tr> |
197 | 197 | <td colspan="4" class="margin-sides bold"><?php _e('Bank deposit sum', 'wpshop'); ?></td> |
198 | - <td class="align-right border margin-sides bold"><?php echo number_format( $orders_date[$method]['amount_total'], 2, '.', '' ) . wpshop_tools::wpshop_get_currency(); ?></td> |
|
198 | + <td class="align-right border margin-sides bold"><?php echo number_format($orders_date[$method]['amount_total'], 2, '.', '') . wpshop_tools::wpshop_get_currency(); ?></td> |
|
199 | 199 | </tr> |
200 | 200 | </tfoot> |
201 | 201 | </table> |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | $content = ob_get_contents(); |
204 | 204 | ob_end_clean(); |
205 | 205 | |
206 | - if ( !empty( $mode ) && $mode == 'pdf') { |
|
207 | - require_once(WPSHOP_LIBRAIRIES_DIR.'HTML2PDF/html2pdf.class.php'); |
|
206 | + if (!empty($mode) && $mode == 'pdf') { |
|
207 | + require_once(WPSHOP_LIBRAIRIES_DIR . 'HTML2PDF/html2pdf.class.php'); |
|
208 | 208 | try { |
209 | 209 | $html_content = $content_css . '<page>' . $content . '</page>'; |
210 | 210 | $html2pdf = new HTML2PDF('P', 'A4', 'fr'); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $html2pdf->setDefaultFont('Arial'); |
213 | 213 | $html2pdf->writeHTML($html_content); |
214 | 214 | |
215 | - $html2pdf->Output( __('Bank deposit', 'wpshop') . ' - ' . mysql2date( get_option( 'date_format' ), $fromdate ) . '.pdf', 'D'); |
|
215 | + $html2pdf->Output(__('Bank deposit', 'wpshop') . ' - ' . mysql2date(get_option('date_format'), $fromdate) . '.pdf', 'D'); |
|
216 | 216 | } |
217 | 217 | catch (HTML2PDF_exception $e) { |
218 | 218 | echo $e; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | <!--<![endif]--> |
229 | 229 | <head> |
230 | 230 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
231 | - <title><?php _e('Bank deposit', 'wpshop'); ?> - <?php echo mysql2date( get_option( 'date_format' ), $fromdate ); ?></title> |
|
231 | + <title><?php _e('Bank deposit', 'wpshop'); ?> - <?php echo mysql2date(get_option('date_format'), $fromdate); ?></title> |
|
232 | 232 | <?php echo $content_css; ?> |
233 | 233 | </head> |
234 | 234 | <body> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /* Wordpress - Ajax functionnality activation */ |
3 | 3 | DEFINE('DOING_AJAX', true); |
4 | 4 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | $mode = (!empty($_GET['mode'])) ? wpshop_tools::varSanitizer($_GET['mode']) : 'html'; |
12 | 12 | // $is_credit_slip = (!empty($_GET['credit_slip'])) ? wpshop_tools::varSanitizer($_GET['credit_slip']) : null; |
13 | 13 | |
14 | -if ( !empty($order_id) ) { |
|
14 | +if (!empty($order_id)) { |
|
15 | 15 | // /** Order reading */ |
16 | 16 | $order_postmeta = get_post_meta($order_id, '_order_postmeta', true); |
17 | - $html_content = wps_credit::generate_credit_slip($order_id, $invoice_ref ); |
|
17 | + $html_content = wps_credit::generate_credit_slip($order_id, $invoice_ref); |
|
18 | 18 | |
19 | - if ( $mode == 'pdf') { |
|
20 | - require_once(WPSHOP_LIBRAIRIES_DIR.'HTML2PDF/html2pdf.class.php'); |
|
19 | + if ($mode == 'pdf') { |
|
20 | + require_once(WPSHOP_LIBRAIRIES_DIR . 'HTML2PDF/html2pdf.class.php'); |
|
21 | 21 | try { |
22 | 22 | $html_content = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common') . '<page>' . $html_content . '</page>'; |
23 | 23 | $html2pdf = new HTML2PDF('P', 'A4', 'fr'); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $html2pdf->setDefaultFont('Arial'); |
26 | 26 | $html2pdf->writeHTML($html_content); |
27 | 27 | |
28 | - $html2pdf->Output('order_' .$order_id. '.pdf', 'D'); |
|
28 | + $html2pdf->Output('order_' . $order_id . '.pdf', 'D'); |
|
29 | 29 | } |
30 | 30 | catch (HTML2PDF_exception $e) { |
31 | 31 | echo $e; |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | else { |
36 | - $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
|
36 | + $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
|
37 | 37 | $tpl_component['INVOICE_MAIN_PAGE'] = $html_content; |
38 | - $tpl_component['INVOICE_TITLE_PAGE'] = sprintf( __('Credit slip #%s for Order #%s', 'wpshop'), $invoice_ref, $order_postmeta['order_key']); |
|
38 | + $tpl_component['INVOICE_TITLE_PAGE'] = sprintf(__('Credit slip #%s for Order #%s', 'wpshop'), $invoice_ref, $order_postmeta['order_key']); |
|
39 | 39 | echo wpshop_display::display_template_element('invoice_page', $tpl_component, array(), 'common'); |
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /* Wordpress - Ajax functionnality activation */ |
3 | 5 | DEFINE('DOING_AJAX', true); |
4 | 6 | /* Wordpress - Main bootstrap file that load wordpress basic files */ |
@@ -26,13 +28,11 @@ discard block |
||
26 | 28 | $html2pdf->writeHTML($html_content); |
27 | 29 | |
28 | 30 | $html2pdf->Output('order_' .$order_id. '.pdf', 'D'); |
29 | - } |
|
30 | - catch (HTML2PDF_exception $e) { |
|
31 | + } catch (HTML2PDF_exception $e) { |
|
31 | 32 | echo $e; |
32 | 33 | exit; |
33 | 34 | } |
34 | - } |
|
35 | - else { |
|
35 | + } else { |
|
36 | 36 | $tpl_component['INVOICE_CSS'] = wpshop_display::display_template_element('invoice_page_content_css', array(), array(), 'common'); |
37 | 37 | $tpl_component['INVOICE_MAIN_PAGE'] = $html_content; |
38 | 38 | $tpl_component['INVOICE_TITLE_PAGE'] = sprintf( __('Credit slip #%s for Order #%s', 'wpshop'), $invoice_ref, $order_postmeta['order_key']); |
@@ -1,95 +1,95 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | -__('Account creation confirmation', 'wpshop' ); |
|
3 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your account has just been created. Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
4 | -__( 'User account creation confirmation message', 'wpshop' ); |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | +__('Account creation confirmation', 'wpshop'); |
|
3 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your account has just been created. Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
4 | +__('User account creation confirmation message', 'wpshop'); |
|
5 | 5 | |
6 | -__('Renewal of password', 'wpshop' ); |
|
7 | -__('Hello [customer_first_name] [customer_last_name], <br />Somebody has asked a renewal of password for your account.<br/><br/>To renew your password, click on this link : [forgot_password_link].<br/>If you are not at the origin of this request, please ignore this message.', 'wpshop' ); |
|
8 | -__('Send to customer a link to renew its password', 'wpshop' ); |
|
6 | +__('Renewal of password', 'wpshop'); |
|
7 | +__('Hello [customer_first_name] [customer_last_name], <br />Somebody has asked a renewal of password for your account.<br/><br/>To renew your password, click on this link : [forgot_password_link].<br/>If you are not at the origin of this request, please ignore this message.', 'wpshop'); |
|
8 | +__('Send to customer a link to renew its password', 'wpshop'); |
|
9 | 9 | |
10 | -__('Order payment confirmation (Paypal id [paypal_order_key])', 'wpshop' ); |
|
11 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your payment about your recent order on our website has been completed (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
12 | -__('User paypal payment reception confirmation', 'wpshop' ); |
|
10 | +__('Order payment confirmation (Paypal id [paypal_order_key])', 'wpshop'); |
|
11 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your payment about your recent order on our website has been completed (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
12 | +__('User paypal payment reception confirmation', 'wpshop'); |
|
13 | 13 | |
14 | -__('Pay and finalize your order', 'wpshop' ); |
|
15 | -__('Hello [customer_first_name] [customer_last_name], <br />An order is available for you on our website.<br/>You can click on this link to pay and finalize this order : [direct_payment_link]<br/><br/>[order_content]<br /><br />Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
16 | -__('Send a link for finalize its order directly', 'wpshop' ); |
|
14 | +__('Pay and finalize your order', 'wpshop'); |
|
15 | +__('Hello [customer_first_name] [customer_last_name], <br />An order is available for you on our website.<br/>You can click on this link to pay and finalize this order : [direct_payment_link]<br/><br/>[order_content]<br /><br />Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
16 | +__('Send a link for finalize its order directly', 'wpshop'); |
|
17 | 17 | |
18 | -__('Your payment has been received', 'wpshop' ); |
|
19 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your payment regarding your order ([order_key]) has just been received (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
20 | -__('User payment reception confirmation', 'wpshop' ); |
|
18 | +__('Your payment has been received', 'wpshop'); |
|
19 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your payment regarding your order ([order_key]) has just been received (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
20 | +__('User payment reception confirmation', 'wpshop'); |
|
21 | 21 | |
22 | -__('Your order has been shipped', 'wpshop' ); |
|
23 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your order ([order_key]) has just been shipped (order date : [order_date], tracking number : [order_trackingNumber]). Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
24 | -__('Order shipping message', 'wpshop' ); |
|
22 | +__('Your order has been shipped', 'wpshop'); |
|
23 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your order ([order_key]) has just been shipped (order date : [order_date], tracking number : [order_trackingNumber]). Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
24 | +__('Order shipping message', 'wpshop'); |
|
25 | 25 | |
26 | -__('Your order has been recorded', 'wpshop' ); |
|
27 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your order has been recorded (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
28 | -__('User order confirmation', 'wpshop' ); |
|
26 | +__('Your order has been recorded', 'wpshop'); |
|
27 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your order has been recorded (order date : [order_date]). Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
28 | +__('User order confirmation', 'wpshop'); |
|
29 | 29 | |
30 | -__('Your order has been updated', 'wpshop' ); |
|
31 | -__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. Please login to your account to view details. Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
32 | -__('Notify a customer when order is updated', 'wpshop' ); |
|
30 | +__('Your order has been updated', 'wpshop'); |
|
31 | +__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. Please login to your account to view details. Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
32 | +__('Notify a customer when order is updated', 'wpshop'); |
|
33 | 33 | |
34 | -__('Your order has been canceled', 'wpshop' ); |
|
35 | -__('Hello [customer_first_name] [customer_last_name], <br />this email confirms your order ( Order key : [order_key] - Date : [order_date] ) has been canceled.<br /><br /> Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
36 | -__('Notify a customer when order is canceled', 'wpshop' ); |
|
34 | +__('Your order has been canceled', 'wpshop'); |
|
35 | +__('Hello [customer_first_name] [customer_last_name], <br />this email confirms your order ( Order key : [order_key] - Date : [order_date] ) has been canceled.<br /><br /> Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
36 | +__('Notify a customer when order is canceled', 'wpshop'); |
|
37 | 37 | |
38 | -__('A comment has been added to your order', 'wpshop' ); |
|
39 | -__('Your order has been updated', 'wpshop' ); |
|
40 | -__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. A comment has been added:<br/><br/>[message].<br/><br/> Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
41 | -__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. A comment has been added:[message]. Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
42 | -__('Private update on an order', 'wpshop' ); |
|
38 | +__('A comment has been added to your order', 'wpshop'); |
|
39 | +__('Your order has been updated', 'wpshop'); |
|
40 | +__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. A comment has been added:<br/><br/>[message].<br/><br/> Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
41 | +__('Hello [customer_first_name] [customer_last_name], your order ([order_key]) has just been updated. A comment has been added:[message]. Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
42 | +__('Private update on an order', 'wpshop'); |
|
43 | 43 | |
44 | -__('New order on your shop', 'wpshop' ); |
|
45 | -__('Hello, New order on your shop ! Order Key : [order_key], Order date : [order_date], Order payment method : [order_payment_method], [order_content] [order_addresses] [order_customer_comments]', 'wpshop' ); |
|
46 | -__('New order on shop sended to shop administrator', 'wpshop' ); |
|
44 | +__('New order on your shop', 'wpshop'); |
|
45 | +__('Hello, New order on your shop ! Order Key : [order_key], Order date : [order_date], Order payment method : [order_payment_method], [order_content] [order_addresses] [order_customer_comments]', 'wpshop'); |
|
46 | +__('New order on shop sended to shop administrator', 'wpshop'); |
|
47 | 47 | |
48 | -__('New quotation on your shop', 'wpshop' ); |
|
49 | -__('Hello, New quotation on your shop ! Quotation Key : [order_temporary_key], Quotation date : [order_date], [order_content] [order_addresses] [order_customer_comments]', 'wpshop' ); |
|
50 | -__('New quotation on shop sended to shop administrator', 'wpshop' ); |
|
48 | +__('New quotation on your shop', 'wpshop'); |
|
49 | +__('Hello, New quotation on your shop ! Quotation Key : [order_temporary_key], Quotation date : [order_date], [order_content] [order_addresses] [order_customer_comments]', 'wpshop'); |
|
50 | +__('New quotation on shop sended to shop administrator', 'wpshop'); |
|
51 | 51 | |
52 | -__('Your quotation has been recorded', 'wpshop' ); |
|
53 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your order has been recorded (Quotation date : [order_date]). [order_content]', 'wpshop' ); |
|
54 | -__('User quotation confirmation', 'wpshop' ); |
|
52 | +__('Your quotation has been recorded', 'wpshop'); |
|
53 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your order has been recorded (Quotation date : [order_date]). [order_content]', 'wpshop'); |
|
54 | +__('User quotation confirmation', 'wpshop'); |
|
55 | 55 | |
56 | -__('Your quotation has been updated', 'wpshop' ); |
|
57 | -__('Hello [customer_first_name] [customer_last_name], this email confirms that your quotation has been updated (Quotation date : [order_date]). [order_content]', 'wpshop' ); |
|
58 | -__('Notify a customer when quotation is updated', 'wpshop' ); |
|
56 | +__('Your quotation has been updated', 'wpshop'); |
|
57 | +__('Hello [customer_first_name] [customer_last_name], this email confirms that your quotation has been updated (Quotation date : [order_date]). [order_content]', 'wpshop'); |
|
58 | +__('Notify a customer when quotation is updated', 'wpshop'); |
|
59 | 59 | |
60 | -__('Your downloadable product is available', 'wpshop' ); |
|
61 | -__('Hello [customer_first_name] [customer_last_name],<br/>this email confirms that your downloadable product is available : [download_product_link].<br/><br/>Thank you for your loyalty. Have a good day.', 'wpshop' ); |
|
62 | -__('Notify a customer when downloadable file is available after an order', 'wpshop' ); |
|
60 | +__('Your downloadable product is available', 'wpshop'); |
|
61 | +__('Hello [customer_first_name] [customer_last_name],<br/>this email confirms that your downloadable product is available : [download_product_link].<br/><br/>Thank you for your loyalty. Have a good day.', 'wpshop'); |
|
62 | +__('Notify a customer when downloadable file is available after an order', 'wpshop'); |
|
63 | 63 | |
64 | 64 | |
65 | -__('Shop', 'wpshop' ); |
|
66 | -__('shop', 'wpshop' ); |
|
67 | -__('Display shop product list', 'wpshop' ); |
|
65 | +__('Shop', 'wpshop'); |
|
66 | +__('shop', 'wpshop'); |
|
67 | +__('Display shop product list', 'wpshop'); |
|
68 | 68 | |
69 | -__('Cart', 'wpshop' ); |
|
70 | -__('cart', 'wpshop' ); |
|
71 | -__('Display the cart page', 'wpshop' ); |
|
69 | +__('Cart', 'wpshop'); |
|
70 | +__('cart', 'wpshop'); |
|
71 | +__('Display the cart page', 'wpshop'); |
|
72 | 72 | |
73 | -__('Checkout', 'wpshop' ); |
|
74 | -__('checkout', 'wpshop' ); |
|
75 | -__('Display the checkout page', 'wpshop' ); |
|
73 | +__('Checkout', 'wpshop'); |
|
74 | +__('checkout', 'wpshop'); |
|
75 | +__('Display the checkout page', 'wpshop'); |
|
76 | 76 | |
77 | -__('My account', 'wpshop' ); |
|
78 | -__('myaccount', 'wpshop' ); |
|
79 | -__('Display the user account page', 'wpshop' ); |
|
77 | +__('My account', 'wpshop'); |
|
78 | +__('myaccount', 'wpshop'); |
|
79 | +__('Display the user account page', 'wpshop'); |
|
80 | 80 | |
81 | -__('Signup', 'wpshop' ); |
|
82 | -__('signup', 'wpshop' ); |
|
83 | -__('Display the signout page', 'wpshop' ); |
|
81 | +__('Signup', 'wpshop'); |
|
82 | +__('signup', 'wpshop'); |
|
83 | +__('Display the signout page', 'wpshop'); |
|
84 | 84 | |
85 | -__('Payment return successfull', 'wpshop' ); |
|
86 | -__('return', 'wpshop' ); |
|
87 | -__('Page for succesfull payment return', 'wpshop' ); |
|
85 | +__('Payment return successfull', 'wpshop'); |
|
86 | +__('return', 'wpshop'); |
|
87 | +__('Page for succesfull payment return', 'wpshop'); |
|
88 | 88 | |
89 | -__('Payment return unsuccessfull', 'wpshop' ); |
|
90 | -__('unsuccessfull_payment_return', 'wpshop' ); |
|
91 | -__('Page for unsuccesfull payment return', 'wpshop' ); |
|
89 | +__('Payment return unsuccessfull', 'wpshop'); |
|
90 | +__('unsuccessfull_payment_return', 'wpshop'); |
|
91 | +__('Page for unsuccesfull payment return', 'wpshop'); |
|
92 | 92 | |
93 | -__('Terms of sale', 'wpshop' ); |
|
94 | -__('terms-of-sale', 'wpshop' ); |
|
95 | -__('Define the page for terms of sale', 'wpshop' ); |
|
93 | +__('Terms of sale', 'wpshop'); |
|
94 | +__('terms-of-sale', 'wpshop'); |
|
95 | +__('Define the page for terms of sale', 'wpshop'); |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |
@@ -1,4 +1,4 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * Plugin database options |
4 | 4 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Fichier de définition du modèle des taxinomies / File for term model definition |
4 | 6 | * |