Changeset 3286821
- Timestamp:
- 05/03/2025 02:58:39 PM (11 months ago)
- Location:
- smm-api/trunk
- Files:
-
- 8 edited
-
assets/css/frontend.css (modified) (2 diffs)
-
assets/css/select.dataTables.css (modified) (1 diff)
-
includes/class.smms-wc-api.php (modified) (2 diffs)
-
includes/class.smms-wc-subscription-admin.php (modified) (29 diffs)
-
includes/class.smms-wc-subscription-cart.php (modified) (3 diffs)
-
includes/class.smms-wc-subscription-order.php (modified) (5 diffs)
-
plugin-fw/lib/smm-plugin-panel-wc.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smm-api/trunk/assets/css/frontend.css
r3285661 r3286821 202 202 .smm_form__field { 203 203 font-family: inherit; 204 width: 90%;204 width: 60%; 205 205 border: 1px solid #c1baba; 206 207 206 border-bottom: 1px solid #d4cece; 208 207 outline: 0; 209 208 font-size: 0.9rem; 210 color: transparent;211 padding: 1px 0;212 background: #fbf8f800;209 color: #000; /* Make text visible */ 210 padding: 8px 10px; 211 background: transparent; 213 212 transition: border-color 0.2s; 214 215 &::placeholder { 216 color: transparent; 217 } 218 219 &:placeholder-shown.smm_form__label { 220 font-size: .9rem; 221 cursor: text; 222 position:relative; 223 top: -4px; 224 left: 10px; 225 color: transparent; 226 } 227 } 228 213 } 214 215 .smm_form__field::placeholder { 216 color: transparent !important; /* Hide placeholder */ 217 } 218 219 /* Label (initial state) */ 229 220 .smm_form__label { 230 221 position: absolute; 231 z-index: -1;232 222 top: 22px; 233 display: block; 234 transition: 0.2s; 223 left: 10px; 235 224 font-size: 0.9rem; 236 225 color: rgb(102, 0, 255); 237 } 238 226 transition: 0.2s; 227 pointer-events: none; 228 } 229 230 /* Label when input is focused or has value */ 231 .smm_form__field:focus + .smm_form__label, 232 .smm_form__field:not(:placeholder-shown) + .smm_form__label { 233 top: -10px; 234 font-size: 0.75rem; 235 color: #11998e; 236 } 237 238 /* Add some visual feedback */ 239 239 .smm_form__field:focus { 240 ~.smm_form__label {241 position: absolute;242 top: -9px;243 display: block;244 transition: 0.2s;245 font-size: 0.9rem;246 color: #11998e;247 248 }249 250 padding-bottom: 1px;251 font-weight:1000;252 240 border-width: 1px; 253 241 border-image: linear-gradient(to right, #11998e, #38ef7d); … … 255 243 } 256 244 257 /* reset input */ 258 .smm_form__field { 259 260 &:required, 261 &:invalid { 262 box-shadow: none; 263 } 264 } 245 /* Reset input shadows */ 246 .smm_form__field:required:invalid { 247 box-shadow: none; 248 } 249 265 250 .smm-custom-input{ 266 251 font-size: 0.5em; -
smm-api/trunk/assets/css/select.dataTables.css
r3285661 r3286821 104 104 } 105 105 } 106 .tgle-flip input[type=checkbox]{ 107 opacity:0; 108 109 } 110 .tgl { 111 display: none; 112 } 113 .tgl, .tgl:after, .tgl:before, .tgl *, .tgl *:after, .tgl *:before, .tgl + .tgl-btn { 114 box-sizing: border-box; 115 } 116 .tgl::-moz-selection, .tgl:after::-moz-selection, .tgl:before::-moz-selection, .tgl *::-moz-selection, .tgl *:after::-moz-selection, .tgl *:before::-moz-selection, .tgl + .tgl-btn::-moz-selection { 117 background: none; 118 } 119 .tgl::selection, .tgl:after::selection, .tgl:before::selection, .tgl *::selection, .tgl *:after::selection, .tgl *:before::selection, .tgl + .tgl-btn::selection { 120 background: none; 121 display: flex; 106 .tgle-flip input[type=checkbox] { 107 opacity: 0; 108 position: absolute; 122 109 } 123 110 111 .tgl-flip + .tgl-btn { 112 position: relative; 113 display: inline-block; 114 width: 60px; 115 height: 24px; 116 padding: 2px; 117 font-family: sans-serif; 118 perspective: 1000px; 119 cursor: pointer; 120 } 124 121 125 .tgl-flip + .tgl-btn { 126 padding: 2px; 127 transition: all 0.2s ease; 128 font-family: sans-serif; 129 perspective: 100px; 122 .tgl-flip + .tgl-btn:before, 123 .tgl-flip + .tgl-btn:after { 124 content: attr(data-tg-off); 125 display: block; 126 width: 100%; 127 height: 100%; 128 line-height: 20px; 129 text-align: center; 130 color: #fff; 131 font-size: 10px; 132 border-radius: 4px; 133 background: #FF3A19; 134 transition: transform 0.4s, background 0.4s; 135 transform-style: preserve-3d; 136 position: absolute; 137 top: 0; 138 left: 0; 139 backface-visibility: hidden; 130 140 } 131 .tgl-flip + .tgl-btn:after, .tgl-flip + .tgl-btn:before { 132 display: inline-block; 133 transition: all 0.4s ease; 134 width: 30px; 135 height:20px; 136 text-align: center; 137 position: relative; 138 line-height: .8em; 139 font-size: 8px; 140 color: #fff; 141 padding-top: 3px; 142 top: -1px; 143 left: -35px; 144 -webkit-backface-visibility: hidden; 145 backface-visibility: hidden; 146 border-radius: 4px; 147 } 141 148 142 .tgl-flip + .tgl-btn:after { 149 143 content: attr(data-tg-on); 150 144 background: #02C66F; 151 transform: rotateY( -180deg);145 transform: rotateY(180deg); 152 146 } 153 .tgl-flip + .tgl-btn:before { 154 background: #FF3A19; 155 content: attr(data-tg-off); 156 } 157 .tgl-flip + .tgl-btn:active:before { 158 transform: rotateY(-20deg); 159 } 147 148 /* Flip animation when checked */ 160 149 .tgl-flip:checked + .tgl-btn:before { 161 150 transform: rotateY(180deg); 162 151 } 152 163 153 .tgl-flip:checked + .tgl-btn:after { 164 transform: rotateY(0); 165 left: -66px; 166 top: -1px; 167 background: #7FC6A6; 154 transform: rotateY(0deg); 168 155 } 169 .tgl-flip:checked + .tgl-btn:active:after {170 transform: rotateY(20deg);171 } -
smm-api/trunk/includes/class.smms-wc-api.php
r3285663 r3286821 101 101 $this->api_server_url = $api_baseurl; 102 102 // Get matching keys array_intersect_key($array2, $array1) 103 if (!empty($product_attributes)) 103 104 $matching_keys = array_intersect_key($product_attributes, $params); 104 105 // Set values from array2 into array1 where keys match 105 foreach ($matching_keys as $key => $value) { 106 if (!empty($matching_keys)) 107 foreach ($matching_keys as $key => $value) 106 108 $params[$key] = $value; 107 }// for extracting data from link url for keywords109 // for extracting data from link url for keywords 108 110 109 111 $parts_of_link = explode('?', $link) ?? null; … … 114 116 // Parse into an array 115 117 $link_params = array(); 118 if (!empty($url_link_params)) 116 119 parse_str($url_link_params, $link_params);// converting to arrays 117 // Get matching keys array_intersect_key($array2, $array1) 120 // Get matching keys array_intersect_key($array2, $array1 121 if (!empty($link_params)) 118 122 $matching_keys = array_intersect_key($link_params, $params); 119 123 // Set values from array2 into array1 where keys match 120 foreach ($matching_keys as $key => $value) { 124 if (!empty($matching_keys)) 125 foreach ($matching_keys as $key => $value) 121 126 $params[$key] = $value; 122 }127 123 128 } 124 129 //file_put_contents(plugin_dir_path( __FILE__ )."check.php", serialize($params) ); -
smm-api/trunk/includes/class.smms-wc-subscription-admin.php
r3285663 r3286821 81 81 add_filter( 'plugin_action_links_' . plugin_basename( SMMS_SMAPI_DIR . '/' . basename( SMMS_SMAPI_FILE ) ), array( $this, 'action_links' ) ); 82 82 add_filter( 'smms_show_plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 5 ); 83 84 83 //custom styles and javascripts 85 84 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ), 11); 86 87 85 //product editor 88 86 add_filter( 'product_type_options', array( $this, 'add_type_options' ) ); 89 90 //add_action('wp_ajax_server_product_list',array($this, 'smm_ajax_action_function_product_select_list'));91 92 93 94 87 //custom fields for single product 95 88 add_action( 'woocommerce_product_options_general_product_data', array( $this, 'add_custom_fields_for_api_products' ) ); … … 102 95 add_filter('smm_pull_order_status', array( $this, 'smm_pull_order_status_ar' ), 10, 3); 103 96 add_filter('smm_url_check_status', array( $this, 'smm_url_check_status_ar' ), 10, 1); 104 //calling woocomerce variation html-variation-admin.php105 //add_action( 'woocommerce_variation_options_pricing',array( $this, 'smm_add_custom_field_to_variations'), 10, 3 );106 //add_action( 'woocommerce_save_product_variation',array( $this, 'smm_save_custom_field_variations'), 10, 2 );107 //this is not required for variation data in not called from variation.php108 //add_filter( 'woocommerce_available_variation',array( $this, 'smm_add_custom_field_variation_data') );109 110 // calling woocomerce variation html-variation-admin.php111 //add_action('wp_ajax_woocommerce_load_variations',array( $this,'smm_woocommerce_variation_option_name_load'),1);112 //add_action('wp_ajax_woocommerce_add_variation',array( $this,'smm_woocommerce_variation_option_name_add'),1);113 114 //add_action('wp_ajax_woocommerce_save_variations',array( $this,'smm_woocommerce_variation_option_name_save'),1);115 116 // Added without calling woocomerce variation html-variation-admin.php117 97 add_action( 'woocommerce_variation_options', array( $this,'smm_add_variation_option'), 10, 3 ); 118 98 add_action( 'woocommerce_product_after_variable_attributes', array( $this,'smm_variation_settings_fields'), 10, 3 ); … … 123 103 124 104 // Call to Ajax Fuctions to fill Form Fields for API ITEM and API SERVER 125 SMMS_Ajax_Call_Admin(); 126 127 128 105 SMMS_Ajax_Call_Admin(); 129 106 } 130 107 131 108 public function smm_status_manual($order_id, $items) 132 { 133 134 109 { 135 110 $order = wc_get_order( $order_id ); 136 111 137 if( 'wc-manual'== $_POST['order_status']) { 138 //$order->update_status( 'wc-on-hold' ); 139 112 if( 'wc-manual'== $_POST['order_status']) { 140 113 SMAPI_Subscription_Order()->smm_api_order_trigger($order_id); 141 } 142 // $this->smm_api_order_trigger($order_id); 143 144 145 } 146 114 } 115 } 147 116 // Add custom status to order status list 148 117 public function add_manual_to_order_statuses( $order_statuses ) { … … 169 138 */ 170 139 public function smm_add_variation_option( $loop, $variation_data, $variation ) { 140 if ( ! is_object( $variation ) || ! isset( $variation->ID ) ) return; 171 141 $_smapi_api_check = 172 142 get_post_meta( $variation->ID, 'variable_smm_api', true ); … … 184 154 185 155 } 186 printf(' 187 <label><input 188 type="checkbox" 189 id="smm_variable_smm_api_%s" 190 class="checkbox variable_smm_api" 191 name="variable_smm_api[%s]" 192 value="on"' ,esc_attr( $loop ),esc_attr( $loop )); 193 checked( 'on', esc_attr( $_smapi_api_check ), true ); 194 echo '/>'; 195 echo 'SMM API'; 196 197 /* translators: Help tip to explain why and when you should check the 'SMM API' type of product in WooCommerce */ 198 esc_html_e( 'Enable this option if the product is a smm-api', 'smm-api' ); 199 200 echo '</label>'; 201 156 $checked = $_smapi_api_check; 157 printf(' 158 <label class="tips" data-tip="%1$s"> 159 <input type="checkbox" class="checkbox" 160 name="variable_smm_api[%2$s]" 161 id="smm_variable_smm_api_%3$s" 162 %4$s /> SMM API 163 </label>', 164 esc_attr__( 'Enable this option if the product uses the SMM API.', 'smm-api' ), 165 esc_attr( $loop ), 166 esc_attr( $loop ), 167 checked( $checked, 'on', false ) // false so it returns instead of echoing 168 ); 202 169 } 203 170 // Make product virtual if selected smmapi check box … … 213 180 //$arr['downloadable']['default'] = "yes"; 214 181 return $arr; 215 } 216 217 /** 218 * Create new fields for variations 219 * 220 */ 182 }/*** Create new fields for variations **/ 221 183 public function smm_variation_settings_fields( $loop, $variation_data, $variation ) { 222 184 … … 234 196 $api_server_list_options_saved = get_post_meta( $variation->ID, 'var_smapi_server_name_option', true ) != "" ? 235 197 get_post_meta( $variation->ID, 'var_smapi_server_name_option', true ) : 236 get_post_meta( ($variation->ID - 1), 'var_smapi_server_name_option', true ); 237 238 239 //Geting Server details for SMM API servers 240 198 get_post_meta( ($variation->ID - 1), 'var_smapi_server_name_option', true ); 199 //Geting Server details for SMM API servers 241 200 $my_smm_result = $wpdb->get_results( $wpdb->prepare( "SELECT smapi_p.post_title, smapi_p.ID FROM $wpdb->posts as smapi_p INNER JOIN " . $wpdb->prefix . "postmeta as smapi_pm ON ( smapi_p.ID = smapi_pm.post_id ) 242 201 WHERE 1=1 … … 251 210 $product_id = wp_get_post_parent_id($variation->ID); 252 211 $product = wc_get_product( $product_id ); 253 $_smapi_server_name_option_simple =212 $_smapi_server_name_option_simple = 254 213 smm_get_prop( $product, '_smapi_server_name_option' ); 255 $api_item_list_options_saved_simple =214 $api_item_list_options_saved_simple = 256 215 smm_get_prop( $product, '_smapi_service_id_option' ); 257 $input_text_box_radio_saved_simple = smm_get_prop( $product, 'locate_input_box' ); 258 $smm_custom_text_field_title_simple = smm_get_prop( $product, 'smm_custom_text_field_title' ); 259 $api_server_list_options_saved = 260 $_smapi_server_name_option_simple; 261 216 $input_text_box_radio_saved_simple = smm_get_prop( $product, 'locate_input_box' ); 217 $smm_custom_text_field_title_simple = smm_get_prop( $product, 'smm_custom_text_field_title' ); 218 $api_server_list_options_saved = $_smapi_server_name_option_simple; 262 219 } 263 220 // for new product only … … 265 222 //For setting first item in list from forloop 266 223 foreach($my_smm_result as $sub_result) 267 $api_server_list_options_saved = $sub_result['ID']; 268 269 //file_put_contents(plugin_dir_path( __FILE__ )."check.txt",$api_server_list_options_saved); 270 271 272 224 $api_server_list_options_saved = $sub_result['ID']; 225 //file_put_contents(plugin_dir_path( __FILE__ )."check.txt",$api_server_list_options_saved); 273 226 $smm_api_items_listing = $wpdb->get_results( $wpdb->prepare( "SELECT smapi_pm.* FROM " .$wpdb->prefix ."postmeta as smapi_pm INNER JOIN $wpdb->posts as smapi_p ON ( smapi_pm.post_id = %s ) 274 227 WHERE 1=1 … … 335 288 336 289 ) ); 337 338 339 340 341 290 woocommerce_wp_select( array( // Text Field type 342 291 'id' => 'var_smapi_server_name_option_'.esc_attr( $loop ), … … 349 298 'options' => $api_server_list_options_output, 350 299 'value' => $input_checkbox_default_server, 351 ) ); 352 353 300 ) ); 354 301 echo '<div><span id="var_smapi_service_span_option_'. esc_attr( $loop ).'" style="float:left;display:block;"> 355 302 '.esc_html($descrption_opted_data).' 356 </div><div>. ).Quantity depends on MIN MAX </div></span> '; 357 358 echo '</div>'; 303 </div><div>. ).Quantity depends on MIN MAX </div></span></div> '; 359 304 // Text Field 360 305 $var_customer_input_field_label = get_post_meta( $variation->ID, 'var_smm_customer_input_field_label', true ) != "" ? … … 365 310 $smm_custom_text_field_title_simple; 366 311 woocommerce_wp_text_input( array( 367 'id' => 'var_smm_customer_input_field_label', 368 312 'id' => 'var_smm_customer_input_field_label', 369 313 'class' => 'short', 370 314 'style' => 'font-size: large;', … … 583 527 //service id = filter_var($sub_item_result['meta_key'], FILTER_SANITIZE_NUMBER_INT) 584 528 . '</option>'; 585 } 586 587 echo '<div class="options_group show_if_simple">'; 588 589 529 } 530 echo '<div class="options_group show_if_simple">'; 590 531 ?> 591 532 <h3 class="smapi_server_name" id="<?php echo esc_attr($thepostid)?>"><?php echo esc_html('SMM API Settings'); ?></h3> 592 <div class="options_group show_if_simple show_if_api"> 593 533 <div class="options_group show_if_simple show_if_api"> 594 534 <p class="form-field smapi_server_name"> 595 <label for="_smapi_server_name"><?php echo esc_html( 'SERVER NAME' ); ?></label> 596 535 <label for="_smapi_server_name"><?php echo esc_html( 'SERVER NAME' ); ?></label> 597 536 <select id="_smapi_server_name_option" name="_smapi_server_name_option" class="select" style="margin-left: 3px;"> 598 537 <?php 599 538 $allowed_html = array( 539 'option' => array( 540 'value' => array(), 541 'selected' => array(), 542 'data-desc' => array() 543 ), 544 ); 545 echo wp_kses($api_server_list_options_output, $allowed_html); 546 ?> 547 </select> 548 </p> 549 <p class="form-field smapi_service_id"> 550 <label for="_smapi_service_id"><?php esc_html_e( 'SMM API SERVICE', 'smm-api' ); ?></label> 551 <select id="_smapi_service_id_option" name="_smapi_service_id_option" class="smm_select" style="margin-left: 3px;"> 552 <?php 553 $allowed_html = array( 600 554 'option' => array( 601 'value' => array(),555 'value' => array(), 602 556 'selected' => array(), 603 557 'data-desc' => array() 604 558 ), 605 559 ); 606 607 echo wp_kses($api_server_list_options_output, $allowed_html); 608 609 ?> 610 </select> 611 </p> 612 <p class="form-field smapi_service_id"> 613 <label for="_smapi_service_id"><?php esc_html_e( 'SMM API SERVICE', 'smm-api' ); ?></label> 614 615 <select id="_smapi_service_id_option" name="_smapi_service_id_option" class="smm_select" style="margin-left: 3px;"> 616 <?php 617 $allowed_html = array( 618 'option' => array( 619 'value' => array(), 620 'selected' => array(), 621 'data-desc' => array() 622 ), 623 ); 624 echo wp_kses($api_item_list_options_output, $allowed_html); 625 626 560 echo wp_kses($api_item_list_options_output, $allowed_html); 627 561 ?> 628 562 </select> 629 563 <span class="description" style="float:left;display=block;"><span><?php 630 564 echo esc_html( $descrption_opted ) ?></span> 631 </p> 632 565 </p> 633 566 <p class="_input_box"> 634 567 <input type="radio" id="product_input_box" name = "locate_input_box" value="product" <?php echo esc_attr($input_text_box_radio_product);?> >Customer Input Box at Product Page 635 568 <input type="radio" id="checkout_input_box" name = "locate_input_box" value="checkout" <?php echo esc_attr($input_text_box_radio_cart);?> > Customer Input Box at Check Out Page 636 637 </p> 638 569 </p> 639 570 </div> 640 571 </div><?php … … 653 584 woocommerce_wp_text_input( $args ); 654 585 655 echo '</div>'; 656 586 echo '</div>'; 657 587 } 658 588 public function debug_smm_data() { … … 665 595 $product_name = $product->get_name(); 666 596 // get order item meta data (in an unprotected array) 667 $product_id = $item->get_product_id(); 668 597 $product_id = $item->get_product_id(); 669 598 // This is the qty purchased 670 $quantity = $item->get_quantity(); //Get the product QTY 671 599 $quantity = $item->get_quantity(); //Get the product QTY 672 600 //$Customer Data_raw 673 601 $item_meta_data = $item->get_meta('Entered', true ); 674 $api_server_list_options_saved = get_post_meta( $product_id, 'smapi_server_name_option', true ); 675 602 $api_server_list_options_saved = get_post_meta( $product_id, 'smapi_server_name_option', true ); 676 603 $api_item_list_options_saved = get_post_meta( $product_id, 'smapi_service_id_option', true ); 677 604 //smm_get_prop( $product, '_smapi_service_id_option' ); … … 680 607 } 681 608 $int_api_item = (int) filter_var($api_item_list_options_saved, FILTER_SANITIZE_NUMBER_INT); 682 // Only for product variation 683 609 // Only for product variation 684 610 if($product->is_type('variation')){ 685 // Get the variation attributes 686 $variation_attributes = $product->get_variation_attributes(); 687 // Loop through each selected attributes 688 foreach($variation_attributes as $attribute_taxonomy => $term_slug){ 689 $taxonomy = str_replace('attribute_', '', $attribute_taxonomy ); 690 // The name of the attribute 691 $attribute_name = get_taxonomy( $taxonomy )->labels->singular_name; 692 // The term name (or value) for this attribute 693 $attribute_value = get_term_by( 'slug', $term_slug, $taxonomy )->name; 694 } 695 if (preg_match("/quantity/", $taxonomy)){ 696 $order_quantity = (int) filter_var($attribute_value, FILTER_SANITIZE_NUMBER_INT) * $quantity; 697 if ($order_quantity > $api_item_max_qty) 698 $order_quantity = $api_item_max_qty; 699 if ($order_quantity < $api_item_min_qty) 700 $order_quantity = $api_item_min_qty; 611 // Get the variation attributes 612 $variation_attributes = $product->get_variation_attributes(); 613 // Loop through each selected attributes 614 foreach($variation_attributes as $attribute_taxonomy => $term_slug){ 615 $taxonomy = str_replace('attribute_', '', $attribute_taxonomy ); 616 // The name of the attribute 617 $attribute_name = get_taxonomy( $taxonomy )->labels->singular_name; 618 // The term name (or value) for this attribute 619 $attribute_value = get_term_by( 'slug', $term_slug, $taxonomy )->name; } 620 if (preg_match("/quantity/", $taxonomy)){ 621 $order_quantity = (int) filter_var($attribute_value, FILTER_SANITIZE_NUMBER_INT) * $quantity; 622 if ($order_quantity > $api_item_max_qty) 623 $order_quantity = $api_item_max_qty; 624 if ($order_quantity < $api_item_min_qty) 625 $order_quantity = $api_item_min_qty; 701 626 } 702 } 703 627 } 704 628 return $api_server_list_options_saved.$taxonomy.$attribute_name.$attribute_value.$order_quantity; 705 629 } … … 707 631 public function add_custom_fields_for_single_products() { 708 632 global $thepostid; 709 710 633 $product = wc_get_product( $thepostid ); 711 712 634 echo '<div class="options_group">'; 713 714 635 $_smapi_price_is_per = smm_get_prop( $product, '_smapi_price_is_per' ); 715 636 $_smapi_price_time_option = smm_get_prop( $product, '_smapi_price_time_option' ); 716 637 $_smapi_max_length = smm_get_prop( $product, '_smapi_max_length' ); 717 718 638 $max_lengths = smapi_get_max_length_period(); 719 639 ?> … … 752 672 </div> 753 673 754 <?php674 <?php 755 675 756 676 } … … 942 862 943 863 944 } 945 946 947 948 949 /** 864 }/** 950 865 * Premium Tab Template 951 866 * … … 956 871 * @author sam softnwords 957 872 */ 958 959 873 public function premium_tab() { 960 874 $premium_tab_template = SMMS_SMAPI_TEMPLATE_PATH . '/admin/' . $this->_premium; … … 962 876 if ( file_exists( $premium_tab_template ) ) { 963 877 include_once( $premium_tab_template ); 964 } 965 878 } 966 879 967 880 } 968 969 970 971 881 /** 972 882 * Action Links … … 988 898 return $links; 989 899 } 990 991 992 900 /** 993 901 * Plugin rows … … 1007 915 $new_row_meta_args['slug'] = SMMS_SMAPI_SLUG; 1008 916 } 1009 1010 917 return $new_row_meta_args; 1011 918 } 1012 1013 1014 919 /** 1015 920 * Get the premium landing uri … … 1022 927 return $this->_premium_landing; 1023 928 } 1024 1025 929 /** 1026 930 * Subscriptions List Table … … 1041 945 } 1042 946 } 1043 1044 1045 947 /** 1046 948 * Add the widget of "Important Links" inside the admin sidebar … … 1064 966 ); 1065 967 } 1066 1067 968 /** 1068 969 * Sanitize the option of type 'relative_date_selector' before that are saved. … … 1082 983 $value = wc_parse_relative_date_option( $raw_value ); 1083 984 } 1084 1085 985 return $value; 1086 986 } … … 1101 1001 if ( file_exists( $servers_tab ) ) { 1102 1002 include_once( $servers_tab ); 1103 } 1104 1003 } 1105 1004 } 1106 1005 /** … … 1153 1052 // file_put_contents(plugin_dir_path( __FILE__ )."check.txt",$new_api_status); 1154 1053 return $new_api_status_init_obj; 1155 }1054 } 1156 1055 1157 1056 } 1158 1057 } 1159 1160 1058 /** 1161 1059 * Unique access to instance of SMMS_WC_Subscription_Admin class -
smm-api/trunk/includes/class.smms-wc-subscription-cart.php
r3285663 r3286821 303 303 304 304 $args['input_value'] = 305 $order_item_meta_obj->f_min_order ; // Start from this value (default = 1)305 $order_item_meta_obj->f_min_order ??''; // Start from this value (default = 1) 306 306 $args['max_value'] = 307 $order_item_meta_obj->f_max_order ; // Max quantity (default = -1)307 $order_item_meta_obj->f_max_order ?? ''; // Max quantity (default = -1) 308 308 $args['min_value'] = 309 $order_item_meta_obj->f_min_order ; // Min quantity (default = 0)309 $order_item_meta_obj->f_min_order ?? ''; // Min quantity (default = 0) 310 310 $args['step'] = 311 $order_item_meta_obj->f_min_order ; // Increment/decrement by this value (default = 1)311 $order_item_meta_obj->f_min_order ?? ''; // Increment/decrement by this value (default = 1) 312 312 } 313 313 } … … 330 330 // Save the notes to the cart meta 331 331 //$cart = WC()->cart->cart_contents; 332 update_post_meta( $variation_id, 'var_id_sel', "0" );332 //update_post_meta( $variation_id, 'var_id_sel', "0" ); 333 333 $cart_id = isset($_POST['cart_id']) ? 334 334 sanitize_text_field($_POST['cart_id']) : 'NA'; … … 417 417 printf( 418 418 '<div class="var_smm_customer_input_field_label var_smm_customer_input_field_label-%1$d" style="margin-bottom:10px;"> 419 <label for="var_smm_customer_input_field_text " style="display:inline-block;">%2$s</label>419 <label for="var_smm_customer_input_field_text_%3$d" style="display:inline-block;">%2$s</label> 420 420 <input type="text" id="var_smm_customer_input_field_text_%3$d" name="var_smm_customer_input_field_text[]" value=""></div>', 421 421 esc_attr($variation_id), -
smm-api/trunk/includes/class.smms-wc-subscription-order.php
r3285663 r3286821 36 36 */ 37 37 public $subscription_meta = array(); 38 38 public $cart_item_order_item; // 👈 Add this to avoid depreciated warning 39 39 /** 40 40 * Returns single instance of the class … … 868 868 $order = wc_get_order( $order_id ); 869 869 $subscriptions = smm_get_prop( $order, 'subscriptions', true ); 870 if ( $subscriptions != '' ){871 $subscription_order = $this->payment_complete( $order_id );872 }870 871 $subscription_order = ($subscriptions != '' ) ? $this->payment_complete( $order_id ):'0'; 872 873 873 874 874 // This is how to grab line items from the order 875 875 $line_items = $order->get_items(); 876 876 $order_attributes =array(); 877 877 878 878 … … 911 911 $api_server_list_options_saved = 912 912 smm_get_prop( $product, '_smapi_server_name_option' ); 913 $api_item_list_options_saved = smm_get_prop( $product, '_smapi_service_id_option' ); 914 $custom_other_meta_name = $item->get_meta($custom_other_meta_name, true ); 915 916 913 $api_item_list_options_saved = smm_get_prop( $product, '_smapi_service_id_option' ); 917 914 918 915 }// end of product type simple … … 973 970 if ( $item instanceof WC_Order_Item_Product ) { 974 971 if($item->get_meta_data()){ 975 $order_attributes =array();972 976 973 foreach ( $item->get_meta_data() as $meta ) { 977 974 if ( $meta->value != null) { … … 988 985 // repeat order control 989 986 $repeat_order_str = implode(",", $Count_repeat_order); 987 //repeate order allowed for subscritions 990 988 if($subscription_order == 1 || get_option('smmapi_duporder') == 'yes' ) 991 989 $Count_repeat_order = array(); -
smm-api/trunk/plugin-fw/lib/smm-plugin-panel-wc.php
r3285670 r3286821 313 313 } 314 314 } 315 if(wc_clean($_POST[ $option[ 'id' ] ])){316 315 $posts = wc_clean($_POST);//phpcs:ignore 316 if(isset($_POST[$option[ 'id' ]]) && $_POST[ $option[ 'id' ] ]){ 317 317 foreach ( $posts as $name => $value ) { 318 318 -
smm-api/trunk/readme.txt
r3285690 r3286821 105 105 = 6.0.29= 106 106 107 * HPOS bug fixed, Build / TEST API query feature added and works faster107 * HPOS bug fixed,build query url form added 108 108 109 109 = 6.0.9= … … 174 174 == Upgrade Notice == 175 175 176 = 6.0.2 9=177 178 * Build API query feature added.176 = 6.0.27 = 177 178 * Fixed per guidelines and release. 179 179 180 180 = 6.0.9=
Note: See TracChangeset
for help on using the changeset viewer.