Plugin Directory

Changeset 1468617


Ignore:
Timestamp:
08/05/2016 01:13:49 PM (10 years ago)
Author:
isikom
Message:

update tags

Location:
woocommerce-sample
Files:
38 added
7 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-sample/trunk/css/style-admin.css

    r886372 r1468617  
    1 #woocommerce-product-data ul.product_data_tabs li a.added_sample{
    2     background: url(../images/sample-icon.png) no-repeat 6px 5px transparent;
    3     line-height:1em;
    4     padding:5px 5px 5px 28px;
    5     text-shadow:0 1px 1px #FFFFFF;
     1#woocommerce-product-data ul.product_data_tabs li a.added_sample:before{
     2    content: "\f312";
    63}
    74
  • woocommerce-sample/trunk/languages/woosample-it_IT.po

    r886372 r1468617  
    22msgstr ""
    33"Project-Id-Version: WooCommerce Sample\n"
    4 "POT-Creation-Date: 2014-03-02 19:14+0100\n"
    5 "PO-Revision-Date: 2014-03-02 19:16+0100\n"
    6 "Last-Translator: Michele Menciassi <m.menciassi@gmail.com>\n"
     4"POT-Creation-Date: 2016-08-05 00:16+0200\n"
     5"PO-Revision-Date: 2016-08-05 00:17+0200\n"
     6"Last-Translator: Michele Menciassi <m.menciassi@isikom.net>\n"
    77"Language-Team: ISIKOM <info@isikom.net>\n"
    88"Language: it\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.6.4\n"
     12"X-Generator: Poedit 1.8.8\n"
    1313"X-Poedit-Basepath: .\n"
    1414"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     
    1616"X-Poedit-SearchPath-0: ..\n"
    1717
    18 #: ../woocommerce-sample.php:106 ../woocommerce-sample.php:193
     18#: ../woocommerce-sample.php:189 ../woocommerce-sample.php:196
     19#: ../woocommerce-sample.php:280
    1920msgid "Sample"
    2021msgstr "Campione"
    2122
    22 #: ../woocommerce-sample.php:176
     23#: ../woocommerce-sample.php:263
    2324msgid "A sample of the same product is already present into your cart"
    2425msgstr "Un campione dello stesso prodotto è già presente nel tuo carrello"
    2526
    26 #: ../woocommerce-sample.php:180
     27#: ../woocommerce-sample.php:267
    2728msgid ""
    2829"You have already added this product on your cart, you can't add a sample of "
     
    3233"campione dello stesso articolo"
    3334
    34 #: ../woocommerce-sample.php:209
     35#: ../woocommerce-sample.php:302
    3536msgid "Enable sample"
    3637msgstr "Abilita il Campione"
    3738
    38 #: ../woocommerce-sample.php:210
     39#: ../woocommerce-sample.php:303
    3940msgid "Enable or disable sample option for this item."
    4041msgstr "Abilita o disabilita le opzioni per il campione per questo articolo"
    4142
    42 #: ../woocommerce-sample.php:212
     43#: ../woocommerce-sample.php:307
     44msgid "Add chained products"
     45msgstr "Aggiungi i prodotti concatenati"
     46
     47#: ../woocommerce-sample.php:308
     48msgid "Add or not chained products as sample."
     49msgstr "Aggiungi o meno i prodotti concatenati come campione"
     50
     51#: ../woocommerce-sample.php:311
    4352msgid "Sample Shipping"
    4453msgstr "Trasporto del Campione"
    4554
    46 #: ../woocommerce-sample.php:215
     55#: ../woocommerce-sample.php:314
    4756msgid "use default product shipping methods"
    4857msgstr "usa il metodo di trasporto impostato per il prodotto"
    4958
    50 #: ../woocommerce-sample.php:219
     59#: ../woocommerce-sample.php:318
    5160msgid "free shipping for sample"
    5261msgstr "trasporto gratuito per il campione"
    5362
    54 #: ../woocommerce-sample.php:223
     63#: ../woocommerce-sample.php:323
    5564msgid "custom fee shipping"
    5665msgstr "spese di trasporto personalizzate"
    5766
    58 #: ../woocommerce-sample.php:225
     67#: ../woocommerce-sample.php:325
    5968msgid "set shipping fee"
    6069msgstr "imposta le spese di trasporto"
    6170
    62 #: ../woocommerce-sample.php:229
     71#: ../woocommerce-sample.php:330
    6372msgid "Sample price"
    6473msgstr "Prezzo del Campione"
    6574
    66 #: ../woocommerce-sample.php:232
     75#: ../woocommerce-sample.php:333
    6776msgid "product default price"
    6877msgstr "prezzo impostato nel prodotto"
    6978
    70 #: ../woocommerce-sample.php:236
     79#: ../woocommerce-sample.php:337
    7180msgid "free"
    7281msgstr "gratuito"
    7382
    74 #: ../woocommerce-sample.php:240
     83#: ../woocommerce-sample.php:341
    7584msgid "custom price"
    7685msgstr "prezzo personalizzato"
    7786
    78 #: ../woocommerce-sample.php:242
     87#: ../woocommerce-sample.php:343
    7988msgid "set sample price"
    8089msgstr "imposta il prezzo del campione"
    8190
    82 #: ../woocommerce-sample.php:284
     91#: ../woocommerce-sample.php:393
    8392msgid "Add Sample to cart"
    8493msgstr "Richiedi un Campione"
    8594
    86 #: ../woocommerce-sample.php:332
     95#: ../woocommerce-sample.php:434
    8796#, php-format
    8897msgid ""
  • woocommerce-sample/trunk/languages/woosample.pot

    r886372 r1468617  
     1#, fuzzy
    12msgid ""
    23msgstr ""
    34"Project-Id-Version: WooCommerce Sample\n"
    4 "POT-Creation-Date: 2014-03-02 19:13+0100\n"
     5"POT-Creation-Date: 2016-08-05 00:16+0200\n"
    56"PO-Revision-Date: 2014-03-02 19:14+0100\n"
    67"Last-Translator: Michele Menciassi <m.menciassi@gmail.com>\n"
     
    1011"Content-Type: text/plain; charset=UTF-8\n"
    1112"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.6.4\n"
     13"X-Generator: Poedit 1.8.8\n"
    1314"X-Poedit-Basepath: .\n"
    1415"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     
    1617"X-Poedit-SearchPath-0: ..\n"
    1718
    18 #: ../woocommerce-sample.php:106 ../woocommerce-sample.php:193
     19#: ../woocommerce-sample.php:189 ../woocommerce-sample.php:196
     20#: ../woocommerce-sample.php:280
    1921msgid "Sample"
    2022msgstr ""
    2123
    22 #: ../woocommerce-sample.php:176
     24#: ../woocommerce-sample.php:263
    2325msgid "A sample of the same product is already present into your cart"
    2426msgstr ""
    2527
    26 #: ../woocommerce-sample.php:180
     28#: ../woocommerce-sample.php:267
    2729msgid ""
    2830"You have already added this product on your cart, you can't add a sample of "
     
    3032msgstr ""
    3133
    32 #: ../woocommerce-sample.php:209
     34#: ../woocommerce-sample.php:302
    3335msgid "Enable sample"
    3436msgstr ""
    3537
    36 #: ../woocommerce-sample.php:210
     38#: ../woocommerce-sample.php:303
    3739msgid "Enable or disable sample option for this item."
    3840msgstr ""
    3941
    40 #: ../woocommerce-sample.php:212
     42#: ../woocommerce-sample.php:307
     43msgid "Add chained products"
     44msgstr ""
     45
     46#: ../woocommerce-sample.php:308
     47msgid "Add or not chained products as sample."
     48msgstr ""
     49
     50#: ../woocommerce-sample.php:311
    4151msgid "Sample Shipping"
    4252msgstr ""
    4353
    44 #: ../woocommerce-sample.php:215
     54#: ../woocommerce-sample.php:314
    4555msgid "use default product shipping methods"
    4656msgstr ""
    4757
    48 #: ../woocommerce-sample.php:219
     58#: ../woocommerce-sample.php:318
    4959msgid "free shipping for sample"
    5060msgstr ""
    5161
    52 #: ../woocommerce-sample.php:223
     62#: ../woocommerce-sample.php:323
    5363msgid "custom fee shipping"
    5464msgstr ""
    5565
    56 #: ../woocommerce-sample.php:225
     66#: ../woocommerce-sample.php:325
    5767msgid "set shipping fee"
    5868msgstr ""
    5969
    60 #: ../woocommerce-sample.php:229
     70#: ../woocommerce-sample.php:330
    6171msgid "Sample price"
    6272msgstr ""
    6373
    64 #: ../woocommerce-sample.php:232
     74#: ../woocommerce-sample.php:333
    6575msgid "product default price"
    6676msgstr ""
    6777
    68 #: ../woocommerce-sample.php:236
     78#: ../woocommerce-sample.php:337
    6979msgid "free"
    7080msgstr ""
    7181
    72 #: ../woocommerce-sample.php:240
     82#: ../woocommerce-sample.php:341
    7383msgid "custom price"
    7484msgstr ""
    7585
    76 #: ../woocommerce-sample.php:242
     86#: ../woocommerce-sample.php:343
    7787msgid "set sample price"
    7888msgstr ""
    7989
    80 #: ../woocommerce-sample.php:284
     90#: ../woocommerce-sample.php:393
    8191msgid "Add Sample to cart"
    8292msgstr ""
    8393
    84 #: ../woocommerce-sample.php:332
     94#: ../woocommerce-sample.php:434
    8595#, php-format
    8696msgid ""
  • woocommerce-sample/trunk/readme.txt

    r930949 r1468617  
    33Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, woocommerce, sample, free sample
    44Requires at least: 3.5
    5 Tested up to: 3.9.1
    6 Stable tag: 0.7.3
     5Tested up to: 4.6
     6Stable tag: 0.8.0
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616Compatibility with plugins:
    1717
     18* WooCommerce Chained Products
    1819* Min/Max Quantities
    1920* Measurement Price Calculator
     
    2425
    2526== Installation ==
    26 
    27 = Minimum Requirements =
    28 
    29 * WordPress 3.5 or greater
    30 * PHP version 5.2.4 or greater
    31 * MySQL version 5.0 or greater
    32 * WooCommerce 2.0.20 or greater
    3327
    3428= Automatic installation =
     
    5044= Free shipping doesn't work =
    5145
    52 The "free shipping" option on Sample back end panel need that "free shipping" methods is enabled on your WooCommerce installation.
    53 You could enable it on WooCommerce Settings -> Shipping -> Free Shipping (as you can see on screenshot tab)
     46The "free shipping" option on Sample back end panel need that "free shipping" methods is enabled for your on your WooCommerce installation.
     47You could enable it on WooCommerce -> Settings -> Shipping -> Shipping Zone -> Free Shipping.
     48Make it enabled and set it available for coupon.
     49(as you can see on screenshot tab)
    5450
    5551== Screenshots ==
     
    58542. Back end - Sample setting on product page
    59553. remember to enable WooCommerce Free Shipping to use it on WooCommerce Sample Plugins
     564. remember to set Free Shipping available for coupon
    6057
    6158== Changelog ==
     59
     60= 0.8.0 - 05/08/2016 =
     61* added support for WooCommerce Chained Products plugin
     62* update hooks and functions used by WooCommerce
     63* update .pot file
     64* fix CSS for admin panel
    6265
    6366= 0.7.12 - 12/06/2014 =
  • woocommerce-sample/trunk/woocommerce-sample.php

    r930949 r1468617  
    66 * Author: Michele Menciassi
    77 * Author URI: https://plus.google.com/+MicheleMenciassi
    8  * Version: 0.7.3
     8 * Version: 0.8.0
    99 * License: GPLv2 or later
    1010 */
     
    4545            add_filter('woocommerce_get_item_data', array( $this, 'get_item_data' ), 10, 2 );
    4646            add_filter('woocommerce_get_cart_item_from_session', array( $this, 'filter_session'), 10, 3);
    47             add_filter('woocommerce_in_cart_product_title', array( $this, 'cart_title'), 10, 3);
     47            add_filter('woocommerce_cart_item_name', array( $this, 'cart_title'), 10, 3);
    4848            add_filter('woocommerce_cart_widget_product_title', array( $this, 'cart_widget_product_title'), 10, 2);
    4949            add_filter('woocommerce_cart_item_quantity', array( $this, 'cart_item_quantity'), 10, 2);
    5050   
    5151            add_filter('woocommerce_shipping_free_shipping_is_available', array( $this, 'enable_free_shipping'), 40, 1);
    52             add_filter('woocommerce_available_shipping_methods', array( $this, 'free_shipping_filter'), 10, 1);
    53 
     52           
     53            if ( version_compare( WOOCOMMERCE_VERSION, '2.1', '>' ) ){
     54                add_filter('woocommerce_package_rates', array( $this, 'free_shipping_filter'), 10, 1);
     55            }else{
     56                add_filter('woocommerce_available_shipping_methods', array( $this, 'free_shipping_filter'), 10, 1);
     57            }
    5458            add_action('woocommerce_add_order_item_meta', array($this, 'add_order_item_meta'), 10, 2);
    5559           
     
    6670            }
    6771
     72            // filter for WooCommerce Chained Products plugin override overriding
     73            if (in_array('woocommerce-chained-products/woocommerce-chained-products.php', apply_filters('active_plugins', get_option('active_plugins')))) {
     74                add_action( 'wc_after_chained_add_to_cart', array( $this, 'remove_chained_products' ), 20, 6 );
     75            }
     76           
     77        }
     78       
     79        function remove_chained_products ($chained_parent_id, $quantity, $chained_variation_id, $chained_variation_data, $chained_cart_item_data, $cart_item_key){
     80            global $woocommerce;
     81            $cart = $woocommerce->cart->get_cart();
     82            $main_is_sample = $cart[$cart_item_key]['sample'];
     83            if ($main_is_sample) {
     84                $main_product_id = $cart[$cart_item_key]['product_id'];
     85                if ( !get_post_meta($main_product_id, 'sample_chained_enambled', true) ) {
     86                    foreach ($cart as $cart_key => $cart_item) {
     87                        if ($cart_item['product_id'] == $chained_parent_id) {
     88                            $woocommerce->cart->remove_cart_item($cart_key);
     89                            break;
     90                        }
     91                    }
     92                }
     93            }
    6894        }
    6995
     
    137163      function free_shipping_filter( $available_methods )
    138164      {
    139             if ( isset( $available_methods['free_shipping'] ) ) :
    140                 // Get Free Shipping array into a new array
    141                 $freeshipping = array();
    142                 $freeshipping = $available_methods['free_shipping'];
    143          
    144                 // Empty the $available_methods array
    145                 unset( $available_methods );
    146          
    147                 // Add Free Shipping back into $avaialble_methods
    148                 $available_methods = array();
    149                 $available_methods['free_shipping'] = $freeshipping;
    150             endif;
     165            foreach ($available_methods as $key => $method) {
     166                if ($method->method_id == 'free_shipping'){
     167                    $available_methods = array();
     168                    $available_methods['free_shipping:1'] = $method;
     169                    break;                     
     170                }
     171            }
    151172            return $available_methods;
    152173      }
     
    199220      function get_item_data($item_data, $cart_item){
    200221              global $cart_item_key;
    201               //if ($cart_item['sample']){
    202               //          error_log('SAMPLE TRUE');
    203               //}else{
    204               //          error_log('SAMPLE FALSE');
    205               //}
    206222              return $item_data;
    207223      }
     
    245261            foreach ($cart_items as $cart_id_key => $cart_item){
    246262                if ($cart_item['unique_key'] == $unique_key){
    247                     $woocommerce->add_error( __( 'A sample of the same product is already present into your cart', 'woosample' ) );
     263                    wc_add_notice( __( 'A sample of the same product is already present into your cart', 'woosample' ), 'error' );
    248264                    return false;
    249265                }
    250266                if ($cart_item['product_id'] == $product_id){
    251                     $woocommerce->add_error( __( 'You have already added this product on your cart, you can\'t add a sample of the same item', 'woosample' ) );
     267                    wc_add_notice( __( 'You have already added this product on your cart, you can\'t add a sample of the same item', 'woosample' ), 'error' );
    252268                    return false;
    253269                }
     
    271287            global $post;
    272288            $sample_enable = get_post_meta($post->ID, 'sample_enamble', true) ? get_post_meta($post->ID, 'sample_enamble', true) : false;
     289            if (in_array('woocommerce-chained-products/woocommerce-chained-products.php', apply_filters('active_plugins', get_option('active_plugins')))) {
     290                $has_chained_products = get_post_meta($post->ID, '_chained_product_detail', true );
     291            } else {
     292                $has_chained_products = false;
     293            }
     294            $sample_chained_enambled = get_post_meta($post->ID, 'sample_chained_enambled', true) ? get_post_meta($post->ID, 'sample_chained_enambled', true) : false;
    273295            $sample_shipping_mode = get_post_meta($post->ID, 'sample_shipping_mode', true) ? get_post_meta($post->ID, 'sample_shipping_mode', true) : 'default';
    274296            $sample_shipping = get_post_meta($post->ID, 'sample_shiping', true) ? get_post_meta($post->ID, 'sample_shipping', true) : 0;
     
    281303                    <input type="checkbox" class="checkbox" name="sample_enamble" id="sample_enamble" value="yes" <?php echo $sample_enable ? 'checked="checked"' : ''; ?>> <span class="description"><?php _e('Enable or disable sample option for this item.', 'woosample'); ?></span>
    282304                </p>
     305            <?php if ($has_chained_products) { ?>
     306                <p class="form-field sample_chained_enambled_field ">
     307                    <label for="sample_chained_enambled"><?php _e('Add chained products', 'woosample');?></label>
     308                    <input type="checkbox" class="checkbox" name="sample_chained_enambled" id="sample_chained_enambled" value="yes" <?php echo $sample_chained_enambled ? 'checked="checked"' : ''; ?>> <span class="description"><?php _e('Add or not chained products as sample.', 'woosample'); ?></span>
     309                </p>
     310            <?php } ?>
    283311                <legend><?php _e('Sample Shipping', 'woosample'); ?></legend>
    284312                <div class="options_group">
     
    337365          update_post_meta($post_id, 'sample_enamble', true);
    338366        }
    339        
     367        $sample_chained_enambled = $_POST['sample_chained_enambled'];
     368        if (empty($sample_chained_enambled)) {
     369          delete_post_meta($post_id, 'sample_chained_enambled');
     370        }else{
     371          update_post_meta($post_id, 'sample_chained_enambled', true);
     372        }       
    340373        $sample_price_mode = $_POST['sample_price_mode'];
    341374        update_post_meta($post_id, 'sample_price_mode', $sample_price_mode);
     
    346379        $sample_shipping = $_POST['sample_shipping'];
    347380        update_post_meta($post_id, 'sample_shipping', $sample_shipping);
    348         //$videos = $_POST['_tab_sample'];
    349         //$length = count($videos);
    350         //foreach($videos as $key=>$video){
    351         //  if(!empty($video)) update_post_meta($post_id, 'wo_di_video_product'.$key, stripslashes($video));
    352         //  else delete_post_meta($post_id, 'wo_di_video_product'.$key);
    353         //}
    354        
    355381      }
    356382
Note: See TracChangeset for help on using the changeset viewer.