Changeset 1468617
- Timestamp:
- 08/05/2016 01:13:49 PM (10 years ago)
- Location:
- woocommerce-sample
- Files:
-
- 38 added
- 7 edited
-
assets/screenshot-3.png (modified) (previous)
-
assets/screenshot-4.png (added)
-
tags/0.7.3 (added)
-
tags/0.7.3/LICENSE (added)
-
tags/0.7.3/css (added)
-
tags/0.7.3/css/style-admin.css (added)
-
tags/0.7.3/fonts (added)
-
tags/0.7.3/fonts/isifont.eot (added)
-
tags/0.7.3/fonts/isifont.svg (added)
-
tags/0.7.3/fonts/isifont.ttf (added)
-
tags/0.7.3/fonts/isifont.woff (added)
-
tags/0.7.3/images (added)
-
tags/0.7.3/images/sample-icon.png (added)
-
tags/0.7.3/js (added)
-
tags/0.7.3/js/woocommerce-sample.js (added)
-
tags/0.7.3/languages (added)
-
tags/0.7.3/languages/woosample-it_IT.mo (added)
-
tags/0.7.3/languages/woosample-it_IT.po (added)
-
tags/0.7.3/languages/woosample.pot (added)
-
tags/0.7.3/readme.txt (added)
-
tags/0.7.3/woocommerce-sample.php (added)
-
tags/0.8.0 (added)
-
tags/0.8.0/LICENSE (added)
-
tags/0.8.0/css (added)
-
tags/0.8.0/css/style-admin.css (added)
-
tags/0.8.0/fonts (added)
-
tags/0.8.0/fonts/isifont.eot (added)
-
tags/0.8.0/fonts/isifont.svg (added)
-
tags/0.8.0/fonts/isifont.ttf (added)
-
tags/0.8.0/fonts/isifont.woff (added)
-
tags/0.8.0/images (added)
-
tags/0.8.0/js (added)
-
tags/0.8.0/js/woocommerce-sample.js (added)
-
tags/0.8.0/languages (added)
-
tags/0.8.0/languages/woosample-it_IT.mo (added)
-
tags/0.8.0/languages/woosample-it_IT.po (added)
-
tags/0.8.0/languages/woosample.pot (added)
-
tags/0.8.0/readme.txt (added)
-
tags/0.8.0/woocommerce-sample.php (added)
-
trunk/css/style-admin.css (modified) (1 diff)
-
trunk/languages/woosample-it_IT.mo (modified) (previous)
-
trunk/languages/woosample-it_IT.po (modified) (4 diffs)
-
trunk/languages/woosample.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/woocommerce-sample.php (modified) (10 diffs)
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"; 6 3 } 7 4 -
woocommerce-sample/trunk/languages/woosample-it_IT.po
r886372 r1468617 2 2 msgstr "" 3 3 "Project-Id-Version: WooCommerce Sample\n" 4 "POT-Creation-Date: 201 4-03-02 19:14+0100\n"5 "PO-Revision-Date: 201 4-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" 7 7 "Language-Team: ISIKOM <info@isikom.net>\n" 8 8 "Language: it\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1. 6.4\n"12 "X-Generator: Poedit 1.8.8\n" 13 13 "X-Poedit-Basepath: .\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 16 16 "X-Poedit-SearchPath-0: ..\n" 17 17 18 #: ../woocommerce-sample.php:106 ../woocommerce-sample.php:193 18 #: ../woocommerce-sample.php:189 ../woocommerce-sample.php:196 19 #: ../woocommerce-sample.php:280 19 20 msgid "Sample" 20 21 msgstr "Campione" 21 22 22 #: ../woocommerce-sample.php: 17623 #: ../woocommerce-sample.php:263 23 24 msgid "A sample of the same product is already present into your cart" 24 25 msgstr "Un campione dello stesso prodotto è già presente nel tuo carrello" 25 26 26 #: ../woocommerce-sample.php: 18027 #: ../woocommerce-sample.php:267 27 28 msgid "" 28 29 "You have already added this product on your cart, you can't add a sample of " … … 32 33 "campione dello stesso articolo" 33 34 34 #: ../woocommerce-sample.php: 20935 #: ../woocommerce-sample.php:302 35 36 msgid "Enable sample" 36 37 msgstr "Abilita il Campione" 37 38 38 #: ../woocommerce-sample.php: 21039 #: ../woocommerce-sample.php:303 39 40 msgid "Enable or disable sample option for this item." 40 41 msgstr "Abilita o disabilita le opzioni per il campione per questo articolo" 41 42 42 #: ../woocommerce-sample.php:212 43 #: ../woocommerce-sample.php:307 44 msgid "Add chained products" 45 msgstr "Aggiungi i prodotti concatenati" 46 47 #: ../woocommerce-sample.php:308 48 msgid "Add or not chained products as sample." 49 msgstr "Aggiungi o meno i prodotti concatenati come campione" 50 51 #: ../woocommerce-sample.php:311 43 52 msgid "Sample Shipping" 44 53 msgstr "Trasporto del Campione" 45 54 46 #: ../woocommerce-sample.php: 21555 #: ../woocommerce-sample.php:314 47 56 msgid "use default product shipping methods" 48 57 msgstr "usa il metodo di trasporto impostato per il prodotto" 49 58 50 #: ../woocommerce-sample.php: 21959 #: ../woocommerce-sample.php:318 51 60 msgid "free shipping for sample" 52 61 msgstr "trasporto gratuito per il campione" 53 62 54 #: ../woocommerce-sample.php: 22363 #: ../woocommerce-sample.php:323 55 64 msgid "custom fee shipping" 56 65 msgstr "spese di trasporto personalizzate" 57 66 58 #: ../woocommerce-sample.php: 22567 #: ../woocommerce-sample.php:325 59 68 msgid "set shipping fee" 60 69 msgstr "imposta le spese di trasporto" 61 70 62 #: ../woocommerce-sample.php: 22971 #: ../woocommerce-sample.php:330 63 72 msgid "Sample price" 64 73 msgstr "Prezzo del Campione" 65 74 66 #: ../woocommerce-sample.php: 23275 #: ../woocommerce-sample.php:333 67 76 msgid "product default price" 68 77 msgstr "prezzo impostato nel prodotto" 69 78 70 #: ../woocommerce-sample.php: 23679 #: ../woocommerce-sample.php:337 71 80 msgid "free" 72 81 msgstr "gratuito" 73 82 74 #: ../woocommerce-sample.php: 24083 #: ../woocommerce-sample.php:341 75 84 msgid "custom price" 76 85 msgstr "prezzo personalizzato" 77 86 78 #: ../woocommerce-sample.php: 24287 #: ../woocommerce-sample.php:343 79 88 msgid "set sample price" 80 89 msgstr "imposta il prezzo del campione" 81 90 82 #: ../woocommerce-sample.php: 28491 #: ../woocommerce-sample.php:393 83 92 msgid "Add Sample to cart" 84 93 msgstr "Richiedi un Campione" 85 94 86 #: ../woocommerce-sample.php: 33295 #: ../woocommerce-sample.php:434 87 96 #, php-format 88 97 msgid "" -
woocommerce-sample/trunk/languages/woosample.pot
r886372 r1468617 1 #, fuzzy 1 2 msgid "" 2 3 msgstr "" 3 4 "Project-Id-Version: WooCommerce Sample\n" 4 "POT-Creation-Date: 201 4-03-02 19:13+0100\n"5 "POT-Creation-Date: 2016-08-05 00:16+0200\n" 5 6 "PO-Revision-Date: 2014-03-02 19:14+0100\n" 6 7 "Last-Translator: Michele Menciassi <m.menciassi@gmail.com>\n" … … 10 11 "Content-Type: text/plain; charset=UTF-8\n" 11 12 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1. 6.4\n"13 "X-Generator: Poedit 1.8.8\n" 13 14 "X-Poedit-Basepath: .\n" 14 15 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 16 17 "X-Poedit-SearchPath-0: ..\n" 17 18 18 #: ../woocommerce-sample.php:106 ../woocommerce-sample.php:193 19 #: ../woocommerce-sample.php:189 ../woocommerce-sample.php:196 20 #: ../woocommerce-sample.php:280 19 21 msgid "Sample" 20 22 msgstr "" 21 23 22 #: ../woocommerce-sample.php: 17624 #: ../woocommerce-sample.php:263 23 25 msgid "A sample of the same product is already present into your cart" 24 26 msgstr "" 25 27 26 #: ../woocommerce-sample.php: 18028 #: ../woocommerce-sample.php:267 27 29 msgid "" 28 30 "You have already added this product on your cart, you can't add a sample of " … … 30 32 msgstr "" 31 33 32 #: ../woocommerce-sample.php: 20934 #: ../woocommerce-sample.php:302 33 35 msgid "Enable sample" 34 36 msgstr "" 35 37 36 #: ../woocommerce-sample.php: 21038 #: ../woocommerce-sample.php:303 37 39 msgid "Enable or disable sample option for this item." 38 40 msgstr "" 39 41 40 #: ../woocommerce-sample.php:212 42 #: ../woocommerce-sample.php:307 43 msgid "Add chained products" 44 msgstr "" 45 46 #: ../woocommerce-sample.php:308 47 msgid "Add or not chained products as sample." 48 msgstr "" 49 50 #: ../woocommerce-sample.php:311 41 51 msgid "Sample Shipping" 42 52 msgstr "" 43 53 44 #: ../woocommerce-sample.php: 21554 #: ../woocommerce-sample.php:314 45 55 msgid "use default product shipping methods" 46 56 msgstr "" 47 57 48 #: ../woocommerce-sample.php: 21958 #: ../woocommerce-sample.php:318 49 59 msgid "free shipping for sample" 50 60 msgstr "" 51 61 52 #: ../woocommerce-sample.php: 22362 #: ../woocommerce-sample.php:323 53 63 msgid "custom fee shipping" 54 64 msgstr "" 55 65 56 #: ../woocommerce-sample.php: 22566 #: ../woocommerce-sample.php:325 57 67 msgid "set shipping fee" 58 68 msgstr "" 59 69 60 #: ../woocommerce-sample.php: 22970 #: ../woocommerce-sample.php:330 61 71 msgid "Sample price" 62 72 msgstr "" 63 73 64 #: ../woocommerce-sample.php: 23274 #: ../woocommerce-sample.php:333 65 75 msgid "product default price" 66 76 msgstr "" 67 77 68 #: ../woocommerce-sample.php: 23678 #: ../woocommerce-sample.php:337 69 79 msgid "free" 70 80 msgstr "" 71 81 72 #: ../woocommerce-sample.php: 24082 #: ../woocommerce-sample.php:341 73 83 msgid "custom price" 74 84 msgstr "" 75 85 76 #: ../woocommerce-sample.php: 24286 #: ../woocommerce-sample.php:343 77 87 msgid "set sample price" 78 88 msgstr "" 79 89 80 #: ../woocommerce-sample.php: 28490 #: ../woocommerce-sample.php:393 81 91 msgid "Add Sample to cart" 82 92 msgstr "" 83 93 84 #: ../woocommerce-sample.php: 33294 #: ../woocommerce-sample.php:434 85 95 #, php-format 86 96 msgid "" -
woocommerce-sample/trunk/readme.txt
r930949 r1468617 3 3 Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, woocommerce, sample, free sample 4 4 Requires at least: 3.5 5 Tested up to: 3.9.16 Stable tag: 0. 7.35 Tested up to: 4.6 6 Stable tag: 0.8.0 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 16 16 Compatibility with plugins: 17 17 18 * WooCommerce Chained Products 18 19 * Min/Max Quantities 19 20 * Measurement Price Calculator … … 24 25 25 26 == Installation == 26 27 = Minimum Requirements =28 29 * WordPress 3.5 or greater30 * PHP version 5.2.4 or greater31 * MySQL version 5.0 or greater32 * WooCommerce 2.0.20 or greater33 27 34 28 = Automatic installation = … … 50 44 = Free shipping doesn't work = 51 45 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) 46 The "free shipping" option on Sample back end panel need that "free shipping" methods is enabled for your on your WooCommerce installation. 47 You could enable it on WooCommerce -> Settings -> Shipping -> Shipping Zone -> Free Shipping. 48 Make it enabled and set it available for coupon. 49 (as you can see on screenshot tab) 54 50 55 51 == Screenshots == … … 58 54 2. Back end - Sample setting on product page 59 55 3. remember to enable WooCommerce Free Shipping to use it on WooCommerce Sample Plugins 56 4. remember to set Free Shipping available for coupon 60 57 61 58 == 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 62 65 63 66 = 0.7.12 - 12/06/2014 = -
woocommerce-sample/trunk/woocommerce-sample.php
r930949 r1468617 6 6 * Author: Michele Menciassi 7 7 * Author URI: https://plus.google.com/+MicheleMenciassi 8 * Version: 0. 7.38 * Version: 0.8.0 9 9 * License: GPLv2 or later 10 10 */ … … 45 45 add_filter('woocommerce_get_item_data', array( $this, 'get_item_data' ), 10, 2 ); 46 46 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); 48 48 add_filter('woocommerce_cart_widget_product_title', array( $this, 'cart_widget_product_title'), 10, 2); 49 49 add_filter('woocommerce_cart_item_quantity', array( $this, 'cart_item_quantity'), 10, 2); 50 50 51 51 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 } 54 58 add_action('woocommerce_add_order_item_meta', array($this, 'add_order_item_meta'), 10, 2); 55 59 … … 66 70 } 67 71 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 } 68 94 } 69 95 … … 137 163 function free_shipping_filter( $available_methods ) 138 164 { 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 } 151 172 return $available_methods; 152 173 } … … 199 220 function get_item_data($item_data, $cart_item){ 200 221 global $cart_item_key; 201 //if ($cart_item['sample']){202 // error_log('SAMPLE TRUE');203 //}else{204 // error_log('SAMPLE FALSE');205 //}206 222 return $item_data; 207 223 } … … 245 261 foreach ($cart_items as $cart_id_key => $cart_item){ 246 262 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' ); 248 264 return false; 249 265 } 250 266 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' ); 252 268 return false; 253 269 } … … 271 287 global $post; 272 288 $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; 273 295 $sample_shipping_mode = get_post_meta($post->ID, 'sample_shipping_mode', true) ? get_post_meta($post->ID, 'sample_shipping_mode', true) : 'default'; 274 296 $sample_shipping = get_post_meta($post->ID, 'sample_shiping', true) ? get_post_meta($post->ID, 'sample_shipping', true) : 0; … … 281 303 <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> 282 304 </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 } ?> 283 311 <legend><?php _e('Sample Shipping', 'woosample'); ?></legend> 284 312 <div class="options_group"> … … 337 365 update_post_meta($post_id, 'sample_enamble', true); 338 366 } 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 } 340 373 $sample_price_mode = $_POST['sample_price_mode']; 341 374 update_post_meta($post_id, 'sample_price_mode', $sample_price_mode); … … 346 379 $sample_shipping = $_POST['sample_shipping']; 347 380 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 355 381 } 356 382
Note: See TracChangeset
for help on using the changeset viewer.