- Posts: 171
- Thank you received: 9
Modify order on frontend issues
- pepecortez
-
Topic Author
- Offline
Less
More
12 years 2 months ago #164423
by pepecortez
Modify order on frontend issues was created by pepecortez
Hi Jerome,
Our shop is configured as all the products are orderable, and at checkout, user can choose from a vendor dropdown who to "connect" with. Configuration is set to use the same order number for sale and subsale as well. In that way 2 orders are created in the database (sale+subsale), but it looks the same on frontend as we just see the order number. Main vendor and user (who made the order) see the sale type order, subvendor see the subsale type order. Till that point working process logics is clear and working OK.
Just a few questions:
1.) I can edit the order now just with the MAIN vendor on FRONTEND: modify product fields/quantiites or delete them. Editing the ordered items works correctly, and saves after page refresh. But! The order with the same order number - but with type subsale - is not updated to the same. Shouldn't this have to work like that, I mean modifing any of the orders should modify the connected subsale as well?
2.) In an earlier forum post we talked over, that in frontend subvendor can not make changes because there could be other vendors' products in the order as well. This is not an option for us, because the above written lines. Could we let the subvendor to modify the products (at least quantity and customfields) as well in the order? And of course if my logic in point 1.) is right, could we connect somehow the not just the sale-subsale update relation but the subsale-sale update direction as well?
3.) For me when I push "Delete" button next to the ordered item in the order list, the loader is spinning and spinning and never stops. Also the deleted item just get non-displayed when page is reloaded. I'm getting this on Firebug console when pushing OK on "Are you sure you want to delete?"
What can cause this?
4.) (Feature) When deleting an item from order list, could we at least put a line in the "History" that "Product X has been deleted"
Our shop is configured as all the products are orderable, and at checkout, user can choose from a vendor dropdown who to "connect" with. Configuration is set to use the same order number for sale and subsale as well. In that way 2 orders are created in the database (sale+subsale), but it looks the same on frontend as we just see the order number. Main vendor and user (who made the order) see the sale type order, subvendor see the subsale type order. Till that point working process logics is clear and working OK.
Just a few questions:
1.) I can edit the order now just with the MAIN vendor on FRONTEND: modify product fields/quantiites or delete them. Editing the ordered items works correctly, and saves after page refresh. But! The order with the same order number - but with type subsale - is not updated to the same. Shouldn't this have to work like that, I mean modifing any of the orders should modify the connected subsale as well?
2.) In an earlier forum post we talked over, that in frontend subvendor can not make changes because there could be other vendors' products in the order as well. This is not an option for us, because the above written lines. Could we let the subvendor to modify the products (at least quantity and customfields) as well in the order? And of course if my logic in point 1.) is right, could we connect somehow the not just the sale-subsale update relation but the subsale-sale update direction as well?
3.) For me when I push "Delete" button next to the ordered item in the order list, the loader is spinning and spinning and never stops. Also the deleted item just get non-displayed when page is reloaded. I'm getting this on Firebug console when pushing OK on "Are you sure you want to delete?"
Code:
Uncaught TypeError: undefined is not a function
index.php?option=com_hikamarket&ctrl=order&task=show&cid=340&Itemid=152:566
(anonymous function)
index.php?option=com_hikamarket&ctrl=order&task=show&cid=340&Itemid=152:566
xhr.onreadystatechange
hikashop.js?v=232:320
What can cause this?
4.) (Feature) When deleting an item from order list, could we at least put a line in the "History" that "Product X has been deleted"
Please Log in or Create an account to join the conversation.
12 years 2 months ago #164494
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Modify order on frontend issues
Hi,
1) Some improvements has been made in the integration with HikaShop backend for the order edition.
I don't know which modifications you made exactly in the front-end with HikaMarket but most of modifications should be made on the sub sale too.
The new interface in HikaShop backend to select a vendor and set the vendor price for a product will be include in the HikaMarket front-end too. We wanted to be sure that the backend interface is working good so we can duplicate it in the front-end.
2) Modifying custom field if there is just one single vendor, is something which can be added.
Modifying a product quantity is too less secured to be authorized in HikaMarket.
Because changing the quantity of a product will change the total of the order and so, will change the vendor price.
3) When you delete a product, two functions are called once the ajax call is made.
These two functions are also called when you set a modify a product so it is strange that you just have the problem there.
4) I add it in our TODO list.
Regards,
1) Some improvements has been made in the integration with HikaShop backend for the order edition.
I don't know which modifications you made exactly in the front-end with HikaMarket but most of modifications should be made on the sub sale too.
The new interface in HikaShop backend to select a vendor and set the vendor price for a product will be include in the HikaMarket front-end too. We wanted to be sure that the backend interface is working good so we can duplicate it in the front-end.
2) Modifying custom field if there is just one single vendor, is something which can be added.
Modifying a product quantity is too less secured to be authorized in HikaMarket.
Because changing the quantity of a product will change the total of the order and so, will change the vendor price.
3) When you delete a product, two functions are called once the ajax call is made.
Code:
window.orderMgr.updateAdditionals();
window.orderMgr.updateHistory();
4) I add it in our TODO list.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- pepecortez
-
Topic Author
- Offline
Less
More
- Posts: 171
- Thank you received: 9
12 years 1 month ago #169218
by pepecortez
Replied by pepecortez on topic Modify order on frontend issues
For 4) add history when delete, I tried to solve it myself with this in com_hikamarket/controllers/order.php in function product_delete:
As I see it solves my problem temporary, but I'm unable to add the deleted ordered_product to it ($tetel). Tried it with retrieving from link, but with no success. Could give me a point how to load the deleted product?
Code:
$classorder = hikashop_get('class.order');
$classhistory = hikashop_get('class.history');
$classuser = hikashop_get('class.user');
$orderProductClass = hikashop_get('class.order_product');
$user_id = hikashop_loadUser();
$order_id = hikamarket::getCID('order_id');
$order_product_id = JRequest::getVar('order_product_id');
$order = $classorder->get($order_id);
$tetel = $orderProductClass->get($order_product_id);
$newHistoryObj = new stdClass();
$newHistoryObj->history_order_id = $order_id;
$newHistoryObj->history_created = time();
$newHistoryObj->history_ip = $_SERVER['REMOTE_ADDR'];
$newHistoryObj->history_new_status = $order->order_status;
$newHistoryObj->history_reason = 'Delete ordered product';
$newHistoryObj->history_data = $tetel->order_product_quantity.' pieces '.$tetel->order_product_name;
$newHistoryObj->history_notified = false;
$newHistoryObj->history_type = 'modification';
$newHistoryObj->history_user_id = $user_id;
$classhistory->save($newHistoryObj);
As I see it solves my problem temporary, but I'm unable to add the deleted ordered_product to it ($tetel). Tried it with retrieving from link, but with no success. Could give me a point how to load the deleted product?
Please Log in or Create an account to join the conversation.
12 years 1 month ago #169227
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Modify order on frontend issues
Hi,
The best will be to set the order history in the HikaMarket order class.
You will find the section in the front saving function with
In this part of the function you have to update the " $order->history " object ; the save of the order will be made automatically at the end of the function ; you just have to fill the data.
Translation:
Even if there is an History class in HikaShop, the easier is to use the order class which manage the "history" object in the order object.
The best will be to set the order history in the HikaMarket order class.
You will find the section in the front saving function with
Code:
if(!empty($task) && $task == 'product_delete' && (!$acl || hikamarket::acl('order_edit_products')) ) {
Code:
$order->history->history_reason = 'Delete order product';
$order->history->history_data = JText::sprintf('HIKAM_ORDER_PRODUCT_REMOVED', $order_product->order_product_name, $order_product->product_id);
Translation:
Code:
HIKAM_ORDER_PRODUCT_REMOVED="Product %s (%s) removed"
Even if there is an History class in HikaShop, the easier is to use the order class which manage the "history" object in the order object.
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: pepecortez
Please Log in or Create an account to join the conversation.
- pepecortez
-
Topic Author
- Offline
Less
More
- Posts: 171
- Thank you received: 9
12 years 1 month ago #169254
by pepecortez
Replied by pepecortez on topic Modify order on frontend issues
Thank you!
I also added quantity as well, so the final solution is:
Language code:
In Hikamarket order class:
I also added quantity as well, so the final solution is:
Language code:
Code:
HIKAM_ORDER_PRODUCT_REMOVED="%s piece(s) %s product(s) (ID: %s) deleted from order"
In Hikamarket order class:
Code:
$order->history->history_reason = 'Delete order product';
$order->history->history_data = JText::sprintf('HIKAM_ORDER_PRODUCT_REMOVED', $order_product->order_product_quantity, $order_product->order_product_name, $order_product->product_id);
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.173 seconds