Changeset 930949
- Timestamp:
- 06/12/2014 08:59:24 AM (12 years ago)
- Location:
- woocommerce-sample
- Files:
-
- 19 added
- 3 edited
-
tags/0.7.2 (added)
-
tags/0.7.2/LICENSE (added)
-
tags/0.7.2/css (added)
-
tags/0.7.2/css/style-admin.css (added)
-
tags/0.7.2/fonts (added)
-
tags/0.7.2/fonts/isifont.eot (added)
-
tags/0.7.2/fonts/isifont.svg (added)
-
tags/0.7.2/fonts/isifont.ttf (added)
-
tags/0.7.2/fonts/isifont.woff (added)
-
tags/0.7.2/images (added)
-
tags/0.7.2/images/sample-icon.png (added)
-
tags/0.7.2/js (added)
-
tags/0.7.2/js/woocommerce-sample.js (added)
-
tags/0.7.2/languages (added)
-
tags/0.7.2/languages/woosample-it_IT.mo (added)
-
tags/0.7.2/languages/woosample-it_IT.po (added)
-
tags/0.7.2/languages/woosample.pot (added)
-
tags/0.7.2/readme.txt (added)
-
tags/0.7.2/woocommerce-sample.php (added)
-
trunk/js/woocommerce-sample.js (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/woocommerce-sample.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-sample/trunk/js/woocommerce-sample.js
r886372 r930949 30 30 } 31 31 return true; 32 //alert("come la mettiamo?"); 33 //return false; 32 34 }); 33 35 }); -
woocommerce-sample/trunk/readme.txt
r930112 r930949 4 4 Requires at least: 3.5 5 5 Tested up to: 3.9.1 6 Stable tag: 0.7. 26 Stable tag: 0.7.3 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 Plugin for Wordpress woocommerce that allow add to cart sample item of a certain products 15 16 Compatibility with plugins: 17 18 * Min/Max Quantities 19 * Measurement Price Calculator 15 20 16 21 = GET INVOLVED = … … 56 61 == Changelog == 57 62 63 = 0.7.12 - 12/06/2014 = 64 * added button CSS filter to add custom style 65 * fix button for products with a variation 66 * added filter for Measurement Price Calculator plugin 67 58 68 = 0.7.2 - 11/06/2014 = 59 69 * added meta info to the sample item ordered -
woocommerce-sample/trunk/woocommerce-sample.php
r930112 r930949 6 6 * Author: Michele Menciassi 7 7 * Author URI: https://plus.google.com/+MicheleMenciassi 8 * Version: 0.7. 28 * Version: 0.7.3 9 9 * License: GPLv2 or later 10 10 */ … … 60 60 add_filter('wc_min_max_quantity_group_of_quantity', array($this, 'group_of_quantity'), 10, 4 ); 61 61 } 62 63 // filter for Measurement Price Calculator plugin override overriding 64 if (in_array('woocommerce-measurement-price-calculator/woocommerce-measurement-price-calculator.php', apply_filters('active_plugins', get_option('active_plugins')))) { 65 add_filter('wc_measurement_price_calculator_add_to_cart_validation', array($this, 'measurement_price_calculator_add_to_cart_validation'), 10, 4 ); 66 } 67 68 } 69 70 function measurement_price_calculator_add_to_cart_validation ($valid, $product_id, $quantity, $measurements){ 71 global $woocommerce; 72 $validation = $valid; 73 if (get_post_meta($product_id, 'sample_enamble') && $_REQUEST['sample']){ 74 $woocommerce->session->set( 'wc_notices', null ); 75 $validation = true; 76 } 77 return $validation; 62 78 } 63 79 … … 347 363 <form action="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="cart sample" method="post" enctype='multipart/form-data'> 348 364 <?php do_action('woocommerce_before_add_sample_to_cart_button'); ?> 349 <div class="single_variation_wrap" style=""> 350 <button type="submit" class="single_add_to_cart_button button alt single_add_sample_to_cart_button"><?php echo __( 'Add Sample to cart', 'woosample' ); ?></button> 365 <div class="single_variation_wrap" style=""> 366 <?php $btnclass = apply_filters('sample_button_class', "single_add_to_cart_button button alt single_add_sample_to_cart_button btn btn-default"); ?> 367 <button type="submit" class="<?php echo $btnclass; ?>"><?php echo __( 'Add Sample to cart', 'woosample' ); ?></button> 351 368 <input type="hidden" name="sample" id="sample" value="true"/> 369 <input type="hidden" name="add-to-cart" id="sample_add_to_cart" value="<?php echo $product->id; ?>"> 352 370 </div> 353 371 <?php do_action('woocommerce_after_add_sample_to_cart_button'); ?>
Note: See TracChangeset
for help on using the changeset viewer.