Plugin Directory

Changeset 1916016


Ignore:
Timestamp:
07/27/2018 09:45:14 PM (8 years ago)
Author:
motpr355
Message:

1.0.4 version

Location:
woo-new-product-info
Files:
8 added
7 deleted
10 edited
3 copied

Legend:

Unmodified
Added
Removed
  • woo-new-product-info/tags/1.0.4/html/admin.php

    r1914529 r1916016  
    77
    88    <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' ) ?>
    1010    </h1>
     11
     12    <h3><?php _e( 'Differentiate WooCommerce new products by displaying a customizable "New" tag.', 'motpr355_woo_new_product_info' ) ?></h3>
    1113
    1214    <noscript>
     
    2729
    2830    <form autocomplete="off" method="POST" action="">
     31        <hr/>
    2932        <p>
    3033            <span>
  • woo-new-product-info/tags/1.0.4/html/website.php

    r1914529 r1916016  
    44}
    55?>
    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">
    148        <?php
    159        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  
    33"Project-Id-Version: WooCommerce new product info\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2018-07-21 12:38+0000\n"
    6 "PO-Revision-Date: 2018-07-21 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"
    77"Last-Translator: wordpress <dazdazd@dzadaz.ed>\n"
    88"Language-Team: French (France)\n"
     
    1414"X-Generator: Loco https://localise.biz/"
    1515
    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
    1817msgid "New product info"
    1918msgstr "Info nouveau produit"
    2019
    21 #: motpr355-woo-new-product-info.php:246
     20#: woo-new-product-info.php:256
    2221msgid "WooCommerce must be actived"
    2322msgstr "Le plugin WooCommerce doit être activé"
    2423
    25 #: motpr355-woo-new-product-info.php:250
     24#: woo-new-product-info.php:260
    2625msgid "WooCommerce must be installed"
    2726msgstr "Le plugin WooCommerce doit être installé"
    2827
    29 #: html/website.php:16 html/admin.php:76 html/admin.php:235
     28#: html/website.php:10 html/admin.php:83 html/admin.php:242
    3029msgid "New"
    3130msgstr "Nouveau"
    3231
    33 #: html/website.php:18 html/admin.php:82
     32#: html/website.php:12 html/admin.php:89
    3433msgid "New!"
    3534msgstr "Nouveau !"
    3635
    37 #: html/admin.php:15
    38 msgid "Please activate JavaScript to edit the configuration."
    39 msgstr "Merci d'activer JavaScript pour éditer la configuration."
    40 
    41 #: html/admin.php:23
    42 msgid "Configuration saved."
    43 msgstr "Configuration sauvegardée."
    44 
    45 #: html/admin.php:31
    46 msgid "Activate functionality:"
    47 msgstr "Activer la fonctionnalité :"
    48 
    49 #: html/admin.php:39
    50 msgid "Activate"
    51 msgstr "Activer"
    52 
    53 #: html/admin.php:47
    54 msgid "Deactivate"
    55 msgstr "Désactiver"
    56 
    57 #: html/admin.php:55
    58 msgid "Consider a product as new during:"
    59 msgstr "Considérer un produit comme nouveau pendant :"
    60 
    61 #: html/admin.php:59
    62 msgid "1 day"
    63 msgstr "1 jour"
    64 
    65 #: html/admin.php:61
    66 #, php-format
    67 msgid "%d days"
    68 msgstr "%d jours"
    69 
    70 #: html/admin.php:69
    71 msgid "Text:"
    72 msgstr "Texte :"
    73 
    74 #: html/admin.php:88
    75 msgid "Background color:"
    76 msgstr "Couleur du fond :"
    77 
    78 #: html/admin.php:98
    79 msgid "Color:"
    80 msgstr "Couleur :"
    81 
    82 #: html/admin.php:108
    83 msgid "Font weight:"
    84 msgstr "Police d'écriture :"
    85 
    86 #: html/admin.php:115
    87 msgid "Normal"
    88 msgstr "Normal"
    89 
    90 #: html/admin.php:121
    91 msgid "Bold"
    92 msgstr "Gras"
    93 
    94 #: html/admin.php:127
    95 msgid "Text transform:"
    96 msgstr "Transformation du texte :"
    97 
    98 #: html/admin.php:134
    99 msgid "None"
    100 msgstr "Aucune"
    101 
    102 #: html/admin.php:140
    103 msgid "Lowercase"
    104 msgstr "Minuscule"
    105 
    106 #: html/admin.php:146
    107 msgid "Uppercase"
    108 msgstr "Majuscule"
    109 
    110 #: html/admin.php:152
    111 msgid "Position in product list:"
    112 msgstr "Position sur la liste des produits :"
    113 
    114 #: html/admin.php:160
    115 msgid "Before the name product"
    116 msgstr "Avant le nom du produit"
    117 
    118 #: html/admin.php:168 html/admin.php:199
    119 msgid "After the name product"
    120 msgstr "Après le nom du produit"
    121 
    122 #: html/admin.php:176
    123 msgid "After the \"Read more\" button"
    124 msgstr "Après le bouton \"Lire la suite\""
    125 
    126 #: html/admin.php:184 html/admin.php:223
    127 msgid "Don't display"
    128 msgstr "Ne pas afficher"
    129 
    130 #: html/admin.php:191
    131 msgid "Position in product page:"
    132 msgstr "Position sur la page du produit :"
    133 
    134 #: html/admin.php:207
    135 msgid "After the price"
    136 msgstr "Après le prix"
    137 
    138 #: html/admin.php:215
    139 msgid "After the \"Add to cart\" button"
    140 msgstr "Après le bouton \"Ajouter au panier\""
    141 
    142 #: html/admin.php:231
    143 msgid "Preview:"
    144 msgstr "Prévisualisation :"
    145 
    146 #: html/admin.php:244
    147 msgid "Save configuration"
    148 msgstr "Sauvegarder la configuration"
    149 
    150 #. Name of the plugin
    151 msgid "WooCommerce - new product info"
    152 msgstr "WooCommerce - info nouveau produit"
    153 
    15436#. Description of the plugin
     37#: html/admin.php:12
    15538msgid ""
    15639"Differentiate WooCommerce new products by displaying a customizable \"New\" "
     
    16043"\"Nouveau\" personnalisable."
    16144
     45#: html/admin.php:17
     46msgid "Please activate JavaScript to edit the configuration."
     47msgstr "Merci d'activer JavaScript pour éditer la configuration."
     48
     49#: html/admin.php:25
     50msgid "Configuration saved."
     51msgstr "Configuration sauvegardée."
     52
     53#: html/admin.php:34
     54msgid "Activate functionality:"
     55msgstr "Activer la fonctionnalité :"
     56
     57#: html/admin.php:42
     58msgid "Activate"
     59msgstr "Activer"
     60
     61#: html/admin.php:54
     62msgid "Deactivate"
     63msgstr "Désactiver"
     64
     65#: html/admin.php:62
     66msgid "Consider a product as new during:"
     67msgstr "Considérer un produit comme nouveau pendant :"
     68
     69#: html/admin.php:66
     70msgid "1 day"
     71msgstr "1 jour"
     72
     73#: html/admin.php:68
     74#, php-format
     75msgid "%d days"
     76msgstr "%d jours"
     77
     78#: html/admin.php:76
     79msgid "Text:"
     80msgstr "Texte :"
     81
     82#: html/admin.php:95
     83msgid "Background color:"
     84msgstr "Couleur du fond :"
     85
     86#: html/admin.php:105
     87msgid "Color:"
     88msgstr "Couleur :"
     89
     90#: html/admin.php:115
     91msgid "Font weight:"
     92msgstr "Police d'écriture :"
     93
     94#: html/admin.php:122
     95msgid "Normal"
     96msgstr "Normal"
     97
     98#: html/admin.php:128
     99msgid "Bold"
     100msgstr "Gras"
     101
     102#: html/admin.php:134
     103msgid "Text transform:"
     104msgstr "Transformation du texte :"
     105
     106#: html/admin.php:141
     107msgid "None"
     108msgstr "Aucune"
     109
     110#: html/admin.php:147
     111msgid "Lowercase"
     112msgstr "Minuscule"
     113
     114#: html/admin.php:153
     115msgid "Uppercase"
     116msgstr "Majuscule"
     117
     118#: html/admin.php:159
     119msgid "Position in product list:"
     120msgstr "Position sur la liste des produits :"
     121
     122#: html/admin.php:167
     123msgid "Before the name product"
     124msgstr "Avant le nom du produit"
     125
     126#: html/admin.php:175 html/admin.php:206
     127msgid "After the name product"
     128msgstr "Après le nom du produit"
     129
     130#: html/admin.php:183
     131msgid "After the \"Read more\" button"
     132msgstr "Après le bouton \"Lire la suite\""
     133
     134#: html/admin.php:191 html/admin.php:230
     135msgid "Don't display"
     136msgstr "Ne pas afficher"
     137
     138#: html/admin.php:198
     139msgid "Position in product page:"
     140msgstr "Position sur la page du produit :"
     141
     142#: html/admin.php:214
     143msgid "After the price"
     144msgstr "Après le prix"
     145
     146#: html/admin.php:222
     147msgid "After the \"Add to cart\" button"
     148msgstr "Après le bouton \"Ajouter au panier\""
     149
     150#: html/admin.php:238
     151msgid "Preview:"
     152msgstr "Prévisualisation :"
     153
     154#: html/admin.php:252
     155msgid "Save configuration"
     156msgstr "Sauvegarder la configuration"
     157
     158#. Name of the plugin
     159msgid "WooCommerce new product info"
     160msgstr "WooCommerce info nouveau produit"
     161
    162162#. Author of the plugin
    163163msgid "Motpr355"
  • woo-new-product-info/tags/1.0.4/readme.txt

    r1914911 r1916016  
    55Tested up to: 4.9
    66Requires PHP : 5.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2 or later
    99
     
    53531/ Install the plugin in "Plugins" => "Add new"
    54542/ 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"
     553/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce new product info" => "Settings", or in "Products" => "New product info"
    56564/ Save your configuration
    5757
  • woo-new-product-info/tags/1.0.4/woo-new-product-info.php

    r1914911 r1916016  
    33Plugin Name: WooCommerce new product info
    44Description: Differentiate WooCommerce new products by displaying a customizable "New" tag.
    5 Version: 1.0.3
     5Version: 1.0.4
    66Author: Motpr355
    77Text Domain: motpr355_woo_new_product_info
     
    4545        }
    4646
    47         $this->init_hooks();
     47        $this->init_website_content();
    4848
    4949    }
     
    100100    }
    101101
    102     private function init_hooks() {
     102    private function init_website_content() {
    103103        if ( isset ( $this->settings->{$this->settings_enum->activation},
    104104            $this->settings->{$this->settings_enum->list_position},
    105105            $this->settings->{$this->settings_enum->product_position} ) ) {
    106106            if ( $this->settings->{$this->settings_enum->activation} === $this->activation_enum->actived ) {
     107                add_action( 'wp_head', array( $this, 'display_website_style' ) );
    107108                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 );
    109110                } 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 );
    111112                } 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 );
    113114                }
    114115                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 );
    116117                } 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 );
    118119                } 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 );
    120121                }
    121122            }
     
    123124    }
    124125
    125     public function display_info() {
     126    public function display_website_info() {
    126127        if ( function_exists( 'get_the_date' ) ) {
    127128            $limit_time = time() - ( $this->settings->{$this->settings_enum->duration} * 60 * 60 * 24 );
    128129            $published_time = strtotime( get_the_date( 'Y-m-d' ) );
    129130            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} ) ) {
    134132                    echo $this->get_display_info_content();
    135133                }
    136134            }
     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';
    137144        }
    138145    }
     
    188195            'woo-new-product-info/woo-new-product-info.php',
    189196            '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'
    191200        );
    192201        if ( isset( $item->slug ) && in_array( $item->slug, $plugins ) ) {
     
    225234                wp_register_script(
    226235                    'motpr355_woo_new_product_info_script',
    227                     plugins_url( 'js/js.js', __FILE__ ),
     236                    plugins_url( 'js/admin.js', __FILE__ ),
    228237                    array( 'wp-color-picker' ),
    229238                    '1.0.0',
     
    238247                wp_register_script(
    239248                    'motpr355_woo_new_product_info_script',
    240                     plugins_url( 'js/extensions.js', __FILE__ ),
     249                    plugins_url( 'js/admin-extensions.js', __FILE__ ),
    241250                    array(),
    242251                    '1.0.0',
     
    266275            wp_register_style(
    267276                'motpr355_woo_new_product_info_style',
    268                 plugins_url( 'css/css.css', __FILE__ ),
     277                plugins_url( 'css/admin.css', __FILE__ ),
    269278                array(),
    270279                '1.0.0'
  • woo-new-product-info/trunk/html/admin.php

    r1914529 r1916016  
    77
    88    <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' ) ?>
    1010    </h1>
     11
     12    <h3><?php _e( 'Differentiate WooCommerce new products by displaying a customizable "New" tag.', 'motpr355_woo_new_product_info' ) ?></h3>
    1113
    1214    <noscript>
     
    2729
    2830    <form autocomplete="off" method="POST" action="">
     31        <hr/>
    2932        <p>
    3033            <span>
  • woo-new-product-info/trunk/html/website.php

    r1914529 r1916016  
    44}
    55?>
    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">
    148        <?php
    159        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  
    33"Project-Id-Version: WooCommerce new product info\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2018-07-21 12:38+0000\n"
    6 "PO-Revision-Date: 2018-07-21 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"
    77"Last-Translator: wordpress <dazdazd@dzadaz.ed>\n"
    88"Language-Team: French (France)\n"
     
    1414"X-Generator: Loco https://localise.biz/"
    1515
    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
    1817msgid "New product info"
    1918msgstr "Info nouveau produit"
    2019
    21 #: motpr355-woo-new-product-info.php:246
     20#: woo-new-product-info.php:256
    2221msgid "WooCommerce must be actived"
    2322msgstr "Le plugin WooCommerce doit être activé"
    2423
    25 #: motpr355-woo-new-product-info.php:250
     24#: woo-new-product-info.php:260
    2625msgid "WooCommerce must be installed"
    2726msgstr "Le plugin WooCommerce doit être installé"
    2827
    29 #: html/website.php:16 html/admin.php:76 html/admin.php:235
     28#: html/website.php:10 html/admin.php:83 html/admin.php:242
    3029msgid "New"
    3130msgstr "Nouveau"
    3231
    33 #: html/website.php:18 html/admin.php:82
     32#: html/website.php:12 html/admin.php:89
    3433msgid "New!"
    3534msgstr "Nouveau !"
    3635
    37 #: html/admin.php:15
    38 msgid "Please activate JavaScript to edit the configuration."
    39 msgstr "Merci d'activer JavaScript pour éditer la configuration."
    40 
    41 #: html/admin.php:23
    42 msgid "Configuration saved."
    43 msgstr "Configuration sauvegardée."
    44 
    45 #: html/admin.php:31
    46 msgid "Activate functionality:"
    47 msgstr "Activer la fonctionnalité :"
    48 
    49 #: html/admin.php:39
    50 msgid "Activate"
    51 msgstr "Activer"
    52 
    53 #: html/admin.php:47
    54 msgid "Deactivate"
    55 msgstr "Désactiver"
    56 
    57 #: html/admin.php:55
    58 msgid "Consider a product as new during:"
    59 msgstr "Considérer un produit comme nouveau pendant :"
    60 
    61 #: html/admin.php:59
    62 msgid "1 day"
    63 msgstr "1 jour"
    64 
    65 #: html/admin.php:61
    66 #, php-format
    67 msgid "%d days"
    68 msgstr "%d jours"
    69 
    70 #: html/admin.php:69
    71 msgid "Text:"
    72 msgstr "Texte :"
    73 
    74 #: html/admin.php:88
    75 msgid "Background color:"
    76 msgstr "Couleur du fond :"
    77 
    78 #: html/admin.php:98
    79 msgid "Color:"
    80 msgstr "Couleur :"
    81 
    82 #: html/admin.php:108
    83 msgid "Font weight:"
    84 msgstr "Police d'écriture :"
    85 
    86 #: html/admin.php:115
    87 msgid "Normal"
    88 msgstr "Normal"
    89 
    90 #: html/admin.php:121
    91 msgid "Bold"
    92 msgstr "Gras"
    93 
    94 #: html/admin.php:127
    95 msgid "Text transform:"
    96 msgstr "Transformation du texte :"
    97 
    98 #: html/admin.php:134
    99 msgid "None"
    100 msgstr "Aucune"
    101 
    102 #: html/admin.php:140
    103 msgid "Lowercase"
    104 msgstr "Minuscule"
    105 
    106 #: html/admin.php:146
    107 msgid "Uppercase"
    108 msgstr "Majuscule"
    109 
    110 #: html/admin.php:152
    111 msgid "Position in product list:"
    112 msgstr "Position sur la liste des produits :"
    113 
    114 #: html/admin.php:160
    115 msgid "Before the name product"
    116 msgstr "Avant le nom du produit"
    117 
    118 #: html/admin.php:168 html/admin.php:199
    119 msgid "After the name product"
    120 msgstr "Après le nom du produit"
    121 
    122 #: html/admin.php:176
    123 msgid "After the \"Read more\" button"
    124 msgstr "Après le bouton \"Lire la suite\""
    125 
    126 #: html/admin.php:184 html/admin.php:223
    127 msgid "Don't display"
    128 msgstr "Ne pas afficher"
    129 
    130 #: html/admin.php:191
    131 msgid "Position in product page:"
    132 msgstr "Position sur la page du produit :"
    133 
    134 #: html/admin.php:207
    135 msgid "After the price"
    136 msgstr "Après le prix"
    137 
    138 #: html/admin.php:215
    139 msgid "After the \"Add to cart\" button"
    140 msgstr "Après le bouton \"Ajouter au panier\""
    141 
    142 #: html/admin.php:231
    143 msgid "Preview:"
    144 msgstr "Prévisualisation :"
    145 
    146 #: html/admin.php:244
    147 msgid "Save configuration"
    148 msgstr "Sauvegarder la configuration"
    149 
    150 #. Name of the plugin
    151 msgid "WooCommerce - new product info"
    152 msgstr "WooCommerce - info nouveau produit"
    153 
    15436#. Description of the plugin
     37#: html/admin.php:12
    15538msgid ""
    15639"Differentiate WooCommerce new products by displaying a customizable \"New\" "
     
    16043"\"Nouveau\" personnalisable."
    16144
     45#: html/admin.php:17
     46msgid "Please activate JavaScript to edit the configuration."
     47msgstr "Merci d'activer JavaScript pour éditer la configuration."
     48
     49#: html/admin.php:25
     50msgid "Configuration saved."
     51msgstr "Configuration sauvegardée."
     52
     53#: html/admin.php:34
     54msgid "Activate functionality:"
     55msgstr "Activer la fonctionnalité :"
     56
     57#: html/admin.php:42
     58msgid "Activate"
     59msgstr "Activer"
     60
     61#: html/admin.php:54
     62msgid "Deactivate"
     63msgstr "Désactiver"
     64
     65#: html/admin.php:62
     66msgid "Consider a product as new during:"
     67msgstr "Considérer un produit comme nouveau pendant :"
     68
     69#: html/admin.php:66
     70msgid "1 day"
     71msgstr "1 jour"
     72
     73#: html/admin.php:68
     74#, php-format
     75msgid "%d days"
     76msgstr "%d jours"
     77
     78#: html/admin.php:76
     79msgid "Text:"
     80msgstr "Texte :"
     81
     82#: html/admin.php:95
     83msgid "Background color:"
     84msgstr "Couleur du fond :"
     85
     86#: html/admin.php:105
     87msgid "Color:"
     88msgstr "Couleur :"
     89
     90#: html/admin.php:115
     91msgid "Font weight:"
     92msgstr "Police d'écriture :"
     93
     94#: html/admin.php:122
     95msgid "Normal"
     96msgstr "Normal"
     97
     98#: html/admin.php:128
     99msgid "Bold"
     100msgstr "Gras"
     101
     102#: html/admin.php:134
     103msgid "Text transform:"
     104msgstr "Transformation du texte :"
     105
     106#: html/admin.php:141
     107msgid "None"
     108msgstr "Aucune"
     109
     110#: html/admin.php:147
     111msgid "Lowercase"
     112msgstr "Minuscule"
     113
     114#: html/admin.php:153
     115msgid "Uppercase"
     116msgstr "Majuscule"
     117
     118#: html/admin.php:159
     119msgid "Position in product list:"
     120msgstr "Position sur la liste des produits :"
     121
     122#: html/admin.php:167
     123msgid "Before the name product"
     124msgstr "Avant le nom du produit"
     125
     126#: html/admin.php:175 html/admin.php:206
     127msgid "After the name product"
     128msgstr "Après le nom du produit"
     129
     130#: html/admin.php:183
     131msgid "After the \"Read more\" button"
     132msgstr "Après le bouton \"Lire la suite\""
     133
     134#: html/admin.php:191 html/admin.php:230
     135msgid "Don't display"
     136msgstr "Ne pas afficher"
     137
     138#: html/admin.php:198
     139msgid "Position in product page:"
     140msgstr "Position sur la page du produit :"
     141
     142#: html/admin.php:214
     143msgid "After the price"
     144msgstr "Après le prix"
     145
     146#: html/admin.php:222
     147msgid "After the \"Add to cart\" button"
     148msgstr "Après le bouton \"Ajouter au panier\""
     149
     150#: html/admin.php:238
     151msgid "Preview:"
     152msgstr "Prévisualisation :"
     153
     154#: html/admin.php:252
     155msgid "Save configuration"
     156msgstr "Sauvegarder la configuration"
     157
     158#. Name of the plugin
     159msgid "WooCommerce new product info"
     160msgstr "WooCommerce info nouveau produit"
     161
    162162#. Author of the plugin
    163163msgid "Motpr355"
  • woo-new-product-info/trunk/readme.txt

    r1914911 r1916016  
    55Tested up to: 4.9
    66Requires PHP : 5.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2 or later
    99
     
    53531/ Install the plugin in "Plugins" => "Add new"
    54542/ 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"
     553/ Configure the plugin in "Plugins" => "Installed plugins" => "WooCommerce new product info" => "Settings", or in "Products" => "New product info"
    56564/ Save your configuration
    5757
  • woo-new-product-info/trunk/woo-new-product-info.php

    r1914911 r1916016  
    33Plugin Name: WooCommerce new product info
    44Description: Differentiate WooCommerce new products by displaying a customizable "New" tag.
    5 Version: 1.0.3
     5Version: 1.0.4
    66Author: Motpr355
    77Text Domain: motpr355_woo_new_product_info
     
    4545        }
    4646
    47         $this->init_hooks();
     47        $this->init_website_content();
    4848
    4949    }
     
    100100    }
    101101
    102     private function init_hooks() {
     102    private function init_website_content() {
    103103        if ( isset ( $this->settings->{$this->settings_enum->activation},
    104104            $this->settings->{$this->settings_enum->list_position},
    105105            $this->settings->{$this->settings_enum->product_position} ) ) {
    106106            if ( $this->settings->{$this->settings_enum->activation} === $this->activation_enum->actived ) {
     107                add_action( 'wp_head', array( $this, 'display_website_style' ) );
    107108                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 );
    109110                } 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 );
    111112                } 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 );
    113114                }
    114115                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 );
    116117                } 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 );
    118119                } 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 );
    120121                }
    121122            }
     
    123124    }
    124125
    125     public function display_info() {
     126    public function display_website_info() {
    126127        if ( function_exists( 'get_the_date' ) ) {
    127128            $limit_time = time() - ( $this->settings->{$this->settings_enum->duration} * 60 * 60 * 24 );
    128129            $published_time = strtotime( get_the_date( 'Y-m-d' ) );
    129130            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} ) ) {
    134132                    echo $this->get_display_info_content();
    135133                }
    136134            }
     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';
    137144        }
    138145    }
     
    188195            'woo-new-product-info/woo-new-product-info.php',
    189196            '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'
    191200        );
    192201        if ( isset( $item->slug ) && in_array( $item->slug, $plugins ) ) {
     
    225234                wp_register_script(
    226235                    'motpr355_woo_new_product_info_script',
    227                     plugins_url( 'js/js.js', __FILE__ ),
     236                    plugins_url( 'js/admin.js', __FILE__ ),
    228237                    array( 'wp-color-picker' ),
    229238                    '1.0.0',
     
    238247                wp_register_script(
    239248                    'motpr355_woo_new_product_info_script',
    240                     plugins_url( 'js/extensions.js', __FILE__ ),
     249                    plugins_url( 'js/admin-extensions.js', __FILE__ ),
    241250                    array(),
    242251                    '1.0.0',
     
    266275            wp_register_style(
    267276                'motpr355_woo_new_product_info_style',
    268                 plugins_url( 'css/css.css', __FILE__ ),
     277                plugins_url( 'css/admin.css', __FILE__ ),
    269278                array(),
    270279                '1.0.0'
Note: See TracChangeset for help on using the changeset viewer.