Report showing incorrect amount

  • Posts: 276
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
3 days 20 hours ago #366869

-- url of the page with the problem -- : eop-inc.com
-- HikaShop version -- : 5.1.6
-- Joomla version -- : 3.10.12
-- PHP version -- : 8.2.28
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : n/a

I've taken the "Weekly Performance" report and turned it into an annual report. It is showing one category as having over $30,000 worth of sales when it has only had about $1,200. Other categories appear to be correct. Where could this innacuracy possibly be coming from?

My report settings are:
Display: Type: Listing, Date Type: Created, Period 2025-01-01 to 2025-12-31
Filters: Order Status: Confirmed, Including Sub Categories Yes (No shows same result)
Options: Limit:100

All other settings are still at defualt

Please Log in or Create an account to join the conversation.

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
3 days 16 hours ago #366871

Hi,

You're not providing the full picture. If you really used the "weekly performance" report and changed its display type to "listing" without changing its "type" from "sales" to something else, the report will display a listing of your orders in that period of time.
There will be no sums of sales, and no category information displayed.
Did you change the type to "categories" ?
Could you please provide a screenshot of the settings of your report ?
Could you activate the "debug" setting of the Joomla configuration, and on the page of the report settings, look at the debug at the bottom and provide the MySQL queries there ? At least the one loading the data of the report.

Please Log in or Create an account to join the conversation.

  • Posts: 276
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
3 days 14 hours ago #366875

Sorry yes, Categories
snipboard.io/sJU20j.jpg

There are 55 queries being shown in the debug, not sure which one you need.

Please Log in or Create an account to join the conversation.

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
3 days 6 hours ago #366876

Hi,

Since the report is calculating sales, search for the MySQL query on the hikashop_order table. There should be only one on this page so if you search for "hikashop_order" you should directly find it.

Please Log in or Create an account to join the conversation.

  • Posts: 276
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
3 days 3 hours ago #366878

Is this the one you are looking for?

#32
SELECT *, SUM(order_full_price) as Total
FROM josdh_hikashop_order as a
LEFT JOIN josdh_hikashop_order_product as prod
ON a.order_id=prod.order_id
LEFT JOIN josdh_hikashop_product AS p
ON p.product_id=prod.product_id
LEFT JOIN josdh_hikashop_product_category as cat
ON cat.product_id=p.product_id OR cat.product_id=p.product_parent_id
LEFT JOIN josdh_hikashop_category as c
ON cat.category_id=c.category_id
WHERE a.order_type='sale'
AND a.order_status IN ('confirmed')
AND a.order_created > 1735707600
AND a.order_created < 1767157200
GROUP BY c.category_id
ORDER BY Total DESC
LIMIT 100

Please Log in or Create an account to join the conversation.

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
1 day 5 hours ago #366890

Hi,

Great. That's exactly what I needed.
I understand the problem. The issue is that in this specific case, the system takes into account the total amount of the order, even if only one product from the category is in the order. This can result is greatly over inflated numbers, especially on websites where users normally purchase products from different categories at the same time.
On our website for example, that's usually not the case. Users usually purchase only one extension at a time and so I didn't see any problem on my side.
I've made a patch for this. Download the install package of HikaShop on our website and install it on yours and you'll get the patch. It should then display proper numbers.

Please Log in or Create an account to join the conversation.

  • Posts: 276
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
1 day 1 hour ago #366894

I'll run it by the site owner for confirmation, but that looks so much better, thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum