Plugin Directory

Changeset 2045848


Ignore:
Timestamp:
03/07/2019 10:21:39 AM (7 years ago)
Author:
Profitshare
Message:

Fix possible bug for product type voucher in category & product page.

Location:
wp-profitshare-advertisers
Files:
31 added
6 edited

Legend:

Unmodified
Added
Removed
  • wp-profitshare-advertisers/trunk/changelog.txt

    r2041389 r2045848  
    1 = 1.0.0 =
     11.0.0
    22Stable release for advertisers.
    33
    4 = 1.0.1 =
    5 Update: Change module name to wp-profitshare-advertisers and fix products price for stores who are using woocommerce get_price method.
     41.0.1
     5Change module name to wp-profitshare-advertisers and fix products price for stores who are using woocommerce get_price method.
    66
    7 = 1.0.2 =
    8 Add: static currencies, for Romania the currency is RON and, for Bulgary, the currency is BGN.
     71.0.2
     8Add static currencies, for Romania the currency is RON and, for Bulgary, the currency is BGN.
    99
    10 = 1.0.3 =
    11 Update: logo
     101.0.2.1
     11Fix possible bug for product type voucher in category & product page.
  • wp-profitshare-advertisers/trunk/includes/controllers/class-PWA-category.php

    r2040375 r2045848  
    9393            $product = new PWA_Product($productId);
    9494
    95             $averagePrice += $product->getSalePrice();
     95            // there was a problem with vouchers
     96            if(empty($salePrice) || is_array($salePrice)) {
     97                continue;
     98            }
     99
     100            $averagePrice += $salePrice;
    96101            $totalProducts++;
    97102        }
  • wp-profitshare-advertisers/trunk/includes/controllers/class-PWA-plugin.php

    r2040704 r2045848  
    264264        $categoryId = $wp_query->get_queried_object_id();
    265265        $category = new PWA_Category($categoryId);
     266               
     267        if(empty($category)) {
     268            return;
     269        }
    266270    ?>
    267271
  • wp-profitshare-advertisers/trunk/includes/controllers/class-PWA-product.php

    r2040704 r2045848  
    111111    public function getSalePrice()
    112112    {
    113         return ($this->wooCommerceProduct->get_sale_price()) ? $this->wooCommerceProduct->get_sale_price() : $this->get('price');
     113        $price = $this->get('price');
     114
     115        if(empty($price) || is_array($price)) {
     116            $price = 0;
     117        }
     118
     119        return ($this->wooCommerceProduct->get_sale_price()) ? $this->wooCommerceProduct->get_sale_price() : $price;
    114120    }
    115121}
  • wp-profitshare-advertisers/trunk/readme.txt

    r2041389 r2045848  
    44Requires at least: 3.0
    55Tested up to: 5.1
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.2.1
    77Contributors: Conversion.ro
    88License: GPLv2
     
    4242
    4343== Changelog ==
    44 = 1.0.0 =
     44= 1.0 =
    4545Stable release for advertisers.
    4646
    4747= 1.0.1 =
    48 Update: Change module name to wp-profitshare-advertisers and fix products price for stores who are using woocommerce get_price method.
     48Change module name to wp-profitshare-advertisers and fix products price for stores who are using woocommerce get_price method.
    4949
    5050= 1.0.2 =
    51 Add: static currencies, for Romania the currency is RON and, for Bulgary, the currency is BGN.
     51Add static currencies, for Romania the currency is RON and, for Bulgary, the currency is BGN.
    5252
    53 = 1.0.3 =
    54 Update: logo
     53= 1.0.2.1 =
     54Fix possible bug for product type voucher in category & product page.
  • wp-profitshare-advertisers/trunk/wp-profitshare-advertisers.php

    r2041389 r2045848  
    44 * Plugin URI: https://www.profitshare.ro
    55 * Description: Profitshare module for wordpress woocommerce
    6  * Version: 1.0.3
     6 * Version: 1.0.2.1
    77 * Author: Conversion
    88 * Author URI: https://www.conversion.ro
     
    1616 */
    1717
    18 define('PWA_VERSION', '1.0.3');
     18define('PWA_VERSION', '1.0.2.1');
    1919
    2020function pwa_get_plugin() {
Note: See TracChangeset for help on using the changeset viewer.