@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | global $wpdb; ?> |
3 | 3 | <page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt"> |
4 | 4 | <page_header> |
@@ -8,60 +8,60 @@ discard block |
||
8 | 8 | </page_header> |
9 | 9 | <table style="width:100%"> |
10 | 10 | <tr> |
11 | - <td class="picture_container" style="width : 30%"><?php echo get_the_post_thumbnail($product_id, 'medium' ); ?></td> |
|
11 | + <td class="picture_container" style="width : 30%"><?php echo get_the_post_thumbnail($product_id, 'medium'); ?></td> |
|
12 | 12 | <td style="width : 60%;" valign="top" align="justify"> |
13 | - <?php if( !empty($shop_type) && $shop_type == 'sale' && !empty($product_price_data) ) : ?> |
|
14 | - <p><u><?php _e( 'Product price', 'wpshop'); ?></u> :</p> |
|
13 | + <?php if (!empty($shop_type) && $shop_type == 'sale' && !empty($product_price_data)) : ?> |
|
14 | + <p><u><?php _e('Product price', 'wpshop'); ?></u> :</p> |
|
15 | 15 | <p> |
16 | - <?php if( !empty($product_price_data['PRICE_FROM']) ) : ?> |
|
17 | - <?php _e( 'Price from', 'wpshop'); ?> |
|
16 | + <?php if (!empty($product_price_data['PRICE_FROM'])) : ?> |
|
17 | + <?php _e('Price from', 'wpshop'); ?> |
|
18 | 18 | <?php endif; ?> |
19 | - <?php echo utf8_decode( $product_price_data['PRODUCT_PRICE'] ); ?> |
|
19 | + <?php echo utf8_decode($product_price_data['PRODUCT_PRICE']); ?> |
|
20 | 20 | </p> |
21 | 21 | <?php endif; ?> |
22 | - <p><u><?php _e( 'Product description', 'wpshop'); ?> :</u></p> |
|
23 | - <p><?php echo nl2br( utf8_decode($product->post_content) ); ?></p> |
|
22 | + <p><u><?php _e('Product description', 'wpshop'); ?> :</u></p> |
|
23 | + <p><?php echo nl2br(utf8_decode($product->post_content)); ?></p> |
|
24 | 24 | </td> |
25 | 25 | </tr> |
26 | 26 | </table> |
27 | 27 | |
28 | - <?php if( !empty($product_atts_def) && !empty($product_atts_def[$product_id]) ) : ?> |
|
28 | + <?php if (!empty($product_atts_def) && !empty($product_atts_def[$product_id])) : ?> |
|
29 | 29 | <?php |
30 | 30 | $i = 1; |
31 | - foreach( $product_atts_def[$product_id] as $group_id => $group_data ) : |
|
31 | + foreach ($product_atts_def[$product_id] as $group_id => $group_data) : |
|
32 | 32 | ?> |
33 | 33 | <table class="content"> |
34 | 34 | <tr style="padding-top : 10px ;margin-top : 10px; border : 1px dotted #CCCCCC;"> |
35 | 35 | <td style="width : 100%;"> |
36 | - <h2><?php echo $i; ?>. <?php echo utf8_decode( $group_id ); ?></h2> |
|
36 | + <h2><?php echo $i; ?>. <?php echo utf8_decode($group_id); ?></h2> |
|
37 | 37 | <ul> |
38 | 38 | <?php |
39 | - if( !empty($group_data) && !empty($group_data['attributes']) ) : |
|
40 | - foreach( $group_data['attributes'] as $attribute ) : |
|
41 | - if( !empty($attribute) && !empty($attribute['data_type']) && $attribute['data_type'] == 'integer' && !empty($attribute['value']) ) : |
|
42 | - if( $attribute['backend_input'] == 'multiple-select' && is_array($attribute['value']) ) : |
|
39 | + if (!empty($group_data) && !empty($group_data['attributes'])) : |
|
40 | + foreach ($group_data['attributes'] as $attribute) : |
|
41 | + if (!empty($attribute) && !empty($attribute['data_type']) && $attribute['data_type'] == 'integer' && !empty($attribute['value'])) : |
|
42 | + if ($attribute['backend_input'] == 'multiple-select' && is_array($attribute['value'])) : |
|
43 | 43 | $j = 0; |
44 | - foreach( $attribute['value'] as $value ) : |
|
45 | - $query = $wpdb->prepare( 'SELECT label FROM ' .WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS. ' WHERE id = %d', $value ); |
|
46 | - $attribute['value'][$j] = $wpdb->get_var( $query ); |
|
44 | + foreach ($attribute['value'] as $value) : |
|
45 | + $query = $wpdb->prepare('SELECT label FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE id = %d', $value); |
|
46 | + $attribute['value'][$j] = $wpdb->get_var($query); |
|
47 | 47 | $j++; |
48 | 48 | endforeach; |
49 | 49 | else : |
50 | - $query = $wpdb->prepare( 'SELECT label FROM ' .WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS. ' WHERE id = %d', $attribute['value'] ); |
|
51 | - $attribute['value'] = $wpdb->get_var( $query ); |
|
50 | + $query = $wpdb->prepare('SELECT label FROM ' . WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS . ' WHERE id = %d', $attribute['value']); |
|
51 | + $attribute['value'] = $wpdb->get_var($query); |
|
52 | 52 | endif; |
53 | - elseif( !empty($attribute) && !empty($attribute['data_type']) && $attribute['data_type'] == 'decimal' ) : |
|
54 | - $attribute['value'] = wpshop_tools::formate_number( $attribute['value'] ); |
|
53 | + elseif (!empty($attribute) && !empty($attribute['data_type']) && $attribute['data_type'] == 'decimal') : |
|
54 | + $attribute['value'] = wpshop_tools::formate_number($attribute['value']); |
|
55 | 55 | endif; |
56 | 56 | ?> |
57 | - <li><?php _e( $attribute['frontend_label'], 'wpshop' ); ?> : |
|
57 | + <li><?php _e($attribute['frontend_label'], 'wpshop'); ?> : |
|
58 | 58 | <?php |
59 | - if( $attribute['backend_input'] == 'multiple-select' && is_array($attribute['value']) ) : |
|
60 | - foreach( $attribute['value'] as $v ) : |
|
61 | - echo __( $v, 'wpshop' ).' '.( (!empty($attribute['unit']) ) ? '('.$attribute['unit'].')' : '' ).', '; |
|
59 | + if ($attribute['backend_input'] == 'multiple-select' && is_array($attribute['value'])) : |
|
60 | + foreach ($attribute['value'] as $v) : |
|
61 | + echo __($v, 'wpshop') . ' ' . ((!empty($attribute['unit'])) ? '(' . $attribute['unit'] . ')' : '') . ', '; |
|
62 | 62 | endforeach; |
63 | 63 | else : |
64 | - echo __( $attribute['value'], 'wpshop' ).' '.__( $attribute['unit'], 'wpshop' ); |
|
64 | + echo __($attribute['value'], 'wpshop') . ' ' . __($attribute['unit'], 'wpshop'); |
|
65 | 65 | endif; |
66 | 66 | ?></li> |
67 | 67 | <?php |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | global $wpdb; ?> |
3 | 5 | <page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt"> |
4 | 6 | <page_header> |
@@ -46,8 +48,10 @@ discard block |
||
46 | 48 | $attribute['value'][$j] = $wpdb->get_var( $query ); |
47 | 49 | $j++; |
48 | 50 | endforeach; |
49 | - else : |
|
51 | + else { |
|
52 | + : |
|
50 | 53 | $query = $wpdb->prepare( 'SELECT label FROM ' .WPSHOP_DBT_ATTRIBUTE_VALUES_OPTIONS. ' WHERE id = %d', $attribute['value'] ); |
54 | + } |
|
51 | 55 | $attribute['value'] = $wpdb->get_var( $query ); |
52 | 56 | endif; |
53 | 57 | elseif( !empty($attribute) && !empty($attribute['data_type']) && $attribute['data_type'] == 'decimal' ) : |
@@ -60,8 +64,10 @@ discard block |
||
60 | 64 | foreach( $attribute['value'] as $v ) : |
61 | 65 | echo __( $v, 'wpshop' ).' '.( (!empty($attribute['unit']) ) ? '('.$attribute['unit'].')' : '' ).', '; |
62 | 66 | endforeach; |
63 | - else : |
|
64 | - echo __( $attribute['value'], 'wpshop' ).' '.__( $attribute['unit'], 'wpshop' ); |
|
67 | + else { |
|
68 | + : |
|
69 | + echo __( $attribute['value'], 'wpshop' ).' '.__( $attribute['unit'], 'wpshop' ); |
|
70 | + } |
|
65 | 71 | endif; |
66 | 72 | ?></li> |
67 | 73 | <?php |
@@ -1,17 +1,17 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | -DEFINE( 'WPS_PRODUCT_VERSION', '2.0' ); |
|
4 | -DEFINE( 'WPS_PRODUCT_DIR', basename(dirname(__FILE__))); |
|
5 | -DEFINE( 'WPS_PRODUCT_PATH', dirname( __FILE__ ) ); |
|
6 | -DEFINE( 'WPS_PRODUCT_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_PRODUCT_PATH ) ) ); |
|
3 | +DEFINE('WPS_PRODUCT_VERSION', '2.0'); |
|
4 | +DEFINE('WPS_PRODUCT_DIR', basename(dirname(__FILE__))); |
|
5 | +DEFINE('WPS_PRODUCT_PATH', dirname(__FILE__)); |
|
6 | +DEFINE('WPS_PRODUCT_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_PRODUCT_PATH))); |
|
7 | 7 | |
8 | 8 | /** Define the templates directories */ |
9 | -DEFINE( 'WPS_PRODUCT_TEMPLATES_MAIN_DIR', WPS_PRODUCT_PATH . '/templates/'); |
|
9 | +DEFINE('WPS_PRODUCT_TEMPLATES_MAIN_DIR', WPS_PRODUCT_PATH . '/templates/'); |
|
10 | 10 | |
11 | -include( plugin_dir_path( __FILE__ ).'/model/wps_product_mdl.php' ); |
|
12 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_product_ctr.php' ); |
|
13 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_product_ajax_ctr.01.php' ); |
|
14 | -include( plugin_dir_path( __FILE__ ).'/controller/wps_product_administration_ctr.php' ); |
|
11 | +include(plugin_dir_path(__FILE__) . '/model/wps_product_mdl.php'); |
|
12 | +include(plugin_dir_path(__FILE__) . '/controller/wps_product_ctr.php'); |
|
13 | +include(plugin_dir_path(__FILE__) . '/controller/wps_product_ajax_ctr.01.php'); |
|
14 | +include(plugin_dir_path(__FILE__) . '/controller/wps_product_administration_ctr.php'); |
|
15 | 15 | |
16 | 16 | $wps_product = new wps_product_ctr(); |
17 | 17 | $wps_product->install_modules(); |
@@ -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 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | /** |
3 | 3 | * Main controller file for product mass modification module |
4 | 4 | * |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return array |
23 | 23 | */ |
24 | - function get_product_atts_def( $product_id ) { |
|
25 | - $product_entity_id = wpshop_entities::get_entity_identifier_from_code( WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT ); |
|
26 | - $element_atribute_list = wpshop_attributes::getElementWithAttributeAndValue( $product_entity_id, $product_id, WPSHOP_CURRENT_LOCALE, '', 'frontend' ); |
|
24 | + function get_product_atts_def($product_id) { |
|
25 | + $product_entity_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT); |
|
26 | + $element_atribute_list = wpshop_attributes::getElementWithAttributeAndValue($product_entity_id, $product_id, WPSHOP_CURRENT_LOCALE, '', 'frontend'); |
|
27 | 27 | |
28 | 28 | $one_product = get_post_meta($product_id, WPSHOP_PRODUCT_FRONT_DISPLAY_CONF, true); |
29 | - if(!empty($one_product)) { |
|
29 | + if (!empty($one_product)) { |
|
30 | 30 | $array1 = (!empty($one_product['attribute_set_section'])) ? $one_product['attribute_set_section'] : array(); |
31 | 31 | $array2 = $element_atribute_list[$product_id]; |
32 | 32 | unset($element_atribute_list); |
33 | - foreach($array2 as $key => $attribute_set_section) { |
|
34 | - foreach($array1 as $code1 => $value){ |
|
35 | - if($code1 == $attribute_set_section['code']) { |
|
33 | + foreach ($array2 as $key => $attribute_set_section) { |
|
34 | + foreach ($array1 as $code1 => $value) { |
|
35 | + if ($code1 == $attribute_set_section['code']) { |
|
36 | 36 | $element_atribute_list[$product_id][$key] = $attribute_set_section; |
37 | 37 | } |
38 | 38 | } |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | * @param integer $letter |
48 | 48 | * @return array |
49 | 49 | */ |
50 | - function get_products_by_letter( $letter = 'a' ) { |
|
50 | + function get_products_by_letter($letter = 'a') { |
|
51 | 51 | global $wpdb; |
52 | - if ( $letter == 'all' ) { |
|
53 | - $query = $wpdb->prepare( 'SELECT ID, post_title FROM ' .$wpdb->posts. ' WHERE post_status = %s AND post_type = %s ORDER BY post_title ASC', 'publish', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT ); |
|
52 | + if ($letter == 'all') { |
|
53 | + $query = $wpdb->prepare('SELECT ID, post_title FROM ' . $wpdb->posts . ' WHERE post_status = %s AND post_type = %s ORDER BY post_title ASC', 'publish', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT); |
|
54 | 54 | } |
55 | 55 | else { |
56 | - $query = $wpdb->prepare( 'SELECT ID, post_title FROM ' .$wpdb->posts. ' WHERE post_status = %s AND post_type = %s AND post_title LIKE %s ORDER BY post_title ASC', 'publish', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $letter.'%'); |
|
56 | + $query = $wpdb->prepare('SELECT ID, post_title FROM ' . $wpdb->posts . ' WHERE post_status = %s AND post_type = %s AND post_title LIKE %s ORDER BY post_title ASC', 'publish', WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $letter . '%'); |
|
57 | 57 | } |
58 | - $products = $wpdb->get_results( $query ); |
|
58 | + $products = $wpdb->get_results($query); |
|
59 | 59 | return $products; |
60 | 60 | } |
61 | 61 | } |
62 | 62 | \ 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 | * Fichier de gestion du modèle des taxinomies / File for term model management |
4 | 6 | * |
@@ -113,8 +115,7 @@ discard block |
||
113 | 115 | } |
114 | 116 | |
115 | 117 | return $object; |
116 | - } |
|
117 | - else { |
|
118 | + } else { |
|
118 | 119 | /** |
119 | 120 | * @todo return error when creation does not work |
120 | 121 | */ |
@@ -1,19 +1,19 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div id="wps-product-quick-creation-form-attributes" class="wps-bloc-loader" > |
4 | - <?php $attribute_list = wpshop_attributes_set::getAttributeSetDetails( $chosen_set ); ?> |
|
5 | - <?php if ( !empty( $attribute_list ) ) : ?> |
|
6 | - <?php foreach( $attribute_list as $attribute_set ) : ?> |
|
4 | + <?php $attribute_list = wpshop_attributes_set::getAttributeSetDetails($chosen_set); ?> |
|
5 | + <?php if (!empty($attribute_list)) : ?> |
|
6 | + <?php foreach ($attribute_list as $attribute_set) : ?> |
|
7 | 7 | <?php |
8 | 8 | $attributes = ''; |
9 | - foreach($attribute_set['attribut'] as $attribute_key => $attribute) { |
|
10 | - if( !empty( $attribute_key ) && ( $attribute->status == 'valid' ) && ( 'yes' == $attribute->is_used_in_quick_add_form ) ) { |
|
11 | - $output = wpshop_attributes::display_attribute( $attribute->code ); |
|
9 | + foreach ($attribute_set['attribut'] as $attribute_key => $attribute) { |
|
10 | + if (!empty($attribute_key) && ($attribute->status == 'valid') && ('yes' == $attribute->is_used_in_quick_add_form)) { |
|
11 | + $output = wpshop_attributes::display_attribute($attribute->code); |
|
12 | 12 | $attributes .= $output['field']; |
13 | 13 | } |
14 | 14 | } |
15 | 15 | ?> |
16 | - <?php if ( !empty( $attributes ) ) : ?> |
|
16 | + <?php if (!empty($attributes)) : ?> |
|
17 | 17 | <div class="wps-boxed"> |
18 | 18 | <span class="wps-h5"><?php echo $attribute_set['name']; ?></span> |
19 | 19 | <?php echo $attributes; ?> |
@@ -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,16 +1,16 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | -DEFINE( 'WPSPDTQUICK_VERSION', 1.0 ); |
|
4 | -DEFINE( 'WPSPDTQUICK_DIR', basename( dirname( __FILE__ ) ) ); |
|
5 | -DEFINE( 'WPSPDTQUICK_PATH', str_replace( "\\", "/", plugin_dir_path( __FILE__ ) ) ); |
|
6 | -DEFINE( 'WPSPDTQUICK_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', WPSPDTQUICK_PATH ) ); |
|
3 | +DEFINE('WPSPDTQUICK_VERSION', 1.0); |
|
4 | +DEFINE('WPSPDTQUICK_DIR', basename(dirname(__FILE__))); |
|
5 | +DEFINE('WPSPDTQUICK_PATH', str_replace("\\", "/", plugin_dir_path(__FILE__))); |
|
6 | +DEFINE('WPSPDTQUICK_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', WPSPDTQUICK_PATH)); |
|
7 | 7 | |
8 | 8 | /** Définition du chemin absolu vers les templates / Define the templates absolute directories */ |
9 | -DEFINE( 'WPSPDTQUICK_TEMPLATES_MAIN_DIR', WPSPDTQUICK_PATH . '/templates/'); |
|
9 | +DEFINE('WPSPDTQUICK_TEMPLATES_MAIN_DIR', WPSPDTQUICK_PATH . '/templates/'); |
|
10 | 10 | |
11 | 11 | |
12 | 12 | /** Inclusion des différents composants / Include plugin components */ |
13 | -require_once( WPSPDTQUICK_PATH . 'controller/wps_product_quick_add.ctr.php' ); |
|
13 | +require_once(WPSPDTQUICK_PATH . 'controller/wps_product_quick_add.ctr.php'); |
|
14 | 14 | /** Instanciation du controlleur principal / Main controller instanciation */ |
15 | 15 | $wps_product_quick_add = new wps_product_quick_add(); |
16 | 16 |
@@ -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,17 +1,17 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | |
3 | -DEFINE( 'WPS_PDCT_MASS_VERSION', '2.0' ); |
|
4 | -DEFINE( 'WPS_PDCT_MASS_DIR', basename(dirname(__FILE__))); |
|
5 | -DEFINE( 'WPS_PDCT_MASS_PATH', dirname( __FILE__ ) ); |
|
6 | -DEFINE( 'WPS_PDCT_MASS_URL', str_replace( str_replace( "\\", "/", ABSPATH), site_url() . '/', str_replace( "\\", "/", WPS_PDCT_MASS_PATH ) ) ); |
|
3 | +DEFINE('WPS_PDCT_MASS_VERSION', '2.0'); |
|
4 | +DEFINE('WPS_PDCT_MASS_DIR', basename(dirname(__FILE__))); |
|
5 | +DEFINE('WPS_PDCT_MASS_PATH', dirname(__FILE__)); |
|
6 | +DEFINE('WPS_PDCT_MASS_URL', str_replace(str_replace("\\", "/", ABSPATH), site_url() . '/', str_replace("\\", "/", WPS_PDCT_MASS_PATH))); |
|
7 | 7 | |
8 | 8 | |
9 | 9 | /** Define the templates directories */ |
10 | -DEFINE( 'WPS_PDCT_MASS_TEMPLATES_MAIN_DIR', WPS_PDCT_MASS_PATH . '/templates/' ); |
|
10 | +DEFINE('WPS_PDCT_MASS_TEMPLATES_MAIN_DIR', WPS_PDCT_MASS_PATH . '/templates/'); |
|
11 | 11 | |
12 | 12 | |
13 | -include( plugin_dir_path( __FILE__ ) . '/controller/wps_product_mass_interface_ctr.php' ); |
|
14 | -include( plugin_dir_path( __FILE__ ) . '/model/wps_product_mass_interface_mdl.php' ); |
|
13 | +include(plugin_dir_path(__FILE__) . '/controller/wps_product_mass_interface_ctr.php'); |
|
14 | +include(plugin_dir_path(__FILE__) . '/model/wps_product_mass_interface_mdl.php'); |
|
15 | 15 | |
16 | 16 | $wps_product_mass_interface_ctr = new wps_product_mass_interface_ctr(); |
17 | 17 |
@@ -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,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | ?> |
3 | 5 | <div class="wrap"> |
4 | 6 | <h2><span class="dashicons dashicons-update" style="font-size : 30px; width : 30px; height : 30px"></span> <?php _e( 'Mass edit products interface', 'wpshop')?><button class="add-new-h2" id="wps-mass-interface-button-new-product"><i class="wps-icon-pencil"></i> <?php _e( 'Create a new product', 'wpshop'); ?></button></h2> |
@@ -18,8 +20,11 @@ discard block |
||
18 | 20 | <?php endforeach; ?> |
19 | 21 | </select> |
20 | 22 | </div> |
21 | - <?php else: ?> |
|
22 | - <input type="hidden" id="wps_mass_edit_products_default_attributes_set" name="wps_mass_edit_products_default_attributes_set" value="<?php echo $products_attributes_groups[ 0 ]->id; ?>" /> |
|
23 | + <?php else { |
|
24 | + : ?> |
|
25 | + <input type="hidden" id="wps_mass_edit_products_default_attributes_set" name="wps_mass_edit_products_default_attributes_set" value="<?php echo $products_attributes_groups[ 0 ]->id; |
|
26 | +} |
|
27 | +?>" /> |
|
23 | 28 | <?php endif; ?> |
24 | 29 | <?php endif; ?> |
25 | 30 | </div> |
@@ -1,25 +1,25 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <div class="wrap"> |
4 | - <h2><span class="dashicons dashicons-update" style="font-size : 30px; width : 30px; height : 30px"></span> <?php _e( 'Mass edit products interface', 'wpshop')?><button class="add-new-h2" data-nonce="<?php wp_create_nonce( 'wps_mass_interface_new_product_creation' ); ?>" id="wps-mass-interface-button-new-product"><i class="wps-icon-pencil"></i> <?php _e( 'Create a new product', 'wpshop'); ?></button></h2> |
|
4 | + <h2><span class="dashicons dashicons-update" style="font-size : 30px; width : 30px; height : 30px"></span> <?php _e('Mass edit products interface', 'wpshop')?><button class="add-new-h2" data-nonce="<?php wp_create_nonce('wps_mass_interface_new_product_creation'); ?>" id="wps-mass-interface-button-new-product"><i class="wps-icon-pencil"></i> <?php _e('Create a new product', 'wpshop'); ?></button></h2> |
|
5 | 5 | |
6 | 6 | |
7 | 7 | <div class="wps-boxed"> |
8 | 8 | <div class="wps-row wps-gridwrapper3-padded"> |
9 | 9 | <div> |
10 | 10 | <div class="wps-form-group"> |
11 | - <?php if( !empty($products_attributes_groups) ): ?> |
|
12 | - <?php if ( 1 < count( $products_attributes_groups ) ) : ?> |
|
13 | - <label><?php _e( 'Products Attributes groups', 'wpshop' ); ?> : </label> |
|
11 | + <?php if (!empty($products_attributes_groups)): ?> |
|
12 | + <?php if (1 < count($products_attributes_groups)) : ?> |
|
13 | + <label><?php _e('Products Attributes groups', 'wpshop'); ?> : </label> |
|
14 | 14 | <div class="wps-form"> |
15 | 15 | <select id="wps_mass_edit_products_default_attributes_set" name="wps_mass_edit_products_default_attributes_set" > |
16 | - <?php foreach( $products_attributes_groups as $products_attributes_group ) : ?> |
|
17 | - <option value="<?php echo $products_attributes_group->id; ?>" <?php echo ( (!empty($products_attributes_group->default_set) && $products_attributes_group->default_set == 'yes' ) ? 'selected="selected"' : '' ); ?> ><?php echo $products_attributes_group->name; ?></option> |
|
16 | + <?php foreach ($products_attributes_groups as $products_attributes_group) : ?> |
|
17 | + <option value="<?php echo $products_attributes_group->id; ?>" <?php echo ((!empty($products_attributes_group->default_set) && $products_attributes_group->default_set == 'yes') ? 'selected="selected"' : ''); ?> ><?php echo $products_attributes_group->name; ?></option> |
|
18 | 18 | <?php endforeach; ?> |
19 | 19 | </select> |
20 | 20 | </div> |
21 | 21 | <?php else: ?> |
22 | - <input type="hidden" id="wps_mass_edit_products_default_attributes_set" name="wps_mass_edit_products_default_attributes_set" value="<?php echo $products_attributes_groups[ 0 ]->id; ?>" /> |
|
22 | + <input type="hidden" id="wps_mass_edit_products_default_attributes_set" name="wps_mass_edit_products_default_attributes_set" value="<?php echo $products_attributes_groups[0]->id; ?>" /> |
|
23 | 23 | <?php endif; ?> |
24 | 24 | <?php endif; ?> |
25 | 25 | </div> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <div> </div> |
30 | 30 | |
31 | 31 | <div> |
32 | - <div style="width : 100%; margin-top : 20px" class="alignright"><button class="button-primary alignright wps-mass-interface-button-save"><i class="wps-icon-save"></i> <?php _e( 'Save selected products', 'wpshop' ); ?> </button></div> |
|
32 | + <div style="width : 100%; margin-top : 20px" class="alignright"><button class="button-primary alignright wps-mass-interface-button-save"><i class="wps-icon-save"></i> <?php _e('Save selected products', 'wpshop'); ?> </button></div> |
|
33 | 33 | </div> |
34 | 34 | |
35 | 35 | </div> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | <div style="display : none" class="wps-alert-error"></div> |
39 | 39 | <div style="display : none" class="wps-alert-success"></div> |
40 | 40 | |
41 | -<div id="wps_mass_products_edit_tab_container" data-nonce="<?php echo wp_create_nonce( 'wps_mass_edit_change_page' ); ?>"> |
|
41 | +<div id="wps_mass_products_edit_tab_container" data-nonce="<?php echo wp_create_nonce('wps_mass_edit_change_page'); ?>"> |
|
42 | 42 | |
43 | 43 | <?php echo $product_list_interface; ?> |
44 | 44 |
@@ -1,21 +1,21 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | 2 | ?> |
3 | 3 | <tr class="<?php echo $class; ?>" id="trPid_<?php echo $product['post_datas']->ID; ?>"> |
4 | 4 | <td class="wps-mass-interface-line-selector"><div class="wps-form-group"><div class="wps-form"><center><input type="checkbox" class="wps-save-product-checkbox" name="wps_product_quick_save[]" value="<?php echo $product['post_datas']->ID; ?>" /></center></div></div></td> |
5 | 5 | |
6 | 6 | <td class="wps_mass_interface_line"> |
7 | - <span class="wps_mass_interface_picture_container" id="wps_mass_interface_picture_container_<?php echo $product['post_datas']->ID; ?>"><?php echo get_the_post_thumbnail( $product['post_datas']->ID, 'thumbnail'); ?></span> |
|
7 | + <span class="wps_mass_interface_picture_container" id="wps_mass_interface_picture_container_<?php echo $product['post_datas']->ID; ?>"><?php echo get_the_post_thumbnail($product['post_datas']->ID, 'thumbnail'); ?></span> |
|
8 | 8 | <input type="hidden" value="" name="wps_mass_interface[<?php echo $product['post_datas']->ID; ?>][picture]" /> |
9 | 9 | <?php |
10 | - if( has_post_thumbnail($product['post_datas']->ID) ) { |
|
10 | + if (has_post_thumbnail($product['post_datas']->ID)) { |
|
11 | 11 | $has_thumb = true; |
12 | 12 | } else { |
13 | 13 | $has_thumb = false; |
14 | 14 | } |
15 | 15 | ?> |
16 | - <a href="#" style="display: <?php echo ( $has_thumb ) ? 'none' : 'inline-block'; ?>;" class="wps-bton-second-mini-rounded wps_add_picture_to_product_in_mass_interface" id="wps_add_picture_to_product_in_mass_interface_<?php echo $product['post_datas']->ID; ?>"><?php _e( 'Add a picture', 'wpshop'); ?></a> |
|
16 | + <a href="#" style="display: <?php echo ($has_thumb) ? 'none' : 'inline-block'; ?>;" class="wps-bton-second-mini-rounded wps_add_picture_to_product_in_mass_interface" id="wps_add_picture_to_product_in_mass_interface_<?php echo $product['post_datas']->ID; ?>"><?php _e('Add a picture', 'wpshop'); ?></a> |
|
17 | 17 | <div class="row-actions"> |
18 | - <center><a href="#" class="wps_del_picture_to_product_in_mass_interface" style="display: <?php echo ( !$has_thumb ) ? 'none' : 'inline-block'; ?>;" id="wps_del_picture_to_product_in_mass_interface_<?php echo $product['post_datas']->ID; ?>"><?php _e( 'Delete picture', 'wpshop'); ?></a></center> |
|
18 | + <center><a href="#" class="wps_del_picture_to_product_in_mass_interface" style="display: <?php echo (!$has_thumb) ? 'none' : 'inline-block'; ?>;" id="wps_del_picture_to_product_in_mass_interface_<?php echo $product['post_datas']->ID; ?>"><?php _e('Delete picture', 'wpshop'); ?></a></center> |
|
19 | 19 | </div> |
20 | 20 | </td> |
21 | 21 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | <input type="text" name="wps_mass_interface[<?php echo $product['post_datas']->ID; ?>][post_title]" value="<?php echo $product['post_datas']->post_title; ?>" /> |
27 | 27 | </div> |
28 | 28 | <div class="row-actions"> |
29 | - <a href="<?php echo get_edit_post_link( $product['post_datas']->ID ); ?>" target="_blank"><?php _e('Edit This')?></a> | |
|
29 | + <a href="<?php echo get_edit_post_link($product['post_datas']->ID); ?>" target="_blank"><?php _e('Edit This')?></a> | |
|
30 | 30 | <span class="trash"><a id="wps_mass_interface_post_delete_<?php echo $product['post_datas']->ID; ?>" class="submitdelete" href="#"><?php _e('Trash')?></a><input id="wps_mass_interface_post_delete_input_<?php echo $product['post_datas']->ID; ?>" type="hidden" name="wps_mass_interface[<?php echo $product['post_datas']->ID; ?>][post_delete]" value="false" /></span> | |
31 | 31 | <a href="<?php echo get_permalink($product['post_datas']->ID); ?>" target="_blank"><?php _e('View product', 'wpshop')?></a> |
32 | 32 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | <div class="wps-form-group"> |
39 | 39 | <?php /*<label><?php _e( 'Product description', 'wpshop'); ?> :</label>*/ ?> |
40 | 40 | <div class="wps-form"> |
41 | - <textarea id="wps_product_description_<?php echo $product['post_datas']->ID; ?>" name="wps_mass_interface[<?php echo $product['post_datas']->ID; ?>][post_content]"><?php echo nl2br( $product['post_datas']->post_content );?></textarea> |
|
41 | + <textarea id="wps_product_description_<?php echo $product['post_datas']->ID; ?>" name="wps_mass_interface[<?php echo $product['post_datas']->ID; ?>][post_content]"><?php echo nl2br($product['post_datas']->post_content); ?></textarea> |
|
42 | 42 | </div> |
43 | 43 | </div> |
44 | 44 | </td> |
@@ -49,36 +49,36 @@ discard block |
||
49 | 49 | <center><a class="wps-bton-first-mini-rounded wps_add_files_to_product_in_mass_interface" id="wps_add_files_to_product_in_mass_interface_<?php echo $product['post_datas']->ID; ?>"><?php _e( 'Add files', 'wpshop'); ?></a></center> |
50 | 50 | </td>*/ ?> |
51 | 51 | |
52 | - <?php if( !empty($quick_add_form_attributes) ) : |
|
52 | + <?php if (!empty($quick_add_form_attributes)) : |
|
53 | 53 | $i = 0; ?> |
54 | - <?php foreach( $quick_add_form_attributes as $attribute_id => $att_def ) : |
|
54 | + <?php foreach ($quick_add_form_attributes as $attribute_id => $att_def) : |
|
55 | 55 | |
56 | 56 | $att = null; |
57 | - $query = $wpdb->prepare( 'SELECT * FROM '. WPSHOP_DBT_ATTRIBUTE_DETAILS. ' WHERE attribute_set_id = %d AND attribute_id = %d AND status = %s', $default, $attribute_id, 'valid' ); |
|
58 | - $checking_display_att = $wpdb->get_results( $query ); |
|
57 | + $query = $wpdb->prepare('SELECT * FROM ' . WPSHOP_DBT_ATTRIBUTE_DETAILS . ' WHERE attribute_set_id = %d AND attribute_id = %d AND status = %s', $default, $attribute_id, 'valid'); |
|
58 | + $checking_display_att = $wpdb->get_results($query); |
|
59 | 59 | |
60 | - if( !empty($checking_display_att) ) : |
|
61 | - $current_value = wpshop_attributes::getAttributeValueForEntityInSet( $att_def['data_type'], $attribute_id, $product_entity_id, $product['post_datas']->ID ); |
|
62 | - $output_specs = array( |
|
60 | + if (!empty($checking_display_att)) : |
|
61 | + $current_value = wpshop_attributes::getAttributeValueForEntityInSet($att_def['data_type'], $attribute_id, $product_entity_id, $product['post_datas']->ID); |
|
62 | + $output_specs = array( |
|
63 | 63 | 'page_code' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, |
64 | 64 | 'element_identifier' => $product['post_datas']->ID, |
65 | - 'field_id' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT.'_'.$product['post_datas']->ID. '_', |
|
66 | - 'current_value' => ( !empty($current_value->value) ? $current_value->value : '' ) |
|
65 | + 'field_id' => WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_' . $product['post_datas']->ID . '_', |
|
66 | + 'current_value' => (!empty($current_value->value) ? $current_value->value : '') |
|
67 | 67 | ); |
68 | - $att = wpshop_attributes::display_attribute( $att_def['code'], 'admin', $output_specs ); |
|
68 | + $att = wpshop_attributes::display_attribute($att_def['code'], 'admin', $output_specs); |
|
69 | 69 | endif; |
70 | 70 | ?> |
71 | 71 | <td class="wps_mass_interface_line"> |
72 | 72 | <div class="wps-form-group"> |
73 | 73 | <?php /*<label><?php _e( $att['field_definition']['label'], 'wpshop' ); ?></label>*/ ?> |
74 | - <div class="wps-form"><?php echo str_replace( 'name="wpshop_product_attribute', 'name="wpshop_product_attribute[' .$product['post_datas']->ID. ']', $att['field_definition']['output'] ); ?></div> |
|
74 | + <div class="wps-form"><?php echo str_replace('name="wpshop_product_attribute', 'name="wpshop_product_attribute[' . $product['post_datas']->ID . ']', $att['field_definition']['output']); ?></div> |
|
75 | 75 | </div> |
76 | 76 | </td> |
77 | 77 | <?php $i++; |
78 | 78 | endforeach; ?> |
79 | 79 | <?php endif; ?> |
80 | 80 | |
81 | - <td class="wps_mass_interface_line_deleted" colspan="<?php echo 3 + $i;?>" style="display: none;"> |
|
82 | - <?php printf( __( '%s will be deleted.', 'wpshop' ), $product['post_datas']->post_title); ?> <a class="wps_mass_interface_post_deleted_cancel" id="wps_mass_interface_post_delete_cancel_<?php echo $product['post_datas']->ID; ?>" href="#">Annuler</a> |
|
81 | + <td class="wps_mass_interface_line_deleted" colspan="<?php echo 3 + $i; ?>" style="display: none;"> |
|
82 | + <?php printf(__('%s will be deleted.', 'wpshop'), $product['post_datas']->post_title); ?> <a class="wps_mass_interface_post_deleted_cancel" id="wps_mass_interface_post_delete_cancel_<?php echo $product['post_datas']->ID; ?>" href="#">Annuler</a> |
|
83 | 83 | </td> |
84 | 84 | </tr> |
85 | 85 | \ No newline at end of file |
@@ -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,11 +1,11 @@ |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
2 | - if ( !empty( $paginate ) ) : ?> |
|
1 | +<?php if (!defined('ABSPATH')) exit; |
|
2 | + if (!empty($paginate)) : ?> |
|
3 | 3 | <ul class="wps-mass-product-pagination"> |
4 | 4 | <?php $i = 1; ?> |
5 | - <?php foreach ( $paginate as $page ) : ?> |
|
5 | + <?php foreach ($paginate as $page) : ?> |
|
6 | 6 | <li> |
7 | - <?php if ( 1 == $i ) : ?> |
|
8 | - <?php echo str_replace( "href=''", 'href="' . admin_url( 'admin-ajax.php?action=wps_add_quick_interface' ) . '"', $page ); ?> |
|
7 | + <?php if (1 == $i) : ?> |
|
8 | + <?php echo str_replace("href=''", 'href="' . admin_url('admin-ajax.php?action=wps_add_quick_interface') . '"', $page); ?> |
|
9 | 9 | <?php else: ?> |
10 | 10 | <?php echo $page; ?> |
11 | 11 | <?php endif; ?> |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
2 | + exit; |
|
3 | +} |
|
2 | 4 | if ( !empty( $paginate ) ) : ?> |
3 | 5 | <ul class="wps-mass-product-pagination"> |
4 | 6 | <?php $i = 1; ?> |
@@ -6,8 +8,11 @@ discard block |
||
6 | 8 | <li> |
7 | 9 | <?php if ( 1 == $i ) : ?> |
8 | 10 | <?php echo str_replace( "href=''", 'href="' . admin_url( 'admin-ajax.php?action=wps_add_quick_interface' ) . '"', $page ); ?> |
9 | - <?php else: ?> |
|
10 | - <?php echo $page; ?> |
|
11 | + <?php else { |
|
12 | + : ?> |
|
13 | + <?php echo $page; |
|
14 | +} |
|
15 | +?> |
|
11 | 16 | <?php endif; ?> |
12 | 17 | </li> |
13 | 18 | <?php $i++; ?> |