Plugin Directory

Changeset 2675645


Ignore:
Timestamp:
02/09/2022 11:24:55 AM (4 years ago)
Author:
qisstpay
Message:

Updated script to fix bugs related to variation of a product

Location:
qisstpay/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • qisstpay/trunk/class_woo_qp_pgw.php

    r2674829 r2675645  
    244244        $phone       = $this->qpayment8911_convertNo($order_billing_phone);
    245245        $params      = [
    246             'plugin_version'    => '3.0.0',
     246            'plugin_version'    => '3.1',
    247247            'qisstpay_nid'      => $idd,
    248248            'partner_id'        => 'wordpress',
  • qisstpay/trunk/js/qisstpay_plugin_script.js

    r2674829 r2675645  
    5050        jQuery('#qp-lds-roller').append(player);
    5151       
    52 
     52        if(jQuery('input[name=variation_id]') && (jQuery('input[name=variation_id]').val() == ''||jQuery('input[name=variation_id]').val() == 0 || jQuery('input[name=variation_id]').val() == '0')) {
     53            return;
     54        }
    5355        // or load via a Bodymovin JSON string/object
    5456        var quantity = jQuery("input[name=quantity]").val();
     
    6769
    6870            ar = allAttributes.find(b => {
    69                 return b.sku.toString() == jQuery('.sku_wrapper>.sku').html().toString()
     71                if(jQuery('.sku_wrapper>.sku').html()) {
     72                    return b.sku.toString() == jQuery('.sku_wrapper>.sku').html().toString()
     73                }
    7074            })
    7175        }
  • qisstpay/trunk/qpayment-plugin.php

    r2674829 r2675645  
    55 * Plugin URI: https://qisstpay.com/
    66 * Description: QisstPay - pay in interest free installments.
    7  * Version: 3.0.0
     7 * Version: 3.1
    88 * Author: QisstPay
    99 * Author URI: https://qisstpay.com/
     
    8383            $is_live = 0;
    8484        }
    85         if ($obj->get_option('qpay_wignet_enabled') == 'yes') {
     85        if ($obj->get_option('qpay_wignet_enabled') == 'yes' && $obj->get_option('qp_tez_enabled') == 'no') {
    8686            $image = plugin_dir_url(dirname(__FILE__)).basename(dirname(__FILE__)).'/images/QisstPay_logo_white_bg.png';
    8787            $imageNew_qp = plugin_dir_url(dirname(__FILE__)).basename(dirname(__FILE__)).'/images/Qisstpay_DesktopTablet_wqp.png';
     
    476476        $title = $product->get_title();
    477477
    478         if(isset($_GET['variation_id']) && !is_null($_GET['variation_id']) && $_GET['variation_id'] !== '') {
     478        $price = 0;
     479
     480        if(isset($_GET['variation_id']) && !is_null($_GET['variation_id']) && $_GET['variation_id'] !== '' && $_GET['variation_id'] != 'undefined') {
    479481            $woocommerce->cart->add_to_cart( (string)$_GET['product_id'], (string)$_GET['quantity'], (string)$_GET['variation_id'] );
     482            $var_product = new WC_Product_Variation($_GET['variation_id']);
     483            $price = $var_product->get_price();
    480484        } else {
    481485            $woocommerce->cart->add_to_cart( $_GET['product_id'], $_GET['quantity']);
     486            $price = $product->get_price();
     487            if($product->is_on_sale()) {
     488                $price = $product->get_sale_price();
     489            }
    482490        }
    483491
     
    489497                [
    490498                    'id' =>  $_GET['product_id'],
    491                     'price' => $total['subtotal'],
     499                    'price' => $price,
    492500                    'img' => $img,
    493501                    'title' => $title
  • qisstpay/trunk/readme.txt

    r2674829 r2675645  
    11=== QisstPay - pay in interest free installments. ===
    22Contributors: QisstPay
    3 Tags: woocommerce,payment gateway, woocommerce extension, Qisstpay payment,payment, payment option, custom payment, 1Click
     3Tags: woocommerce,payment gateway, woocommerce extension, Qisstpay payment,payment, payment option, custom payment
    44Requires at least: 4.0
    55Tested up to: 5.7.2
Note: See TracChangeset for help on using the changeset viewer.