Changeset 2298752
- Timestamp:
- 05/05/2020 07:03:53 PM (6 years ago)
- Location:
- autoship-cloud/trunk
- Files:
-
- 4 edited
-
autoship.php (modified) (2 diffs)
-
js/schedule-options.js (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
src/products.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
autoship-cloud/trunk/autoship.php
r2298734 r2298752 4 4 Plugin URI: https://autoship.cloud 5 5 Description: Autoship Cloud for WooCommerce 6 Version: 2.0. 56 Version: 2.0.6 7 7 Author: Patterns In the Cloud LLC 8 8 Author URI: https://qpilot.cloud … … 14 14 */ 15 15 16 define( 'Autoship_Version', '2.0. 5' );16 define( 'Autoship_Version', '2.0.6' ); 17 17 if ( ! defined( 'Autoship_Plugin_Dir' ) ) { 18 18 define( 'Autoship_Plugin_Dir', __DIR__ ); -
autoship-cloud/trunk/js/schedule-options.js
r2298734 r2298752 157 157 */ 158 158 159 // Toggle Price 160 var togglePriceDisplay = function( $thisProduct, resetPrice ){ 161 162 var priceInfo = priceData[ retrieveProductId( $thisProduct ) ]; 163 164 if ( priceInfo != undefined ) 165 displayCustomPrice( $thisProduct, priceInfo.customized_price_enabled && !resetPrice ? priceInfo.autoship_price : priceInfo.original_price, priceInfo.original_price_selector ); 166 167 } 168 159 169 // Displays the Custom Autoship Price HTML 160 170 var displayCustomPrice = function ( $thisProduct, $priceHTML, $containerSelector ){ … … 170 180 var selectDisplay = function( $thisProduct, $autoshipOptions ){ 171 181 172 if ( !selectFrequency( $thisProduct, $autoshipOptions ) ) 173 return; 174 182 if ( selectFrequency( $thisProduct, $autoshipOptions ) ) 175 183 $autoshipOptions.find(window.autoshipTemplateData.frequencyCls).addClass('active'); 176 177 var priceInfo = priceData[ retrieveProductId( $thisProduct ) ];178 179 if ( priceInfo != undefined && priceInfo.customized_price_enabled )180 displayCustomPrice( $thisProduct, priceInfo.autoship_price, priceInfo.original_price_selector );181 184 182 185 }; … … 205 208 $autoshipOptions.find(window.autoshipTemplateData.frequencyCls).removeClass('active'); 206 209 207 var priceInfo = priceData[ retrieveProductId( $thisProduct ) ];208 209 if ( priceInfo != undefined && priceInfo.customized_price_enabled )210 displayCustomPrice( $thisProduct, priceInfo.original_price, priceInfo.original_price_selector );211 212 210 }; 213 211 … … 270 268 271 269 var $autoshipOptions = $( variationForm ).find(window.autoshipTemplateData.optionsCls); 272 var $percentDiscount = $autoshipOptions.find(window.autoshipTemplateData.discountPriceCls);273 var $discountedPrice = $autoshipOptions.find(window.autoshipTemplateData.checkoutPriceCls);274 270 var autoshipDataValues = autoshipData( variationId, variationForm ); 275 271 276 272 if ( autoshipDataValues ){ 273 277 274 initAutoshipData( variationForm, autoshipDataValues ); 278 275 setVariationId( variationForm, variationId ); 276 277 // Retrigger the click on the yes to refresh html prices etc. 278 var $autoshipYesRadio = $autoshipOptions.find( window.autoshipTemplateData.yesBtn ); 279 if ( $autoshipYesRadio.is(':checked') ) 280 $autoshipYesRadio.trigger('click'); 281 279 282 } else { 280 283 setVariationId( variationForm, 0 ); … … 326 329 var $thisProduct = findProduct( e.target ); 327 330 var $autoshipOptions = $thisProduct.find(window.autoshipTemplateData.optionsCls); 328 selectDisplay( $thisProduct, $autoshipOptions ); }); 331 selectDisplay( $thisProduct, $autoshipOptions ); 332 togglePriceDisplay( $thisProduct, false );}); 329 333 $autoshipOptions.find(window.autoshipTemplateData.noBtn).on( 'click' , function(e){ 330 334 var $thisProduct = findProduct( e.target ); 331 335 var $autoshipOptions = $thisProduct.find(window.autoshipTemplateData.optionsCls); 332 selectHide( $thisProduct, $autoshipOptions ); }); 336 selectHide( $thisProduct, $autoshipOptions ); 337 togglePriceDisplay( $thisProduct, true ); }); 333 338 334 339 $('body').on( 'reset_data', window.autoshipTemplateData.variationFormCls, function( e ){ … … 407 412 408 413 // Toggle the labels 409 toggleAutoshipLabels( $autoshipOptions, autoshipData. percent_discount !== 0 || autoshipData.recurring_percent_discount !== 0);414 toggleAutoshipLabels( $autoshipOptions, autoshipData.show_discount_str ); 410 415 411 416 $autoshipOptions.removeClass('hidden').removeClass('loading'); … … 443 448 $autoshipYesRadio.trigger('click'); 444 449 445 $( $thisProduct ).trigger( "autoship_product_initialized", [ $thisProduct, $autoshipOptions, priceData, $autoshipNoRadio, $addToCartBtn ] );446 447 450 }) 448 451 -
autoship-cloud/trunk/readme.txt
r2298734 r2298752 8 8 WC tested up to: 4.0.1 9 9 Requires PHP: 5.6 10 Stable tag: 2.0. 510 Stable tag: 2.0.6 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 153 153 154 154 == Changelog == 155 156 = 2.0.6 - 2020-05-05 = 157 158 * Fixed: Updated to include the latest schedule-options.js file for the new Multi-Product page template support. 155 159 156 160 = 2.0.5 - 2020-05-05 = -
autoship-cloud/trunk/src/products.php
r2298734 r2298752 1010 1010 // The Percent Discount for Recurring Orders 1011 1011 'recurring_percent_discount' => $recurring_percent_discount, 1012 1013 // Toggles the Discount String on the Product Pages 1014 'show_discount_str' => $percent_discount || $recurring_percent_discount, 1012 1015 1013 1016 // If Add to Scheduled Order is endabled for the product
Note: See TracChangeset
for help on using the changeset viewer.