Plugin Directory

Changeset 2869496


Ignore:
Timestamp:
02/22/2023 03:57:55 PM (3 years ago)
Author:
viaads
Message:

Empty Check on Price

Location:
viaads
Files:
16 added
3 edited

Legend:

Unmodified
Added
Removed
  • viaads/trunk/readme.txt

    r2869475 r2869496  
    44Requires at least: 5.4
    55Tested up to: 6.1
    6 Stable tag: 1.1.4
     6Stable tag: 1.1.5
    77Requires PHP: 7.0
    88License: GPLv3
  • viaads/trunk/sync.php

    r2869475 r2869496  
    146146        $product_object->Slug = $product->get_slug();
    147147        //Price
    148         $product_object->price = $product->get_price();
     148        $product_price = $product->get_price();
     149        $product_object->price = !empty($product_price) ? $product_price : 0;
    149150        if ($product_object->price == "") {
    150151            $product_object->price = null;
     
    205206                $child_object->DateCreated = $createdAt->format('c');
    206207                // Gets the products Final Price
    207                 $childPrice = $child->get_price();
    208                 $child_object->Price = $childPrice;
     208                $child_price = !empty($child->get_price()) ? $child->get_price() : 0;
     209                $child_object->Price = $child_price;
    209210                // Regular Price
    210                 $child_object->RegularPrice = $child->get_price();
     211                $child_object->RegularPrice = $child_price;
    211212                if ($child_object->RegularPrice == "") {
    212213                    $child_object->RegularPrice = null;
     
    240241                // Getting the Lowest and the Highest price from Child (Variant) Products
    241242                if ($i == 1) {
    242                     $lowestPrice = $childPrice;
    243                     $highestPrice = $childPrice;
     243                    $lowestPrice = $child_price;
     244                    $highestPrice = $child_price;
    244245                } else {
    245                     if ($childPrice < $lowestPrice)
    246                         $lowestPrice = $childPrice;
    247                     if ($childPrice > $highestPrice)
    248                         $highestPrice = $childPrice;
     246                    if ($child_price < $lowestPrice)
     247                        $lowestPrice = $child_price;
     248                    if ($child_price > $highestPrice)
     249                        $highestPrice = $child_price;
    249250                }
    250251
  • viaads/trunk/viaads.php

    r2869475 r2869496  
    33 * Plugin Name: ViaAds
    44 * Description: Plugin der muliggør forbindelsen til ViaAds / Plug-in enabling the connection to ViaAds.
    5  * Version: 1.1.4
     5 * Version: 1.1.5
    66 * Author: ViaAds
    77 * Author URI: https://www.viaads.dk/
Note: See TracChangeset for help on using the changeset viewer.