- Posts: 128
- Thank you received: 2
Problem with Serials Counter on Front End Vendor view
9 years 11 months ago #253390
by sabroso
Problem with Serials Counter on Front End Vendor view was created by sabroso
-- 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
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!
-- 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
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
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!
Please Log in or Create an account to join the conversation.
9 years 11 months ago #253392
by Jerome
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.
Replied by Jerome on topic Problem with Serials Counter on Front End Vendor view
Hi,
Can you please indicate the context ?
Are you using the main vendor or a vendor ?
Regards,
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.
9 years 11 months ago - 9 years 11 months ago #253413
by sabroso
Replied by sabroso on topic Problem with Serials Counter on Front End Vendor view
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?
What else do you need to know?
Last edit: 9 years 11 months ago by sabroso.
Please Log in or Create an account to join the conversation.
9 years 11 months ago #253474
by Jerome
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.
Replied by Jerome on topic Problem with Serials Counter on Front End Vendor view
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
By
And then
By
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,
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
Code:
$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.'';
}
Code:
$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
Code:
' 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) '.
Code:
' 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.
9 years 11 months ago #253513
by sabroso
Replied by sabroso on topic Problem with Serials Counter on Front End Vendor view
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.245 seconds