Plugin Directory

Changeset 3286821


Ignore:
Timestamp:
05/03/2025 02:58:39 PM (11 months ago)
Author:
softnwords
Message:

changes css files

Location:
smm-api/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • smm-api/trunk/assets/css/frontend.css

    r3285661 r3286821  
    202202.smm_form__field {
    203203    font-family: inherit;
    204     width: 90%;
     204    width: 60%;
    205205    border: 1px solid #c1baba;
    206    
    207206    border-bottom: 1px solid #d4cece;
    208207    outline: 0;
    209208    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;
    213212    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) */
    229220.smm_form__label {
    230221    position: absolute;
    231     z-index: -1;
    232222    top: 22px;
    233     display: block;
    234     transition: 0.2s;
     223    left: 10px;
    235224    font-size: 0.9rem;
    236225    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 */
    239239.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;
    252240    border-width: 1px;
    253241    border-image: linear-gradient(to right, #11998e, #38ef7d);
     
    255243}
    256244
    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
    265250.smm-custom-input{
    266251        font-size: 0.5em;
  • smm-api/trunk/assets/css/select.dataTables.css

    r3285661 r3286821  
    104104  }
    105105}
    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;
    122109}
    123110
     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}
    124121
    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;
    130140}
    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
    148142.tgl-flip + .tgl-btn:after {
    149143  content: attr(data-tg-on);
    150144  background: #02C66F;
    151   transform: rotateY(-180deg);
     145  transform: rotateY(180deg);
    152146}
    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 */
    160149.tgl-flip:checked + .tgl-btn:before {
    161150  transform: rotateY(180deg);
    162151}
     152
    163153.tgl-flip:checked + .tgl-btn:after {
    164   transform: rotateY(0);
    165   left: -66px;
    166   top: -1px;
    167   background: #7FC6A6;
     154  transform: rotateY(0deg);
    168155}
    169 .tgl-flip:checked + .tgl-btn:active:after {
    170   transform: rotateY(20deg);
    171 }
  • smm-api/trunk/includes/class.smms-wc-api.php

    r3285663 r3286821  
    101101            $this->api_server_url       = $api_baseurl;
    102102            // Get matching keys array_intersect_key($array2, $array1)
     103            if (!empty($product_attributes))
    103104            $matching_keys = array_intersect_key($product_attributes, $params);
    104105            // 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)
    106108                $params[$key] = $value;
    107             }// for extracting data from link url for keywords
     109            // for extracting data from link url for keywords
    108110           
    109111            $parts_of_link                      = explode('?', $link) ?? null;
     
    114116            // Parse into an array
    115117            $link_params                        = array();
     118            if (!empty($url_link_params))
    116119            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))
    118122            $matching_keys = array_intersect_key($link_params, $params);
    119123            // 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)
    121126                $params[$key] = $value;
    122             }
     127           
    123128            }
    124129            //file_put_contents(plugin_dir_path( __FILE__ )."check.php", serialize($params) );
  • smm-api/trunk/includes/class.smms-wc-subscription-admin.php

    r3285663 r3286821  
    8181            add_filter( 'plugin_action_links_' . plugin_basename( SMMS_SMAPI_DIR . '/' . basename( SMMS_SMAPI_FILE ) ), array( $this, 'action_links' ) );
    8282            add_filter( 'smms_show_plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 5 );
    83 
    8483            //custom styles and javascripts
    8584            add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ), 11);
    86 
    8785            //product editor
    8886            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 
    9487            //custom fields for single product
    9588            add_action( 'woocommerce_product_options_general_product_data', array( $this, 'add_custom_fields_for_api_products' ) );
     
    10295            add_filter('smm_pull_order_status', array( $this, 'smm_pull_order_status_ar' ), 10, 3);
    10396            add_filter('smm_url_check_status', array( $this, 'smm_url_check_status_ar' ), 10, 1);
    104             //calling woocomerce variation html-variation-admin.php
    105             //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.php
    108             //add_filter( 'woocommerce_available_variation',array( $this, 'smm_add_custom_field_variation_data') );
    109            
    110             // calling woocomerce variation html-variation-admin.php
    111             //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.php
    11797            add_action( 'woocommerce_variation_options',  array( $this,'smm_add_variation_option'), 10, 3 );
    11898            add_action( 'woocommerce_product_after_variable_attributes', array( $this,'smm_variation_settings_fields'), 10, 3 );
     
    123103           
    124104            // 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();           
    129106        }
    130107       
    131108        public function smm_status_manual($order_id, $items)
    132                 {
    133                    
    134                    
     109                {                   
    135110                    $order = wc_get_order( $order_id );
    136111                   
    137                 if( 'wc-manual'== $_POST['order_status']) {
    138                     //$order->update_status( 'wc-on-hold' );
    139                  
     112                if( 'wc-manual'== $_POST['order_status']) {                 
    140113                  SMAPI_Subscription_Order()->smm_api_order_trigger($order_id);
    141                 }
    142         //  $this->smm_api_order_trigger($order_id);
    143            
    144            
    145         }
    146        
     114                }       
     115        }       
    147116         // Add custom status to order status list
    148117        public function add_manual_to_order_statuses( $order_statuses ) {
     
    169138                     */
    170139        public function smm_add_variation_option( $loop, $variation_data, $variation ) {
     140            if ( ! is_object( $variation ) || ! isset( $variation->ID ) ) return;
    171141                        $_smapi_api_check =
    172142                                    get_post_meta( $variation->ID, 'variable_smm_api', true );
     
    184154                       
    185155                        }
    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                        );     
    202169                    }
    203170        // Make product virtual if selected smmapi check box
     
    213180            //$arr['downloadable']['default'] = "yes";
    214181            return $arr;
    215         }
    216 
    217                      /**
    218                         * Create new fields for variations
    219                         *
    220                     */
     182        }/*** Create new fields for variations  **/
    221183        public function smm_variation_settings_fields( $loop, $variation_data, $variation ) {
    222184
     
    234196                $api_server_list_options_saved  = get_post_meta( $variation->ID, 'var_smapi_server_name_option', true ) != "" ?
    235197                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             
    241200                $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 )
    242201                WHERE 1=1
     
    251210                $product_id = wp_get_post_parent_id($variation->ID);
    252211                $product = wc_get_product( $product_id );   
    253                 $_smapi_server_name_option_simple =
     212                $_smapi_server_name_option_simple       =
    254213                smm_get_prop( $product, '_smapi_server_name_option' );
    255                 $api_item_list_options_saved_simple =
     214                $api_item_list_options_saved_simple     =
    256215                 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;               
    262219                }
    263220                // for new product only
     
    265222                //For setting first item in list from forloop
    266223                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);               
    273226                $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 )
    274227                WHERE 1=1
     
    335288       
    336289    ) );
    337 
    338    
    339    
    340 
    341290    woocommerce_wp_select( array( // Text Field type
    342291        'id'            => 'var_smapi_server_name_option_'.esc_attr( $loop ),
     
    349298        'options'       => $api_server_list_options_output,
    350299        'value'         => $input_checkbox_default_server,
    351     ) );
    352                        
    353    
     300    ) );   
    354301    echo '<div><span id="var_smapi_service_span_option_'. esc_attr( $loop ).'" style="float:left;display:block;">
    355302                    '.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> ';   
    359304    // Text Field
    360305    $var_customer_input_field_label = get_post_meta( $variation->ID, 'var_smm_customer_input_field_label', true ) != "" ?
     
    365310                            $smm_custom_text_field_title_simple;
    366311    woocommerce_wp_text_input( array(
    367         'id'            => 'var_smm_customer_input_field_label',
    368        
     312        'id'            => 'var_smm_customer_input_field_label',       
    369313        'class'         => 'short',
    370314        'style'         => 'font-size: large;',
     
    583527            //service id = filter_var($sub_item_result['meta_key'], FILTER_SANITIZE_NUMBER_INT)
    584528            . '</option>';
    585             }
    586        
    587             echo '<div class="options_group show_if_simple">';
    588 
    589            
     529            }       
     530            echo '<div class="options_group show_if_simple">';           
    590531            ?>
    591532            <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">               
    594534                <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>                   
    597536                    <select id="_smapi_server_name_option" name="_smapi_server_name_option" class="select" style="margin-left: 3px;">
    598537                        <?php
    599538                            $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(
    600554                                    'option' => array(
    601                                                     'value' => array(),
     555                                                'value' => array(),
    602556                                                'selected'  => array(),
    603557                                                'data-desc' => array()
    604558                                                     ),
    605559                                );
    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);                       
    627561                        ?>
    628562                    </select>   
    629563                    <span class="description" style="float:left;display=block;"><span><?php
    630564                    echo esc_html( $descrption_opted ) ?></span>
    631                     </p>
    632                
     565                    </p>               
    633566                <p class="_input_box">
    634567                <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
    635568                <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>
    639570            </div>
    640571            </div><?php
     
    653584        woocommerce_wp_text_input( $args );
    654585           
    655 echo '</div>';
    656 
     586        echo '</div>';
    657587        }
    658588        public function debug_smm_data() {
     
    665595            $product_name = $product->get_name();
    666596            // get order item meta data (in an unprotected array)
    667             $product_id = $item->get_product_id();
    668            
     597            $product_id = $item->get_product_id();           
    669598            // This is the qty purchased
    670                 $quantity = $item->get_quantity(); //Get the product QTY
    671            
     599            $quantity = $item->get_quantity(); //Get the product QTY           
    672600            //$Customer Data_raw
    673601            $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 );           
    676603            $api_item_list_options_saved   = get_post_meta( $product_id, 'smapi_service_id_option', true );
    677604            //smm_get_prop( $product, '_smapi_service_id_option' );
     
    680607            }
    681608            $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           
    684610            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;
    701626                                    }
    702                                     }
    703            
     627                                    }           
    704628            return $api_server_list_options_saved.$taxonomy.$attribute_name.$attribute_value.$order_quantity;
    705629        }
     
    707631        public function add_custom_fields_for_single_products() {
    708632            global $thepostid;
    709 
    710633            $product = wc_get_product( $thepostid );
    711 
    712634            echo '<div class="options_group">';
    713 
    714635            $_smapi_price_is_per           = smm_get_prop( $product, '_smapi_price_is_per' );
    715636            $_smapi_price_time_option      = smm_get_prop( $product, '_smapi_price_time_option' );
    716637            $_smapi_max_length             = smm_get_prop( $product, '_smapi_max_length' );
    717 
    718638            $max_lengths = smapi_get_max_length_period();
    719639            ?>
     
    752672            </div>
    753673           
    754 <?php
     674        <?php
    755675
    756676        }
     
    942862
    943863
    944         }
    945 
    946        
    947 
    948 
    949         /**
     864        }/**
    950865         * Premium Tab Template
    951866         *
     
    956871         * @author   sam softnwords
    957872         */
    958 
    959873        public function premium_tab() {
    960874            $premium_tab_template = SMMS_SMAPI_TEMPLATE_PATH . '/admin/' . $this->_premium;
     
    962876            if ( file_exists( $premium_tab_template ) ) {
    963877               include_once( $premium_tab_template );
    964                 }
    965            
     878                }       
    966879       
    967880        }
    968        
    969 
    970 
    971881        /**
    972882         * Action Links
     
    988898            return $links;
    989899        }
    990 
    991 
    992900        /**
    993901         * Plugin rows
     
    1007915                $new_row_meta_args['slug'] = SMMS_SMAPI_SLUG;
    1008916            }
    1009 
    1010917            return $new_row_meta_args;
    1011918        }
    1012 
    1013 
    1014919        /**
    1015920         * Get the premium landing uri
     
    1022927            return $this->_premium_landing;
    1023928        }
    1024 
    1025929        /**
    1026930         * Subscriptions List Table
     
    1041945            }
    1042946        }
    1043 
    1044 
    1045947        /**
    1046948         * Add the widget of "Important Links" inside the admin sidebar
     
    1064966            );
    1065967        }
    1066 
    1067968        /**
    1068969         * Sanitize the option of type 'relative_date_selector' before that are saved.
     
    1082983                $value = wc_parse_relative_date_option( $raw_value );
    1083984            }
    1084 
    1085985            return $value;
    1086986        }
     
    11011001            if ( file_exists( $servers_tab ) ) {
    11021002                include_once( $servers_tab );
    1103             }
    1104            
     1003            }           
    11051004        }
    11061005        /**
     
    11531052           // file_put_contents(plugin_dir_path( __FILE__ )."check.txt",$new_api_status);
    11541053            return $new_api_status_init_obj;
    1155     }
     1054        }
    11561055       
    11571056    }
    11581057}
    1159 
    11601058/**
    11611059 * Unique access to instance of SMMS_WC_Subscription_Admin class
  • smm-api/trunk/includes/class.smms-wc-subscription-cart.php

    r3285663 r3286821  
    303303 
    304304                    $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)
    306306                    $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)
    308308                    $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)
    310310                    $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)
    312312                    }
    313313                    }
     
    330330        // Save the notes to the cart meta
    331331        //$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" );
    333333        $cart_id = isset($_POST['cart_id']) ?
    334334            sanitize_text_field($_POST['cart_id']) : 'NA';
     
    417417                    printf(
    418418                    '<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>
    420420                    <input type="text" id="var_smm_customer_input_field_text_%3$d" name="var_smm_customer_input_field_text[]" value=""></div>',
    421421                    esc_attr($variation_id),                       
  • smm-api/trunk/includes/class.smms-wc-subscription-order.php

    r3285663 r3286821  
    3636         */
    3737        public $subscription_meta = array();
    38 
     38        public $cart_item_order_item; // 👈 Add this to avoid depreciated warning
    3939        /**
    4040         * Returns single instance of the class
     
    868868                        $order         = wc_get_order( $order_id );
    869869                        $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                       
    873873
    874874                        // This is how to grab line items from the order
    875875                        $line_items = $order->get_items();
    876                        
     876                        $order_attributes =array();
    877877                       
    878878                       
     
    911911                            $api_server_list_options_saved =
    912912                            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' );         
    917914             
    918915                            }// end of product type simple
     
    973970                            if ( $item instanceof WC_Order_Item_Product ) {                             
    974971                                if($item->get_meta_data()){                             
    975                                 $order_attributes =array();
     972                       
    976973                                    foreach ( $item->get_meta_data() as $meta ) {                               
    977974                                    if ( $meta->value != null) {
     
    988985                                // repeat order control
    989986                                $repeat_order_str = implode(",", $Count_repeat_order);
     987                                //repeate order allowed for subscritions
    990988                                if($subscription_order == 1 || get_option('smmapi_duporder')  ==  'yes' )
    991989                                $Count_repeat_order = array();
  • smm-api/trunk/plugin-fw/lib/smm-plugin-panel-wc.php

    r3285670 r3286821  
    313313                    }
    314314                }
    315                 if(wc_clean($_POST[ $option[ 'id' ] ])){
    316315                $posts = wc_clean($_POST);//phpcs:ignore
     316                if(isset($_POST[$option[ 'id' ]]) && $_POST[ $option[ 'id' ] ]){
    317317                foreach ( $posts as $name => $value ) {
    318318
  • smm-api/trunk/readme.txt

    r3285690 r3286821  
    105105= 6.0.29=
    106106
    107 * HPOS bug fixed, Build / TEST API query feature added and works faster
     107* HPOS bug fixed,build query url form added
    108108
    109109= 6.0.9=
     
    174174== Upgrade Notice ==
    175175
    176 = 6.0.29 =
    177 
    178 * Build API query feature added.
     176= 6.0.27 =
     177
     178* Fixed per guidelines and release.
    179179
    180180= 6.0.9=
Note: See TracChangeset for help on using the changeset viewer.