Changeset 2148723
- Timestamp:
- 08/30/2019 09:40:57 PM (7 years ago)
- Location:
- cart66-cloud/trunk
- Files:
-
- 9 edited
-
cart66-cloud.php (modified) (1 diff)
-
includes/admin/cc-product-meta-box.php (modified) (1 diff)
-
includes/admin/class-cc-admin-media-button.php (modified) (2 diffs)
-
includes/admin/class-cc-admin.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
resources/js/cart66-review.js (modified) (1 diff)
-
views/admin/html-product-meta-box.php (modified) (4 diffs)
-
views/html-editor-pop-up.php (modified) (3 diffs)
-
views/html-review-pop-up.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cart66-cloud/trunk/cart66-cloud.php
r2146461 r2148723 4 4 Plugin URI: http://cart66.com 5 5 Description: Ecommerce Without The Clutter 6 Version: 2.3. 46 Version: 2.3.5 7 7 Author: Reality66 8 8 Author URI: http://www.reality66.com -
cart66-cloud/trunk/includes/admin/cc-product-meta-box.php
r2108304 r2148723 7 7 add_action( 'add_meta_boxes', 'cc_add_product_meta_box' ); 8 8 add_action( 'save_post', 'cc_save_product_meta_box', 10, 2 ); 9 10 $url = cc_url();11 //wp_enqueue_style( 'choices-base', 'https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/base.min.css');12 wp_enqueue_style( 'choices', 'https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css');13 wp_enqueue_script( 'choices', 'https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js');14 9 } 15 10 -
cart66-cloud/trunk/includes/admin/class-cc-admin-media-button.php
r1815908 r2148723 4 4 5 5 public static function add_media_button( $context ) { 6 // CC_Log::write( 'Called add_media_button. Context: ' . print_r( $context, true ) );7 6 8 7 $style = <<<EOL … … 46 45 } 47 46 48 public static function enqueue_select2() {49 $url = cc_url();50 wp_enqueue_style( 'select2', $url .'resources/css/select2.css' );51 wp_enqueue_script( 'select2', $url . 'resources/js/select2.min.js' );52 }53 54 47 } -
cart66-cloud/trunk/includes/admin/class-cc-admin.php
r1815908 r2148723 18 18 // Add the cart66 product insert media button to the editor 19 19 add_action( 'current_screen', array($this, 'add_media_button_to_editor' ) ); 20 21 // Initialize the choices dropdowns 22 add_action( 'current_screen', array( CC_Scripts, 'enqueue_choices' ) ); 20 23 21 24 // Check for cart66 theme support … … 93 96 add_action('media_buttons', array('CC_Admin_Media_Button', 'add_media_button')); 94 97 add_action('admin_footer', array('CC_Admin_Media_Button', 'add_media_button_popup')); 95 add_action('admin_enqueue_scripts', array('CC_Admin_Media_Button', 'enqueue_select2'));96 98 } 97 99 } -
cart66-cloud/trunk/readme.txt
r2146461 r2148723 6 6 Requires PHP: 7.0 7 7 Tested up to: 5.2.2 8 Stable tag: 2.3. 48 Stable tag: 2.3.5 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 139 139 == Changelog == 140 140 141 = 2.3.5 = 142 - Update/Fix: Remove all references to the select2 library, which was causing issues with some themes and plugins. 143 141 144 = 2.3.4 = 142 145 - Fix: Yet another fix related to product post types and their associations with product SKUs in the cloud. If more than 1 product post type was associated with the same product SKU in the cloud, the Refresh Product Info process would only update the first one. This fix makes it so all of them get updated as they should. -
cart66-cloud/trunk/resources/js/cart66-review.js
r1815908 r2148723 1 1 jQuery(document).ready(function($) { 2 3 $('#cc-product-review-form').on('submit', function(e) { 2 $("#cc-product-review-form").on("submit", function(e) { 4 3 e.preventDefault(); 5 $( '#cc-review-processing').show();4 $("#cc-review-processing").show(); 6 5 var data = $(this).serialize(); 7 6 8 7 $.ajax({ 9 type: 'POST',8 type: "POST", 10 9 url: cc_review.ajax_url, 11 10 data: data, 12 dataType: 'html',13 success: function( result) {14 $( '#cc-product-review-failed').hide();15 $( '#cc-product-review-received').show( "slow");16 $( '#cc-review-processing').hide();17 $( '#cc-product-review-form')[0].reset();11 dataType: "html", 12 success: function(result) { 13 $("#cc-product-review-failed").hide(); 14 $("#cc-product-review-received").show("slow"); 15 $("#cc-review-processing").hide(); 16 $("#cc-product-review-form")[0].reset(); 18 17 }, 19 error: function( ) {20 $( '#cc-product-review-failed').show( "slow");21 $( '#cc-review-processing').hide();18 error: function() { 19 $("#cc-product-review-failed").show("slow"); 20 $("#cc-review-processing").hide(); 22 21 } 23 22 }); 24 25 23 }); 26 27 24 }); -
cart66-cloud/trunk/views/admin/html-product-meta-box.php
r2108304 r2148723 10 10 11 11 <style type="text/css"> 12 .c hoices .choices__inner {12 .c66-choices .choices__inner { 13 13 min-height: auto; 14 14 padding-right: 0; … … 16 16 } 17 17 18 .c hoices .choices__list--single {18 .c66-choices .choices__list--single { 19 19 width: 90%; 20 20 } 21 21 22 .c hoices .choices__item--selectable {22 .c66-choices .choices__item--selectable { 23 23 width: 90%; 24 24 } 25 25 26 .c hoices[data-type*=select-one]:after {26 .c66-choices[data-type*=select-one]:after { 27 27 right: 35px; 28 28 } 29 29 30 .c hoices .choices__list--dropdown {30 .c66-choices .choices__list--dropdown { 31 31 width: 93%; 32 32 } … … 34 34 35 35 <div class="cc_meta_box_option"> 36 <select name="_cc_product_sku" id="_cc_product_sku" class="c hoices">36 <select name="_cc_product_sku" id="_cc_product_sku" class="c66-choices"> 37 37 <option placeholder value="">Choose Product</option> 38 38 <?php foreach ($cc_products as $cc_product): ?> … … 60 60 </select> 61 61 </div> 62 63 <script>64 $(document).ready(function() {65 var choices = new Choices($(".choices")[0], {66 });67 });68 </script> -
cart66-cloud/trunk/views/html-editor-pop-up.php
r2113688 r2148723 1 <style type="text/css">2 .select2-drop-mask {3 z-index: 2000001;4 }5 .select2-drop {6 z-index: 2000002;7 }8 </style>9 10 1 <style type="text/css"> 11 2 .choices .choices__inner { … … 68 59 <th scope="row"><label for="cc_product_sku">Products</label></th> 69 60 <td> 70 <select name="cc_product_sku" id="cc_product_sku" class="c hoices">61 <select name="cc_product_sku" id="cc_product_sku" class="c66-choices"> 71 62 <option placeholder value="">Choose Product</option> 72 63 <?php foreach ($cc_products as $cc_product): ?> … … 118 109 </div> 119 110 </div> 120 121 <script>122 $(document).ready(function() {123 var choices = new Choices($(".choices")[0], {124 });125 });126 </script> -
cart66-cloud/trunk/views/html-review-pop-up.php
r1815908 r2148723 1 <style type="text/css">2 .select2-drop-mask {3 z-index: 2000001;4 }5 .select2-drop {6 z-index: 2000002;7 }8 </style>9 10 1 <script type="text/javascript"> 11 2 function cc_insert_review_shortcode(){ 12 var product_ info = JSON.parse(jQuery('#cc_product_id_review').val());3 var product_sku = jQuery('#cc_product_sku_review').val(); 13 4 var display_type = jQuery("#display_type_review").val(); 14 5 15 if(product_ info.length == 0 || product_info == "0" || product_info== ""){6 if(product_sku.length == 0 || product_sku == "0" || product_sku == ""){ 16 7 alert("<?php _e("Please select a product", "cart66") ?>"); 17 8 return; 18 9 } 19 console.log(product_ info);10 console.log(product_sku); 20 11 21 12 if ( display_type == 'display' ) { 22 window.send_to_editor("[cc_product_reviews sku=\"" + product_ info.sku + "\"]");13 window.send_to_editor("[cc_product_reviews sku=\"" + product_sku + "\"]"); 23 14 } 24 15 else { 25 window.send_to_editor("[cc_product_review_form sku=\"" + product_ info.sku + "\"]");16 window.send_to_editor("[cc_product_review_form sku=\"" + product_sku + "\"]"); 26 17 } 27 18 } 19 </script> 28 20 29 jQuery(document).ready(function($) { 30 $('#cc_product_id_review').select2({ 31 width: '100%', 32 minimumInputLength: 2, 33 allowClear: true, 34 ajax: { 35 url: ajaxurl, 36 dataType: 'json', 37 data: function (term, page) { 38 return { 39 action: 'cc_ajax_product_search', 40 search: term 41 }; 42 }, 43 results: function (data, page) { 44 return { results: data }; 45 } 46 } 47 }); 48 }); 49 </script> 21 <?php 22 $cloud_product = new CC_Cloud_Product(); 23 $cc_products = $cloud_product->get_products(); 24 ?> 50 25 51 26 <div id="cc_review_pop_up" style="display:none;"> … … 61 36 <tbody> 62 37 <tr valign="top"> 63 <th scope="row"><label for="cc_product_ id_review">Product</label></th>38 <th scope="row"><label for="cc_product_sku_review">Product</label></th> 64 39 <td> 65 <input type="hidden" name="cc_product_id_review" id="cc_product_id_review" value="" /> 40 <select name="cc_product_sku_review" id="cc_product_sku_review" class="c66-choices"> 41 <option placeholder value="">Choose Product</option> 42 <?php foreach ($cc_products as $cc_product): ?> 43 <option value="<?php echo $cc_product["sku"] ?>"> 44 <?php echo $cc_product["name"] ?> 45 </option> 46 <?php endforeach ?> 47 </select> 66 48 </td> 67 49 </tr>
Note: See TracChangeset
for help on using the changeset viewer.