Plugin Directory

Changeset 3336428


Ignore:
Timestamp:
07/30/2025 08:57:24 AM (7 months ago)
Author:
techbeeps
Message:

version 2.2

Location:
sales-analytics-for-woocommerce
Files:
34 added
3 edited

Legend:

Unmodified
Added
Removed
  • sales-analytics-for-woocommerce/trunk/readme.txt

    r3335970 r3336428  
    66Tested up to: 6.8 
    77Requires PHP: 7.4 
    8 Stable tag: 2.1
     8Stable tag: 2.2
    99License: GPLv2 or later 
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    6262
    6363== Changelog ==
     64= 2.2 =
     65* Fix currency symbol bug
     66
     67= 2.1 =
     68* update Readme.txt
     69
    6470= 2.0 =
    6571* Added new Customer Performance Analytics feature to track user-level metrics such as total orders, total amount spent, average purchase, min/max order value, and last purchase date.
  • sales-analytics-for-woocommerce/trunk/sales-analytics-for-woocommerce.php

    r3335970 r3336428  
    44Plugin URI: https://plugins.techbeeps.com
    55Description: A plugin to generate custom analytics reports for WooCommerce stores, including sales data, product performance, and more.
    6 Version: 2.1
     6Version: 2.2
    77Author: Techbeeps services
    88Author URI: https://www.techbeeps.com
     
    2020
    2121
    22 define('SALESAFW_SALES_ANALYTICS_TBS_VERSION', '2.1');
     22define('SALESAFW_SALES_ANALYTICS_TBS_VERSION', '2.2');
    2323define('SALESAFW_SALES_ANALYTICS_TBS_PATH', plugin_dir_path(__FILE__));
    2424define('SALESAFW_SALES_ANALYTICS_TBS_URL', plugin_dir_url(__FILE__));
  • sales-analytics-for-woocommerce/trunk/sales-by-user.php

    r3335970 r3336428  
    3131            $user_id = $order->get_user_id();
    3232            $total   = floatval($order->get_total());
    33             $date    = $order->get_date_completed();
     33            $date    = $order->get_date_created();
    3434            $currency = get_woocommerce_currency_symbol($order->get_currency());
    3535
     
    5151                ];
    5252            }
     53           
    5354            $user_data[$user_id]['total_orders'] += 1;
    5455            $user_data[$user_id]['total_amount'] += $total;
     
    8687                        return $b['total_amount'] <=> $a['total_amount'];
    8788                    });
     89           
    8890                    foreach ($user_data as $data) {
    8991                        $avg = $data['total_orders'] ? ($data['total_amount'] / $data['total_orders']) : 0;
     
    9294                        echo '<td>' . esc_html($data['name']) . '</td>';
    9395                        echo '<td>' . esc_html($data['email']) . '</td>';
    94                         echo '<td>' . esc_html($data['currency']) . ' ' . number_format($avg, 2) . '</td>';
    95                         echo '<td>' . esc_html($data['currency']) . ' ' . number_format($data['min_purchase'], 2) . '</td>';
    96                         echo '<td>' . esc_html($data['currency']) . ' ' . number_format($data['max_purchase'], 2) . '</td>';
    97                         echo '<td>' . esc_html($data['last_purchase']->date('Y-m-d')) . '</td>';
     96                        echo '<td>' . wp_kses_post($data['currency']) . ' ' . number_format($avg, 2) . '</td>';
     97                        echo '<td>' . wp_kses_post($data['currency']) . ' ' . number_format($data['min_purchase'], 2) . '</td>';
     98                        echo '<td>' . wp_kses_post($data['currency']) . ' ' . number_format($data['max_purchase'], 2) . '</td>';
     99                        echo '<td>' . esc_html($data['last_purchase']->date('Y-m-d')??'') . '</td>';
    98100                        echo '<td>' . esc_html($data['total_orders']) . '</td>';
    99                         echo '<td>' . esc_html($data['currency']) . ' ' . number_format($data['total_amount'], 2) . '</td>';
     101                        echo '<td>' . wp_kses_post($data['currency']) . ' ' . number_format($data['total_amount'], 2) . '</td>';
    100102                        echo '</tr>';
    101103                    }
Note: See TracChangeset for help on using the changeset viewer.