Plugin Directory

Changeset 2844692


Ignore:
Timestamp:
01/06/2023 08:00:03 PM (3 years ago)
Author:
soraco
Message:

Added support for passing and setting the &is_userdata1 argument when placing an order.

Location:
quick-license-manager/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • quick-license-manager/trunk/Readme.txt

    r2800258 r2844692  
    33Tags: quick license manager, software protection, ecommerce
    44Requires at least: 4.2
    5 Tested up to: 6.0.1
    6 Stable tag: 2.4.7
     5Tested up to: 6.1.1
     6Stable tag: 2.4.8
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040
    4141== Changelog ==
     42
     43= 2.4.8 - 01/06/2023 =
     44Added support for passing and setting the &is_userdata1 argument when placing an order.
     45
    4246
    4347= 2.4.7 - 10/17/2022 =
  • quick-license-manager/trunk/classes/qlm_api_view.php

    r2763155 r2844692  
    11<?php
    22if ( !class_exists('QLM_Api_View')){
    3     class QLM_Api_View{
     3    class QLM_Api_View
     4    {
     5
     6        public $userdata1 = '';
    47       
    5         function __construct(){
    6            
     8        function __construct()
     9        {
     10            $this->userdata1 = WC()->session->get( 'is_userdata1' );   
    711           
    812        }
     
    129133    $is_maintduration = get_post_meta($pid,'is_maintduration',true);
    130134    $is_affiliateid = get_post_meta($pid,'is_affiliateid',true);
    131      
    132      
     135
     136   
    133137    if(empty($is_expduration)) $is_expduration = $exduration;
    134138    if(empty($is_expdate)) $is_expdate = $exdate;
     
    173177    if(empty($qlm_activation_key) == false)
    174178    $url_args = $url_args.'&is_avkey='.$qlm_activation_key;
     179
     180    if(empty($this->userdata1) == false)
     181    $url_args = $url_args.'&is_userdata1='.$this->userdata1;
    175182
    176183    if(empty($qlm_activation_key) == false)
  • quick-license-manager/trunk/wc_qlm.php

    r2800258 r2844692  
    55 * Plugin URI: https://wordpress.org/plugins/quick-license-manager/
    66 * Description: Automates the creation of license keys when orders are placed with WooCommerce
    7  * Version: 2.4.7
     7 * Version: 2.4.8
    88 * Author: Soraco Technologies Inc.
    99 * Author URI: https://soraco.co
    1010 * WC requires at least: 4.0.0
    11  * WC tested up to: 6.0.1
     11 * WC tested up to: 7.2.2
    1212 */
    1313
     
    189189            add_action('woocommerce_order_status_processing',array(&$this, 'order_status_changed'));
    190190            add_action('woocommerce_order_status_completed',array(&$this, 'order_status_completed'));
    191 
     191           
     192            add_action('woocommerce_add_to_cart',array(&$this, 'action_add_to_cart'), 10, 6);
    192193            add_action('add_meta_boxes', array(&$this,'add_meta') );
    193194           
     
    212213        }
    213214
     215       
     216
     217        /**
     218         * Function for `woocommerce_add_to_cart` action-hook.
     219         *
     220         * @param string  $cart_id          ID of the item in the cart.
     221         * @param integer $product_id       ID of the product added to the cart.
     222         * @param integer $request_quantity Quantity of the item added to the cart.
     223         * @param integer $variation_id     Variation ID of the product added to the cart.
     224         * @param array   $variation        Array of variation data.
     225         * @param array   $cart_item_data   Array of other cart item data.
     226         *
     227         * @return void
     228         */     
     229        function action_add_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data)
     230        {
     231            $userdata1 = $_GET['is_userdata1'];         
     232            WC()->session->set('is_userdata1', $userdata1);     
     233        }
     234   
    214235       
    215236        function so_payment_complete( $order_id )
     
    262283
    263284            $qlm_v = new QLM_Api_View();
    264      
     285           
    265286            debug_message(59, $order, __FUNCTION__, 'Cancelling order id:'.$order_id);
    266287
     
    295316
    296317            $qlm_v = new QLM_Api_View();
    297      
     318           
    298319            debug_message(65, $order, __FUNCTION__, 'Cancelling subscription id:'.$subscription->id);
    299320
     
    570591            global $woocommerce;
    571592
    572            
    573 
    574593            //instantiate api calss
    575594            $qlm_v = new QLM_Api_View();
    576 
     595           
    577596            $date_time = date('Y-m-d H:i:s');
    578597            $orig_order_id="";
     
    582601
    583602            debug_message(165, $order,  __FUNCTION__, 'Processing order id:'.$order->id);
     603            debug_message(166, $order,  __FUNCTION__, 'UserData1 :'.$qlm_v->userdata1);
    584604
    585605            change_role_on_purchase( $order);
     
    11151135
    11161136            $qlm_v = new QLM_Api_View();
    1117 
     1137           
    11181138            $date_time = date('Y-m-d H:i:s');
    11191139                       
     
    12941314
    12951315            $qlm_v = new QLM_Api_View();
    1296 
     1316           
    12971317            $qty = $item['qty'];
    12981318               
     
    15201540
    15211541            $qlm_v = new QLM_Api_View();
    1522 
     1542           
    15231543            $date_time = date('Y-m-d H:i:s');
    15241544           
Note: See TracChangeset for help on using the changeset viewer.