Plugin Directory

Changeset 2581004


Ignore:
Timestamp:
08/10/2021 05:09:58 PM (5 years ago)
Author:
oribi
Message:

Adjust WooCommerce products' price calculation

Location:
oribi-analytics
Files:
10 added
2 edited

Legend:

Unmodified
Added
Removed
  • oribi-analytics/trunk/index.php

    r2575262 r2581004  
    66 * Author: Oribi
    77 * Author URI: https://oribi.io
    8  * Version: 3.5
     8 * Version: 3.6
    99 * Text Domain: oribi
    1010 */
     
    158158            $product = $item->get_product();
    159159            $quantity = (int)$item->get_quantity();
    160             $price = (float)$item->get_subtotal() / $quantity;
     160            $price = (float)round($item->get_subtotal() / $quantity, 2);
    161161            $productRegularPrice = (float)$product->get_regular_price();
    162162            $productActivePrice = (float)$product->get_price();
     
    172172                'name'          => $item->get_name(),
    173173                'price'         => $price,
    174                 'taxPrice'      => (float)$item->get_subtotal_tax() / $quantity,
     174                'taxPrice'      => (float)round($item->get_subtotal_tax() / $quantity, 2),
    175175                'discountPrice' => $discountPrice,
    176176                'quantity'      => $quantity,
  • oribi-analytics/trunk/readme.txt

    r2575262 r2581004  
    55Requires at least: 5.0
    66Tested up to: 5.7.2
    7 Stable tag: 3.5
     7Stable tag: 3.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.