- Posts: 59
- Thank you received: 2
HikaSerial/HikaShop product quantity not working
13 years 9 months ago - 13 years 9 months ago #80303
by d2dpcs
HikaSerial/HikaShop product quantity not working was created by d2dpcs
I linked the product quantity between HikaShop and HikaSerial successfully. While testing the import of serials, the product quantity updated properly. When I deleted the serials I used while testing the imports, the product quantity DID NOT update properly. They are removed from the Serials list, but the number of products is not lowered in the backend or frontend.
Edit: Removing quantity, and saving, when viewing product in HikaShop fixed the issue. I would rather not have to do this, though.
Thanks,
Eric
Edit: Removing quantity, and saving, when viewing product in HikaShop fixed the issue. I would rather not have to do this, though.
Thanks,
Eric
Last edit: 13 years 9 months ago by d2dpcs. Reason: marked solved
Please Log in or Create an account to join the conversation.
13 years 9 months ago - 13 years 9 months ago #80326
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 HikaSerial/HikaShop product quantity not working
Hi,
Thansk for the report.
I have made a patch which would be in the next release (1.5.1)
You can edit the file "administrator/com_hikaserial/classes/serial.php" and update the delete function.
You just have to add two line just before the end of the function
With it, the product quantity link would be reprocess (synchronize) each time a serial is deleted.
Regards,
Thansk for the report.
I have made a patch which would be in the next release (1.5.1)
You can edit the file "administrator/com_hikaserial/classes/serial.php" and update the delete function.
You just have to add two line just before the end of the function
Code:
public function delete($elements) {
//
// Content of the "delete" function.
//
// Update product quantity - Just add these two lines at the end of the function, before the last "return".
$productClass = hikaserial::get('class.product');
$productClass->refreshQuantities();
return $result;
}
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.
Last edit: 13 years 9 months ago by Jerome.
Please Log in or Create an account to join the conversation.
13 years 9 months ago - 13 years 9 months ago #80437
by d2dpcs
Replied by d2dpcs on topic HikaSerial/HikaShop product quantity not working
Thanks for the immediate response as always. I edited the file with your two lines before, and outside, the return false bracket (received error upon deleting serial) and within the bracket like below (serial deleted, but did not update product quantity). Thanks, Eric.
Code:
public function delete($elements) {
if(!is_array($elements)) {
$elements = array($elements);
}
$config = hikaserial::config();
JPluginHelper::importPlugin('hikaserial');
$dispatcher = JDispatcher::getInstance();
$do = true;
$dispatcher->trigger('onBeforeSerialDelete', array(&$elements, &$do));
if(!$do) {
$productClass = hikaserial::get('class.product');
$productClass->refreshQuantities();
return false;
}
Last edit: 13 years 9 months ago by Jerome.
The following user(s) said Thank You: Jerome
Please Log in or Create an account to join the conversation.
13 years 9 months ago #80703
by d2dpcs
Replied by d2dpcs on topic HikaSerial/HikaShop product quantity not working
Jerome, I see that you thanked me, but didn't address the fact that it didn't work for me. I'm just writing this to let you know that a little bit of clarification is needed. Thanks, Eric.
Please Log in or Create an account to join the conversation.
13 years 9 months ago #80710
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 HikaSerial/HikaShop product quantity not working
Hi,
Sorry, I misunderstood your previous message.
After using the code tag on your tag, I see that your modification is not the right one.
The code should be at the end of the function, at the "real" end.
Regards,
Sorry, I misunderstood your previous message.
After using the code tag on your tag, I see that your modification is not the right one.
The code should be at the end of the function, at the "real" end.
Code:
$dispatcher->trigger('onAfterSerialDelete', array(&$elements));
}
// Update product quantity
//
$productClass = hikaserial::get('class.product');
$productClass->refreshQuantities();
return $result;
}
public function consume($serial_id, $extra_data = null, $checkUser = true) {
$app = JFactory::getApplication();
$config = hikaserial::config();
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.
The following user(s) said Thank You: d2dpcs
Please Log in or Create an account to join the conversation.
13 years 9 months ago #80713
by d2dpcs
Replied by d2dpcs on topic HikaSerial/HikaShop product quantity not working
Yes, that worked for me. Thanks for the clarification.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.195 seconds