Plugin Directory

Changeset 2855020


Ignore:
Timestamp:
01/26/2023 08:41:22 AM (3 years ago)
Author:
qltechsrl
Message:

Learning Objects LMS - version 1.2.3

Location:
learning-objects-lms
Files:
8 deleted
5 edited
16 copied

Legend:

Unmodified
Added
Removed
  • learning-objects-lms/tags/1.2.3/include/function.php

    r2657812 r2855020  
    209209       
    210210        $product_sku = $product->get_sku();
    211         $giornivalidita = intval($product->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     211       
    212212       
    213213        //recupero i mesi di validità dagli attributi       
    214         $attributes = $product->get_attributes();       
     214        //Controllo se il prodoto ha un prodotto padre
     215        if($product->get_parent_id()){
     216            $product_parent = wc_get_product($product->get_parent_id());
     217            $giornivalidita = intval($product_parent->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     218                   
     219        }else{
     220            $giornivalidita = intval($product->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     221        }
     222       
     223        $attributes = $product->get_attributes();
    215224       
    216225        //Se giorni validità è presente dal meta wcloi_scadenza_giorni_text_field_title non controllo l'attributo
     
    234243        }
    235244       
     245        //Controllo se il prodoto ha un prodotto padre
     246        if($product->get_parent_id()){
     247            $product_parent = wc_get_product($product->get_parent_id());
     248            $product_lo = $product_parent->get_meta('wcloi_prodotto_lo',true);
     249        }else{
     250            $product_lo = false;
     251        }
     252       
    236253        //Se il prodotto ha un determinato attributo all'ora fa parte di quelli di LO
    237254        //Oppure se è fleggato il meta wcloi_prodotto_lo
    238255        //Questa doppia casistica serve per gestire il pregresso
    239         if ($attributes[WCLOI_ATTRIB_LEARNING_OBJECTS] || $product->get_meta('wcloi_prodotto_lo',true)) {
     256        if ($attributes[WCLOI_ATTRIB_LEARNING_OBJECTS] || $product->get_meta('wcloi_prodotto_lo',true) || $product_lo) {
    240257            if(strlen($product_sku) > 0){
    241258                //Nuova gestione della riga di prodotto
     
    264281   
    265282    foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) {
    266         if(get_post_meta( $cart_item['product_id'], 'wcloi_prodotto_ecm', true )){
    267             return true;
    268         }   
     283       
     284        //Controllo se il prodoto ha un prodotto padre
     285        $product = wc_get_product( $cart_item['product_id'] );
     286       
     287        if($product->get_parent_id()){
     288            $product_parent = wc_get_product($product->get_parent_id());           
     289            if(get_post_meta( $product_parent->id, 'wcloi_prodotto_ecm', true )){
     290                return true;
     291            }                   
     292        }else{
     293            if(get_post_meta( $cart_item['product_id'], 'wcloi_prodotto_ecm', true )){
     294                return true;
     295            }   
     296        }       
    269297    }
    270298   
     
    361389    return $piva;
    362390}
     391
     392//Banner modalità test attiva
     393function wcloi_admin_notice_test() {
     394    if('no' !== get_option( 'woocommerce_enable_guest_checkout' )){
     395        ?>
     396        <div class="notice notice-warning is-dismissible">
     397            <p>Per il corretto interfacciamento con Learning Objects è necessario togliere la spunta a l'opzione "Permetti ai clienti di effettuare ordini senza un account" che si trova in WooCommerce > impostazioni > Account e privacy</p>
     398        </div>
     399        <?php
     400    }
     401   
     402    if('no' !== get_option( 'woocommerce_registration_generate_password' )){
     403        ?>
     404        <div class="notice notice-warning is-dismissible">
     405            <p>Per il corretto interfacciamento con Learning Objects è necessario togliere la spunta a l'opzione "Durante la creazione di un account, genera automaticamente una password dell'account" che si trova in WooCommerce > impostazioni > Account e privacy</p>
     406        </div>
     407        <?php
     408    }   
     409}
     410add_action( 'admin_notices', 'wcloi_admin_notice_test' );
    363411?>
  • learning-objects-lms/tags/1.2.3/include/paypal.php

    r2557556 r2855020  
    2929    add_action( 'valid-paypal-standard-ipn-request', 'wcloi_processing_order', 10, 1 );
    3030    add_action( 'woocommerce_paypal_express_checkout_valid_ipn_request', 'wcloi_processing_order', 10, 1 );
     31   
     32    function wcloi_stripe_processing_order( $stripe_response, $order )
     33    {       
     34        if($stripe_response->status == 'succeeded')
     35        {
     36            //L'ordine passa in completato automaticamente solo se ci sono prodotti LO
     37            $order_items = wcloi_get_order_e_learning_product($order);
     38           
     39            if(count($order_items) > 0)
     40            {
     41                $order->update_status( 'completed' );
     42            }       
     43        }
     44    }   
     45   
     46    add_action ('wc_gateway_stripe_process_payment', 'wcloi_stripe_processing_order',10,2);
     47    add_action ('wc_gateway_stripe_process_response', 'wcloi_stripe_processing_order',10,2);
     48   
  • learning-objects-lms/tags/1.2.3/learning-objects-lms.php

    r2657812 r2855020  
    44Plugin URI: https://www.qltech.it/en/learning-objects-woocommerce-lms-plugin/
    55Description: Learning Objects Woocommerce LMS is a plugin for Woocommerce that allows you to connect your shop or website to the professional Learning Objects environment for elearning.
    6 Version: 1.2.2
     6Version: 1.2.3
    77Author: qltechsrl
    88Author URI: https://www.qltech.it
    99License: GPL-3.0+
    1010WC requires at least: 4.8
    11 WC tested up to: 5.9
     11WC tested up to: 7.2
    1212Text Domain: learning-objects-lms
    1313Domain Path: /languages
  • learning-objects-lms/tags/1.2.3/readme.txt

    r2657812 r2855020  
    33Plugin link: https://www.qltech.it/en/learning-objects-woocommerce-lms-plugin/?utm_source=LPsitoqltech&utm_campaign=Wordpress
    44Tags: LMS, elearning, learning management system, woocommerce lms, education, course
    5 Tested up to: 5.8
     5Tested up to: 6.1
    66Requires at least: 5.6
    77Requires PHP: 7.2
    8 Stable tag: 1.2.2
     8Stable tag: 1.2.3
    99License: GPL-3.0+
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    139139
    140140== Changelog ==
     141= 1.2.3 [Jan 23, 2023] =
     142* Improved: Minor bug fixes.
     143* Improved: WooCommerce Stripe Checkout Gateway integration
     144
    141145= 1.2.2 [Jan 14, 2022] =
    142146* Improved: Minor bug fixes.
  • learning-objects-lms/trunk/include/function.php

    r2657812 r2855020  
    209209       
    210210        $product_sku = $product->get_sku();
    211         $giornivalidita = intval($product->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     211       
    212212       
    213213        //recupero i mesi di validità dagli attributi       
    214         $attributes = $product->get_attributes();       
     214        //Controllo se il prodoto ha un prodotto padre
     215        if($product->get_parent_id()){
     216            $product_parent = wc_get_product($product->get_parent_id());
     217            $giornivalidita = intval($product_parent->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     218                   
     219        }else{
     220            $giornivalidita = intval($product->get_meta('wcloi_scadenza_giorni_text_field_title',true));
     221        }
     222       
     223        $attributes = $product->get_attributes();
    215224       
    216225        //Se giorni validità è presente dal meta wcloi_scadenza_giorni_text_field_title non controllo l'attributo
     
    234243        }
    235244       
     245        //Controllo se il prodoto ha un prodotto padre
     246        if($product->get_parent_id()){
     247            $product_parent = wc_get_product($product->get_parent_id());
     248            $product_lo = $product_parent->get_meta('wcloi_prodotto_lo',true);
     249        }else{
     250            $product_lo = false;
     251        }
     252       
    236253        //Se il prodotto ha un determinato attributo all'ora fa parte di quelli di LO
    237254        //Oppure se è fleggato il meta wcloi_prodotto_lo
    238255        //Questa doppia casistica serve per gestire il pregresso
    239         if ($attributes[WCLOI_ATTRIB_LEARNING_OBJECTS] || $product->get_meta('wcloi_prodotto_lo',true)) {
     256        if ($attributes[WCLOI_ATTRIB_LEARNING_OBJECTS] || $product->get_meta('wcloi_prodotto_lo',true) || $product_lo) {
    240257            if(strlen($product_sku) > 0){
    241258                //Nuova gestione della riga di prodotto
     
    264281   
    265282    foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) {
    266         if(get_post_meta( $cart_item['product_id'], 'wcloi_prodotto_ecm', true )){
    267             return true;
    268         }   
     283       
     284        //Controllo se il prodoto ha un prodotto padre
     285        $product = wc_get_product( $cart_item['product_id'] );
     286       
     287        if($product->get_parent_id()){
     288            $product_parent = wc_get_product($product->get_parent_id());           
     289            if(get_post_meta( $product_parent->id, 'wcloi_prodotto_ecm', true )){
     290                return true;
     291            }                   
     292        }else{
     293            if(get_post_meta( $cart_item['product_id'], 'wcloi_prodotto_ecm', true )){
     294                return true;
     295            }   
     296        }       
    269297    }
    270298   
     
    361389    return $piva;
    362390}
     391
     392//Banner modalità test attiva
     393function wcloi_admin_notice_test() {
     394    if('no' !== get_option( 'woocommerce_enable_guest_checkout' )){
     395        ?>
     396        <div class="notice notice-warning is-dismissible">
     397            <p>Per il corretto interfacciamento con Learning Objects è necessario togliere la spunta a l'opzione "Permetti ai clienti di effettuare ordini senza un account" che si trova in WooCommerce > impostazioni > Account e privacy</p>
     398        </div>
     399        <?php
     400    }
     401   
     402    if('no' !== get_option( 'woocommerce_registration_generate_password' )){
     403        ?>
     404        <div class="notice notice-warning is-dismissible">
     405            <p>Per il corretto interfacciamento con Learning Objects è necessario togliere la spunta a l'opzione "Durante la creazione di un account, genera automaticamente una password dell'account" che si trova in WooCommerce > impostazioni > Account e privacy</p>
     406        </div>
     407        <?php
     408    }   
     409}
     410add_action( 'admin_notices', 'wcloi_admin_notice_test' );
    363411?>
  • learning-objects-lms/trunk/include/paypal.php

    r2557556 r2855020  
    2929    add_action( 'valid-paypal-standard-ipn-request', 'wcloi_processing_order', 10, 1 );
    3030    add_action( 'woocommerce_paypal_express_checkout_valid_ipn_request', 'wcloi_processing_order', 10, 1 );
     31   
     32    function wcloi_stripe_processing_order( $stripe_response, $order )
     33    {       
     34        if($stripe_response->status == 'succeeded')
     35        {
     36            //L'ordine passa in completato automaticamente solo se ci sono prodotti LO
     37            $order_items = wcloi_get_order_e_learning_product($order);
     38           
     39            if(count($order_items) > 0)
     40            {
     41                $order->update_status( 'completed' );
     42            }       
     43        }
     44    }   
     45   
     46    add_action ('wc_gateway_stripe_process_payment', 'wcloi_stripe_processing_order',10,2);
     47    add_action ('wc_gateway_stripe_process_response', 'wcloi_stripe_processing_order',10,2);
     48   
  • learning-objects-lms/trunk/learning-objects-lms.php

    r2657812 r2855020  
    44Plugin URI: https://www.qltech.it/en/learning-objects-woocommerce-lms-plugin/
    55Description: Learning Objects Woocommerce LMS is a plugin for Woocommerce that allows you to connect your shop or website to the professional Learning Objects environment for elearning.
    6 Version: 1.2.2
     6Version: 1.2.3
    77Author: qltechsrl
    88Author URI: https://www.qltech.it
    99License: GPL-3.0+
    1010WC requires at least: 4.8
    11 WC tested up to: 5.9
     11WC tested up to: 7.2
    1212Text Domain: learning-objects-lms
    1313Domain Path: /languages
  • learning-objects-lms/trunk/readme.txt

    r2657812 r2855020  
    33Plugin link: https://www.qltech.it/en/learning-objects-woocommerce-lms-plugin/?utm_source=LPsitoqltech&utm_campaign=Wordpress
    44Tags: LMS, elearning, learning management system, woocommerce lms, education, course
    5 Tested up to: 5.8
     5Tested up to: 6.1
    66Requires at least: 5.6
    77Requires PHP: 7.2
    8 Stable tag: 1.2.2
     8Stable tag: 1.2.3
    99License: GPL-3.0+
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    139139
    140140== Changelog ==
     141= 1.2.3 [Jan 23, 2023] =
     142* Improved: Minor bug fixes.
     143* Improved: WooCommerce Stripe Checkout Gateway integration
     144
    141145= 1.2.2 [Jan 14, 2022] =
    142146* Improved: Minor bug fixes.
Note: See TracChangeset for help on using the changeset viewer.