Plugin Directory

Changeset 2956495


Ignore:
Timestamp:
08/22/2023 04:45:51 AM (3 years ago)
Author:
managedorg
Message:

product price updated when it's zero

Location:
managedorg-product-driver
Files:
59 added
3 edited

Legend:

Unmodified
Added
Removed
  • managedorg-product-driver/trunk/donative.php

    r2954666 r2956495  
    44Plugin URI: https://wordpress.org/plugins/managedorg-product-driver/
    55Description: Managedorg Product Driver for Amazon Business Integration.
    6 Version: 1.0.7.5.3
     6Version: 1.0.7.5.4
    77Author: Managedorg
    88Author URI: https://managedorg.io/
     
    1111   
    1212if (!class_exists('MODD_Donation')) :
    13 define('MODD_VERSION', '1.0.7.5.3');
     13define('MODD_VERSION', '1.0.7.5.4');
    1414define('MODD_PLUGIN_URL', plugin_dir_url(__FILE__));
    1515define('MODD_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__));
  • managedorg-product-driver/trunk/js/modd_myscript.js

    r2954666 r2956495  
    12051205    }
    12061206    var all_product_array = [];
     1207    function update_product_price(asin,pid) {
     1208        axios({
     1209            method: "post",
     1210            url: server+"general/getProductByAsin",
     1211            headers: {'Content-Type': 'application/json'},
     1212            data: {"asin":asin, "customerID": customerId, "targetServerIP": server}
     1213        }).then(res => {
     1214            var item_amount;
     1215            var result_offers = res.data.includedDataTypes.OFFERS;
     1216            if (result_offers.length !==0) {
     1217                item_amount = res.data.includedDataTypes.OFFERS[0].price.value.amount;
     1218            }
     1219            if(item_amount > 0) {
     1220                $(".lblAmount_"+asin).html(item_amount);
     1221                axios({
     1222                    method: "put",
     1223                    url: server+"products/"+pid,
     1224                    headers: {'Content-Type': 'application/json'},
     1225                    data:{ "data": { "itemAmount": item_amount } }
     1226                }).then(res => {
     1227                });
     1228            }
     1229        });
     1230    }
    12071231    async function loadProductListOnClick(campaignId, sort){
    12081232        var item_array = [];
     
    12331257                        pCount++;
    12341258                        var product_asin = pList[j].attributes.product.data.attributes.asin;
     1259                        if(pList[j].attributes.product.data.attributes.itemAmount ==0){
     1260                            var up_pid= pList[j].attributes.product.data.id;
     1261                            update_product_price(product_asin, up_pid);
     1262                        }
    12351263                        var single_product_asin = 0;
    12361264                        if(asin_in_url !== null) {
  • managedorg-product-driver/trunk/readme.txt

    r2954666 r2956495  
    44Requires at least: 4.7
    55Tested up to: 6.2
    6 Stable tag: 1.0.7.5.3
     6Stable tag: 1.0.7.5.4
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    144144* Pricing format modified.
    145145
    146 = 1.0.7.5.3=
     146= 1.0.7.5.4=
    147147* New design
    148148* New shortcode attributes products_per_page, campaigns_per_page, cart_checkbox
Note: See TracChangeset for help on using the changeset viewer.