Changeset 1916016
- Timestamp:
- 07/27/2018 09:45:14 PM (8 years ago)
- Location:
- woo-new-product-info
- Files:
-
- 8 added
- 7 deleted
- 10 edited
- 3 copied
-
tags/1.0.4 (copied) (copied from woo-new-product-info/trunk)
-
tags/1.0.4/css/admin.css (added)
-
tags/1.0.4/css/css.css (deleted)
-
tags/1.0.4/css/website.php (added)
-
tags/1.0.4/html/admin.php (modified) (2 diffs)
-
tags/1.0.4/html/website.php (modified) (1 diff)
-
tags/1.0.4/js/admin-extensions.js (added)
-
tags/1.0.4/js/admin.js (added)
-
tags/1.0.4/js/extensions.js (deleted)
-
tags/1.0.4/js/js.js (deleted)
-
tags/1.0.4/languages/motpr355_woo_new_product_info-fr_FR.mo (modified) (previous)
-
tags/1.0.4/languages/motpr355_woo_new_product_info-fr_FR.po (modified) (3 diffs)
-
tags/1.0.4/motpr355-woo-new-product-info.php (deleted)
-
tags/1.0.4/readme.txt (copied) (copied from woo-new-product-info/trunk/readme.txt) (2 diffs)
-
tags/1.0.4/woo-new-product-info.php (copied) (copied from woo-new-product-info/trunk/woo-new-product-info.php) (8 diffs)
-
trunk/css/admin.css (added)
-
trunk/css/css.css (deleted)
-
trunk/css/website.php (added)
-
trunk/html/admin.php (modified) (2 diffs)
-
trunk/html/website.php (modified) (1 diff)
-
trunk/js/admin-extensions.js (added)
-
trunk/js/admin.js (added)
-
trunk/js/extensions.js (deleted)
-
trunk/js/js.js (deleted)
-
trunk/languages/motpr355_woo_new_product_info-fr_FR.mo (modified) (previous)
-
trunk/languages/motpr355_woo_new_product_info-fr_FR.po (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woo-new-product-info.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-new-product-info/tags/1.0.4/html/admin.php
r1914529 r1916016 7 7 8 8 <h1> 9 <?php esc_attr_e( 'New product info', 'motpr355_woo_new_product_info' ) ?>9 <?php _e( 'New product info', 'motpr355_woo_new_product_info' ) ?> 10 10 </h1> 11 12 <h3><?php _e( 'Differentiate WooCommerce new products by displaying a customizable "New" tag.', 'motpr355_woo_new_product_info' ) ?></h3> 11 13 12 14 <noscript> … … 27 29 28 30 <form autocomplete="off" method="POST" action=""> 31 <hr/> 29 32 <p> 30 33 <span> -
woo-new-product-info/tags/1.0.4/html/website.php
r1914529 r1916016 4 4 } 5 5 ?> 6 <div style="margin: 10px 0;"> 7 <span style="background: <?php echo esc_html( $this->settings->{$this->settings_enum->background_color} ) ?>; 8 color: <?php echo esc_html( $this->settings->{$this->settings_enum->color} ) ?>; 9 font-weight: <?php echo esc_html( $this->settings->{$this->settings_enum->font_weight} ) ?>; 10 text-transform: <?php echo esc_html( $this->settings->{$this->settings_enum->text_transform} ) ?>; 11 border-radius: 25px; 12 padding: 4px 10px; 13 display: inline-block;"> 6 <div class="motpr355_woo_new_product_info_div"> 7 <span class="motpr355_woo_new_product_info_span"> 14 8 <?php 15 9 if ( $this->settings->{$this->settings_enum->text} === $this->text_enum->new1 ) { -
woo-new-product-info/tags/1.0.4/languages/motpr355_woo_new_product_info-fr_FR.po
r1914529 r1916016 3 3 "Project-Id-Version: WooCommerce new product info\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2018-07-2 1 12:38+0000\n"6 "PO-Revision-Date: 2018-07-2 1 12:39+0000\n"5 "POT-Creation-Date: 2018-07-27 19:02+0000\n" 6 "PO-Revision-Date: 2018-07-27 19:03+0000\n" 7 7 "Last-Translator: wordpress <dazdazd@dzadaz.ed>\n" 8 8 "Language-Team: French (France)\n" … … 14 14 "X-Generator: Loco https://localise.biz/" 15 15 16 #: motpr355-woo-new-product-info.php:199 motpr355-woo-new-product-info.php:200 17 #: html/admin.php:9 16 #: woo-new-product-info.php:209 woo-new-product-info.php:210 html/admin.php:9 18 17 msgid "New product info" 19 18 msgstr "Info nouveau produit" 20 19 21 #: motpr355-woo-new-product-info.php:24620 #: woo-new-product-info.php:256 22 21 msgid "WooCommerce must be actived" 23 22 msgstr "Le plugin WooCommerce doit être activé" 24 23 25 #: motpr355-woo-new-product-info.php:25024 #: woo-new-product-info.php:260 26 25 msgid "WooCommerce must be installed" 27 26 msgstr "Le plugin WooCommerce doit être installé" 28 27 29 #: html/website.php:1 6 html/admin.php:76 html/admin.php:23528 #: html/website.php:10 html/admin.php:83 html/admin.php:242 30 29 msgid "New" 31 30 msgstr "Nouveau" 32 31 33 #: html/website.php:1 8 html/admin.php:8232 #: html/website.php:12 html/admin.php:89 34 33 msgid "New!" 35 34 msgstr "Nouveau !" 36 35 37 #: html/admin.php:1538 msgid "Please activate JavaScript to edit the configuration."39 msgstr "Merci d'activer JavaScript pour éditer la configuration."40 41 #: html/admin.php:2342 msgid "Configuration saved."43 msgstr "Configuration sauvegardée."44 45 #: html/admin.php:3146 msgid "Activate functionality:"47 msgstr "Activer la fonctionnalité :"48 49 #: html/admin.php:3950 msgid "Activate"51 msgstr "Activer"52 53 #: html/admin.php:4754 msgid "Deactivate"55 msgstr "Désactiver"56 57 #: html/admin.php:5558 msgid "Consider a product as new during:"59 msgstr "Considérer un produit comme nouveau pendant :"60 61 #: html/admin.php:5962 msgid "1 day"63 msgstr "1 jour"64 65 #: html/admin.php:6166 #, php-format67 msgid "%d days"68 msgstr "%d jours"69 70 #: html/admin.php:6971 msgid "Text:"72 msgstr "Texte :"73 74 #: html/admin.php:8875 msgid "Background color:"76 msgstr "Couleur du fond :"77 78 #: html/admin.php:9879 msgid "Color:"80 msgstr "Couleur :"81 82 #: html/admin.php:10883 msgid "Font weight:"84 msgstr "Police d'écriture :"85 86 #: html/admin.php:11587 msgid "Normal"88 msgstr "Normal"89 90 #: html/admin.php:12191 msgid "Bold"92 msgstr "Gras"93 94 #: html/admin.php:12795 msgid "Text transform:"96 msgstr "Transformation du texte :"97 98 #: html/admin.php:13499 msgid "None"100 msgstr "Aucune"101 102 #: html/admin.php:140103 msgid "Lowercase"104 msgstr "Minuscule"105 106 #: html/admin.php:146107 msgid "Uppercase"108 msgstr "Majuscule"109 110 #: html/admin.php:152111 msgid "Position in product list:"112 msgstr "Position sur la liste des produits :"113 114 #: html/admin.php:160115 msgid "Before the name product"116 msgstr "Avant le nom du produit"117 118 #: html/admin.php:168 html/admin.php:199119 msgid "After the name product"120 msgstr "Après le nom du produit"121 122 #: html/admin.php:176123 msgid "After the \"Read more\" button"124 msgstr "Après le bouton \"Lire la suite\""125 126 #: html/admin.php:184 html/admin.php:223127 msgid "Don't display"128 msgstr "Ne pas afficher"129 130 #: html/admin.php:191131 msgid "Position in product page:"132 msgstr "Position sur la page du produit :"133 134 #: html/admin.php:207135 msgid "After the price"136 msgstr "Après le prix"137 138 #: html/admin.php:215139 msgid "After the \"Add to cart\" button"140 msgstr "Après le bouton \"Ajouter au panier\""141 142 #: html/admin.php:231143 msgid "Preview:"144 msgstr "Prévisualisation :"145 146 #: html/admin.php:244147 msgid "Save configuration"148 msgstr "Sauvegarder la configuration"149 150 #. Name of the plugin151 msgid "WooCommerce - new product info"152 msgstr "WooCommerce - info nouveau produit"153 154 36 #. Description of the plugin 37 #: html/admin.php:12 155 38 msgid "" 156 39 "Differentiate WooCommerce new products by displaying a customizable \"New\" " … … 160 43 "\"Nouveau\" personnalisable." 161 44 45 #: html/admin.php:17 46 msgid "Please activate JavaScript to edit the configuration." 47 msgstr "Merci d'activer JavaScript pour éditer la configuration." 48 49 #: html/admin.php:25 50 msgid "Configuration saved." 51 msgstr "Configuration sauvegardée." 52 53 #: html/admin.php:34 54 msgid "Activate functionality:" 55 msgstr "Activer la fonctionnalité :" 56 57 #: html/admin.php:42 58 msgid "Activate" 59 msgstr "Activer" 60 61 #: html/admin.php:54 62 msgid "Deactivate" 63 msgstr "Désactiver" 64 65 #: html/admin.php:62 66 msgid "Consider a product as new during:" 67 msgstr "Considérer un produit comme nouveau pendant :" 68 69 #: html/admin.php:66 70 msgid "1 day" 71 msgstr "1 jour" 72 73 #: html/admin.php:68 74 #, php-format 75 msgid "%d days" 76 msgstr "%d jours" 77 78 #: html/admin.php:76 79 msgid "Text:" 80 msgstr "Texte :" 81 82 #: html/admin.php:95 83 msgid "Background color:" 84 msgstr "Couleur du fond :" 85 86 #: html/admin.php:105 87 msgid "Color:" 88 msgstr "Couleur :" 89 90 #: html/admin.php:115 91 msgid "Font weight:" 92 msgstr "Police d'écriture :" 93 94 #: html/admin.php:122 95 msgid "Normal" 96 msgstr "Normal" 97 98 #: html/admin.php:128 99 msgid "Bold" 100 msgstr "Gras" 101 102 #: html/admin.php:134 103 msgid "Text transform:" 104 msgstr "Transformation du texte :" 105 106 #: html/admin.php:141 107 msgid "None" 108 msgstr "Aucune" 109 110 #: html/admin.php:147 111 msgid "Lowercase" 112 msgstr "Minuscule" 113 114 #: html/admin.php:153 115 msgid "Uppercase" 116 msgstr "Majuscule" 117 118 #: html/admin.php:159 119 msgid "Position in product list:" 120 msgstr "Position sur la liste des produits :" 121 122 #: html/admin.php:167 123 msgid "Before the name product" 124 msgstr "Avant le nom du produit" 125 126 #: html/admin.php:175 html/admin.php:206 127 msgid "After the name product" 128 msgstr "Après le nom du produit" 129 130 #: html/admin.php:183 131 msgid "After the \"Read more\" button" 132 msgstr "Après le bouton \"Lire la suite\"" 133 134 #: html/admin.php:191 html/admin.php:230 135 msgid "Don't display" 136 msgstr "Ne pas afficher" 137 138 #: html/admin.php:198 139 msgid "Position in product page:" 140 msgstr "Position sur la page du produit :" 141 142 #: html/admin.php:214 143 msgid "After the price" 144 msgstr "Après le prix" 145 146 #: html/admin.php:222 147 msgid "After the \"Add to cart\" button" 148 msgstr "Après le bouton \"Ajouter au panier\"" 149 150 #: html/admin.php:238 151 msgid "Preview:" 152 msgstr "Prévisualisation :" 153 154 #: html/admin.php:252 155 msgid "Save configuration" 156 msgstr "Sauvegarder la configuration" 157 158 #. Name of the plugin 159 msgid "WooCommerce new product info" 160 msgstr "WooCommerce info nouveau produit" 161 162 162 #. Author of the plugin 163 163 msgid "Motpr355" -
woo-new-product-info/tags/1.0.4/readme.txt
r1914911 r1916016 5 5 Tested up to: 4.9 6 6 Requires PHP : 5.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 … … 53 53 1/ Install the plugin in "Plugins" => "Add new" 54 54 2/ Activate the plugin in "Plugins" => "Installed plugins" 55 3/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce -new product info" => "Settings", or in "Products" => "New product info"55 3/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce new product info" => "Settings", or in "Products" => "New product info" 56 56 4/ Save your configuration 57 57 -
woo-new-product-info/tags/1.0.4/woo-new-product-info.php
r1914911 r1916016 3 3 Plugin Name: WooCommerce new product info 4 4 Description: Differentiate WooCommerce new products by displaying a customizable "New" tag. 5 Version: 1.0. 35 Version: 1.0.4 6 6 Author: Motpr355 7 7 Text Domain: motpr355_woo_new_product_info … … 45 45 } 46 46 47 $this->init_ hooks();47 $this->init_website_content(); 48 48 49 49 } … … 100 100 } 101 101 102 private function init_ hooks() {102 private function init_website_content() { 103 103 if ( isset ( $this->settings->{$this->settings_enum->activation}, 104 104 $this->settings->{$this->settings_enum->list_position}, 105 105 $this->settings->{$this->settings_enum->product_position} ) ) { 106 106 if ( $this->settings->{$this->settings_enum->activation} === $this->activation_enum->actived ) { 107 add_action( 'wp_head', array( $this, 'display_website_style' ) ); 107 108 if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->before_name ) { 108 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_ info' ), 9 );109 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_website_info' ), 9 ); 109 110 } else if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->after_name ) { 110 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_ info' ), 11 );111 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_website_info' ), 11 ); 111 112 } else if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->after_button ) { 112 add_action( 'woocommerce_after_shop_loop_item', array( $this, 'display_ info' ), 11 );113 add_action( 'woocommerce_after_shop_loop_item', array( $this, 'display_website_info' ), 11 ); 113 114 } 114 115 if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_name ) { 115 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 6 );116 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 6 ); 116 117 } else if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_price ) { 117 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 11 );118 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 11 ); 118 119 } else if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_button ) { 119 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 31 );120 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 31 ); 120 121 } 121 122 } … … 123 124 } 124 125 125 public function display_ info() {126 public function display_website_info() { 126 127 if ( function_exists( 'get_the_date' ) ) { 127 128 $limit_time = time() - ( $this->settings->{$this->settings_enum->duration} * 60 * 60 * 24 ); 128 129 $published_time = strtotime( get_the_date( 'Y-m-d' ) ); 129 130 if ( $published_time - $limit_time > 0 ) { 130 if (isset ( $this->settings->{$this->settings_enum->text}, 131 $this->settings->{$this->settings_enum->background_color}, 132 $this->settings->{$this->settings_enum->color}, 133 $this->settings->{$this->settings_enum->font_weight} ) ) { 131 if ( isset ( $this->settings->{$this->settings_enum->text} ) ) { 134 132 echo $this->get_display_info_content(); 135 133 } 136 134 } 135 } 136 } 137 138 public function display_website_style() { 139 if ( isset ( $this->settings->{$this->settings_enum->background_color}, 140 $this->settings->{$this->settings_enum->color}, 141 $this->settings->{$this->settings_enum->font_weight}, 142 $this->settings->{$this->settings_enum->text_transform} ) ) { 143 include plugin_dir_path( __FILE__ ) . 'css/website.php'; 137 144 } 138 145 } … … 188 195 'woo-new-product-info/woo-new-product-info.php', 189 196 'motpr355-woo-new-product-info', 190 'woo-new-product-info' 197 'woo-new-product-info', 198 'motpr355-woo-new-product-info.php', 199 'woo-new-product-info.php' 191 200 ); 192 201 if ( isset( $item->slug ) && in_array( $item->slug, $plugins ) ) { … … 225 234 wp_register_script( 226 235 'motpr355_woo_new_product_info_script', 227 plugins_url( 'js/ js.js', __FILE__ ),236 plugins_url( 'js/admin.js', __FILE__ ), 228 237 array( 'wp-color-picker' ), 229 238 '1.0.0', … … 238 247 wp_register_script( 239 248 'motpr355_woo_new_product_info_script', 240 plugins_url( 'js/ extensions.js', __FILE__ ),249 plugins_url( 'js/admin-extensions.js', __FILE__ ), 241 250 array(), 242 251 '1.0.0', … … 266 275 wp_register_style( 267 276 'motpr355_woo_new_product_info_style', 268 plugins_url( 'css/ css.css', __FILE__ ),277 plugins_url( 'css/admin.css', __FILE__ ), 269 278 array(), 270 279 '1.0.0' -
woo-new-product-info/trunk/html/admin.php
r1914529 r1916016 7 7 8 8 <h1> 9 <?php esc_attr_e( 'New product info', 'motpr355_woo_new_product_info' ) ?>9 <?php _e( 'New product info', 'motpr355_woo_new_product_info' ) ?> 10 10 </h1> 11 12 <h3><?php _e( 'Differentiate WooCommerce new products by displaying a customizable "New" tag.', 'motpr355_woo_new_product_info' ) ?></h3> 11 13 12 14 <noscript> … … 27 29 28 30 <form autocomplete="off" method="POST" action=""> 31 <hr/> 29 32 <p> 30 33 <span> -
woo-new-product-info/trunk/html/website.php
r1914529 r1916016 4 4 } 5 5 ?> 6 <div style="margin: 10px 0;"> 7 <span style="background: <?php echo esc_html( $this->settings->{$this->settings_enum->background_color} ) ?>; 8 color: <?php echo esc_html( $this->settings->{$this->settings_enum->color} ) ?>; 9 font-weight: <?php echo esc_html( $this->settings->{$this->settings_enum->font_weight} ) ?>; 10 text-transform: <?php echo esc_html( $this->settings->{$this->settings_enum->text_transform} ) ?>; 11 border-radius: 25px; 12 padding: 4px 10px; 13 display: inline-block;"> 6 <div class="motpr355_woo_new_product_info_div"> 7 <span class="motpr355_woo_new_product_info_span"> 14 8 <?php 15 9 if ( $this->settings->{$this->settings_enum->text} === $this->text_enum->new1 ) { -
woo-new-product-info/trunk/languages/motpr355_woo_new_product_info-fr_FR.po
r1914529 r1916016 3 3 "Project-Id-Version: WooCommerce new product info\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2018-07-2 1 12:38+0000\n"6 "PO-Revision-Date: 2018-07-2 1 12:39+0000\n"5 "POT-Creation-Date: 2018-07-27 19:02+0000\n" 6 "PO-Revision-Date: 2018-07-27 19:03+0000\n" 7 7 "Last-Translator: wordpress <dazdazd@dzadaz.ed>\n" 8 8 "Language-Team: French (France)\n" … … 14 14 "X-Generator: Loco https://localise.biz/" 15 15 16 #: motpr355-woo-new-product-info.php:199 motpr355-woo-new-product-info.php:200 17 #: html/admin.php:9 16 #: woo-new-product-info.php:209 woo-new-product-info.php:210 html/admin.php:9 18 17 msgid "New product info" 19 18 msgstr "Info nouveau produit" 20 19 21 #: motpr355-woo-new-product-info.php:24620 #: woo-new-product-info.php:256 22 21 msgid "WooCommerce must be actived" 23 22 msgstr "Le plugin WooCommerce doit être activé" 24 23 25 #: motpr355-woo-new-product-info.php:25024 #: woo-new-product-info.php:260 26 25 msgid "WooCommerce must be installed" 27 26 msgstr "Le plugin WooCommerce doit être installé" 28 27 29 #: html/website.php:1 6 html/admin.php:76 html/admin.php:23528 #: html/website.php:10 html/admin.php:83 html/admin.php:242 30 29 msgid "New" 31 30 msgstr "Nouveau" 32 31 33 #: html/website.php:1 8 html/admin.php:8232 #: html/website.php:12 html/admin.php:89 34 33 msgid "New!" 35 34 msgstr "Nouveau !" 36 35 37 #: html/admin.php:1538 msgid "Please activate JavaScript to edit the configuration."39 msgstr "Merci d'activer JavaScript pour éditer la configuration."40 41 #: html/admin.php:2342 msgid "Configuration saved."43 msgstr "Configuration sauvegardée."44 45 #: html/admin.php:3146 msgid "Activate functionality:"47 msgstr "Activer la fonctionnalité :"48 49 #: html/admin.php:3950 msgid "Activate"51 msgstr "Activer"52 53 #: html/admin.php:4754 msgid "Deactivate"55 msgstr "Désactiver"56 57 #: html/admin.php:5558 msgid "Consider a product as new during:"59 msgstr "Considérer un produit comme nouveau pendant :"60 61 #: html/admin.php:5962 msgid "1 day"63 msgstr "1 jour"64 65 #: html/admin.php:6166 #, php-format67 msgid "%d days"68 msgstr "%d jours"69 70 #: html/admin.php:6971 msgid "Text:"72 msgstr "Texte :"73 74 #: html/admin.php:8875 msgid "Background color:"76 msgstr "Couleur du fond :"77 78 #: html/admin.php:9879 msgid "Color:"80 msgstr "Couleur :"81 82 #: html/admin.php:10883 msgid "Font weight:"84 msgstr "Police d'écriture :"85 86 #: html/admin.php:11587 msgid "Normal"88 msgstr "Normal"89 90 #: html/admin.php:12191 msgid "Bold"92 msgstr "Gras"93 94 #: html/admin.php:12795 msgid "Text transform:"96 msgstr "Transformation du texte :"97 98 #: html/admin.php:13499 msgid "None"100 msgstr "Aucune"101 102 #: html/admin.php:140103 msgid "Lowercase"104 msgstr "Minuscule"105 106 #: html/admin.php:146107 msgid "Uppercase"108 msgstr "Majuscule"109 110 #: html/admin.php:152111 msgid "Position in product list:"112 msgstr "Position sur la liste des produits :"113 114 #: html/admin.php:160115 msgid "Before the name product"116 msgstr "Avant le nom du produit"117 118 #: html/admin.php:168 html/admin.php:199119 msgid "After the name product"120 msgstr "Après le nom du produit"121 122 #: html/admin.php:176123 msgid "After the \"Read more\" button"124 msgstr "Après le bouton \"Lire la suite\""125 126 #: html/admin.php:184 html/admin.php:223127 msgid "Don't display"128 msgstr "Ne pas afficher"129 130 #: html/admin.php:191131 msgid "Position in product page:"132 msgstr "Position sur la page du produit :"133 134 #: html/admin.php:207135 msgid "After the price"136 msgstr "Après le prix"137 138 #: html/admin.php:215139 msgid "After the \"Add to cart\" button"140 msgstr "Après le bouton \"Ajouter au panier\""141 142 #: html/admin.php:231143 msgid "Preview:"144 msgstr "Prévisualisation :"145 146 #: html/admin.php:244147 msgid "Save configuration"148 msgstr "Sauvegarder la configuration"149 150 #. Name of the plugin151 msgid "WooCommerce - new product info"152 msgstr "WooCommerce - info nouveau produit"153 154 36 #. Description of the plugin 37 #: html/admin.php:12 155 38 msgid "" 156 39 "Differentiate WooCommerce new products by displaying a customizable \"New\" " … … 160 43 "\"Nouveau\" personnalisable." 161 44 45 #: html/admin.php:17 46 msgid "Please activate JavaScript to edit the configuration." 47 msgstr "Merci d'activer JavaScript pour éditer la configuration." 48 49 #: html/admin.php:25 50 msgid "Configuration saved." 51 msgstr "Configuration sauvegardée." 52 53 #: html/admin.php:34 54 msgid "Activate functionality:" 55 msgstr "Activer la fonctionnalité :" 56 57 #: html/admin.php:42 58 msgid "Activate" 59 msgstr "Activer" 60 61 #: html/admin.php:54 62 msgid "Deactivate" 63 msgstr "Désactiver" 64 65 #: html/admin.php:62 66 msgid "Consider a product as new during:" 67 msgstr "Considérer un produit comme nouveau pendant :" 68 69 #: html/admin.php:66 70 msgid "1 day" 71 msgstr "1 jour" 72 73 #: html/admin.php:68 74 #, php-format 75 msgid "%d days" 76 msgstr "%d jours" 77 78 #: html/admin.php:76 79 msgid "Text:" 80 msgstr "Texte :" 81 82 #: html/admin.php:95 83 msgid "Background color:" 84 msgstr "Couleur du fond :" 85 86 #: html/admin.php:105 87 msgid "Color:" 88 msgstr "Couleur :" 89 90 #: html/admin.php:115 91 msgid "Font weight:" 92 msgstr "Police d'écriture :" 93 94 #: html/admin.php:122 95 msgid "Normal" 96 msgstr "Normal" 97 98 #: html/admin.php:128 99 msgid "Bold" 100 msgstr "Gras" 101 102 #: html/admin.php:134 103 msgid "Text transform:" 104 msgstr "Transformation du texte :" 105 106 #: html/admin.php:141 107 msgid "None" 108 msgstr "Aucune" 109 110 #: html/admin.php:147 111 msgid "Lowercase" 112 msgstr "Minuscule" 113 114 #: html/admin.php:153 115 msgid "Uppercase" 116 msgstr "Majuscule" 117 118 #: html/admin.php:159 119 msgid "Position in product list:" 120 msgstr "Position sur la liste des produits :" 121 122 #: html/admin.php:167 123 msgid "Before the name product" 124 msgstr "Avant le nom du produit" 125 126 #: html/admin.php:175 html/admin.php:206 127 msgid "After the name product" 128 msgstr "Après le nom du produit" 129 130 #: html/admin.php:183 131 msgid "After the \"Read more\" button" 132 msgstr "Après le bouton \"Lire la suite\"" 133 134 #: html/admin.php:191 html/admin.php:230 135 msgid "Don't display" 136 msgstr "Ne pas afficher" 137 138 #: html/admin.php:198 139 msgid "Position in product page:" 140 msgstr "Position sur la page du produit :" 141 142 #: html/admin.php:214 143 msgid "After the price" 144 msgstr "Après le prix" 145 146 #: html/admin.php:222 147 msgid "After the \"Add to cart\" button" 148 msgstr "Après le bouton \"Ajouter au panier\"" 149 150 #: html/admin.php:238 151 msgid "Preview:" 152 msgstr "Prévisualisation :" 153 154 #: html/admin.php:252 155 msgid "Save configuration" 156 msgstr "Sauvegarder la configuration" 157 158 #. Name of the plugin 159 msgid "WooCommerce new product info" 160 msgstr "WooCommerce info nouveau produit" 161 162 162 #. Author of the plugin 163 163 msgid "Motpr355" -
woo-new-product-info/trunk/readme.txt
r1914911 r1916016 5 5 Tested up to: 4.9 6 6 Requires PHP : 5.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 … … 53 53 1/ Install the plugin in "Plugins" => "Add new" 54 54 2/ Activate the plugin in "Plugins" => "Installed plugins" 55 3/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce -new product info" => "Settings", or in "Products" => "New product info"55 3/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce new product info" => "Settings", or in "Products" => "New product info" 56 56 4/ Save your configuration 57 57 -
woo-new-product-info/trunk/woo-new-product-info.php
r1914911 r1916016 3 3 Plugin Name: WooCommerce new product info 4 4 Description: Differentiate WooCommerce new products by displaying a customizable "New" tag. 5 Version: 1.0. 35 Version: 1.0.4 6 6 Author: Motpr355 7 7 Text Domain: motpr355_woo_new_product_info … … 45 45 } 46 46 47 $this->init_ hooks();47 $this->init_website_content(); 48 48 49 49 } … … 100 100 } 101 101 102 private function init_ hooks() {102 private function init_website_content() { 103 103 if ( isset ( $this->settings->{$this->settings_enum->activation}, 104 104 $this->settings->{$this->settings_enum->list_position}, 105 105 $this->settings->{$this->settings_enum->product_position} ) ) { 106 106 if ( $this->settings->{$this->settings_enum->activation} === $this->activation_enum->actived ) { 107 add_action( 'wp_head', array( $this, 'display_website_style' ) ); 107 108 if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->before_name ) { 108 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_ info' ), 9 );109 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_website_info' ), 9 ); 109 110 } else if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->after_name ) { 110 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_ info' ), 11 );111 add_action( 'woocommerce_shop_loop_item_title', array( $this, 'display_website_info' ), 11 ); 111 112 } else if ( $this->settings->{$this->settings_enum->list_position} === $this->list_position_enum->after_button ) { 112 add_action( 'woocommerce_after_shop_loop_item', array( $this, 'display_ info' ), 11 );113 add_action( 'woocommerce_after_shop_loop_item', array( $this, 'display_website_info' ), 11 ); 113 114 } 114 115 if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_name ) { 115 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 6 );116 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 6 ); 116 117 } else if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_price ) { 117 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 11 );118 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 11 ); 118 119 } else if ( $this->settings->{$this->settings_enum->product_position} === $this->product_position_enum->after_button ) { 119 add_action( 'woocommerce_single_product_summary', array( $this, 'display_ info' ), 31 );120 add_action( 'woocommerce_single_product_summary', array( $this, 'display_website_info' ), 31 ); 120 121 } 121 122 } … … 123 124 } 124 125 125 public function display_ info() {126 public function display_website_info() { 126 127 if ( function_exists( 'get_the_date' ) ) { 127 128 $limit_time = time() - ( $this->settings->{$this->settings_enum->duration} * 60 * 60 * 24 ); 128 129 $published_time = strtotime( get_the_date( 'Y-m-d' ) ); 129 130 if ( $published_time - $limit_time > 0 ) { 130 if (isset ( $this->settings->{$this->settings_enum->text}, 131 $this->settings->{$this->settings_enum->background_color}, 132 $this->settings->{$this->settings_enum->color}, 133 $this->settings->{$this->settings_enum->font_weight} ) ) { 131 if ( isset ( $this->settings->{$this->settings_enum->text} ) ) { 134 132 echo $this->get_display_info_content(); 135 133 } 136 134 } 135 } 136 } 137 138 public function display_website_style() { 139 if ( isset ( $this->settings->{$this->settings_enum->background_color}, 140 $this->settings->{$this->settings_enum->color}, 141 $this->settings->{$this->settings_enum->font_weight}, 142 $this->settings->{$this->settings_enum->text_transform} ) ) { 143 include plugin_dir_path( __FILE__ ) . 'css/website.php'; 137 144 } 138 145 } … … 188 195 'woo-new-product-info/woo-new-product-info.php', 189 196 'motpr355-woo-new-product-info', 190 'woo-new-product-info' 197 'woo-new-product-info', 198 'motpr355-woo-new-product-info.php', 199 'woo-new-product-info.php' 191 200 ); 192 201 if ( isset( $item->slug ) && in_array( $item->slug, $plugins ) ) { … … 225 234 wp_register_script( 226 235 'motpr355_woo_new_product_info_script', 227 plugins_url( 'js/ js.js', __FILE__ ),236 plugins_url( 'js/admin.js', __FILE__ ), 228 237 array( 'wp-color-picker' ), 229 238 '1.0.0', … … 238 247 wp_register_script( 239 248 'motpr355_woo_new_product_info_script', 240 plugins_url( 'js/ extensions.js', __FILE__ ),249 plugins_url( 'js/admin-extensions.js', __FILE__ ), 241 250 array(), 242 251 '1.0.0', … … 266 275 wp_register_style( 267 276 'motpr355_woo_new_product_info_style', 268 plugins_url( 'css/ css.css', __FILE__ ),277 plugins_url( 'css/admin.css', __FILE__ ), 269 278 array(), 270 279 '1.0.0'
Note: See TracChangeset
for help on using the changeset viewer.