Problem with Serials Counter on Front End Vendor view

  • Posts: 128
  • Thank you received: 2
7 years 5 months ago #253390

-- HikaShop version -- : 2.6.4
-- HikaSerial version -- : 1.10.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6

Hi there,

There seems to be a problem with the counter on the serialsmarket Packs.php view. The number of serials that appear in this counters gets out of sync with the database.

Please see the wrong counters in the attached image



The right serial numbers can be seen in the back-end, please see the attached image

The backend numbers match the database numbers, pleasd attached table

File Attachment:

File Name: XXX_hikase...rial.csv
File Size:6 KB


I have noticed the following, the numbers in the front end are initially correct, however when I move an order in the backend into CANCELED or REFUNDED status, then the numbers in the front end start going wrong since they keep incrementing the number of serials when readjusting the status of the serials.

This ONLY happens when the order that I move in the backend into CANCELLED or REFUNDED was paid via MangoPay payment method. If the order had been paid with Bank Transfer or Stripe the the counters in the front end seem to readjust correctly

Thank you!

Attachments:

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 5 months ago #253392

Hi,

Can you please indicate the context ?
Are you using the main vendor or a vendor ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 128
  • Thank you received: 2
7 years 5 months ago #253413

A vendor in the front end. Then i edit the status of the main order in the backend. Only products from one vendor in the order.



What else do you need to know?

Last edit: 7 years 5 months ago by sabroso.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 5 months ago #253474

Hi,

Okay so your configuration is: a vendor who display statistics for a pack he is managing.

In the "serialmarket/view.html.php" file in HikaSerial you have to replace

	$or_filters = array();

	if(!empty($own_packs)) {
		$or_filters[] = 'serial.serial_pack_id IN ('.implode(',', $own_packs).')';
	}
	if(!empty($other_packs)) {
		$or_filters[] = 'serial.serial_pack_id IN ('.implode(',', $other_packs).') AND hk_order.order_type = '.$db->Quote('subsale').' AND hk_order.order_vendor_id = '.(int)$target_vendor_id.'';
	}
By
	$or_filters = array();
	$join_types = array();

	if(!empty($own_packs)) {
		$or_filters[] = 'serial.serial_pack_id IN ('.implode(',', $own_packs).') AND (hk_order.order_type = '.$db->Quote('sale').' OR hk_order.order_type IS NULL)';
		$join_types[] = 'serial.serial_order_id = hk_order.order_id';
	}
	if(!empty($other_packs)) {
		$or_filters[] = 'serial.serial_pack_id IN ('.implode(',', $other_packs).') AND hk_order.order_type = '.$db->Quote('subsale').' AND hk_order.order_vendor_id = '.(int)$target_vendor_id.'';
		$join_types[] = 'serial.serial_order_id = hk_order.order_parent_id';
	}

And then
' LEFT JOIN '.hikaserial::table('shop.order').' AS hk_order ON (serial.serial_order_id > 0 AND serial.serial_order_id = hk_order.order_parent_id) '.
By
' LEFT JOIN '.hikaserial::table('shop.order').' AS hk_order ON (serial.serial_order_id > 0 AND ('.implode(' OR ', $join_types).')) '.

So it will unsure that the link made with the orders are made with "user orders" when the pack is managed and with only "vendor orders" when the pack is not managed.
Because the link was only with the vendor orders ; by having several "vendor refund" in the database, it was affecting the count of the serials.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 128
  • Thank you received: 2
7 years 5 months ago #253513

Thank you, this is working now OK

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

Moderators: Obsidev
Time to create page: 0.078 seconds
Powered by Kunena Forum