Jump to content

Edit History

andtrx

andtrx


added tags to post

I have the following situation:

1. in a 3rd party a client can update a order I sent when it was created in the prestashop website.
2. I check via a cron job if the order has been updated in the 3rd party software and I pull it back in our website.
3. If they added products via the 3rd party software, should I remove all of my products from my order and re-create the order with the products from theirs? Or I can simple update and add what is missing?

Currently my codes empties the cart and re-ads the prodcuts. I have all that taken care of.

I have an issue though, where the order detail products are not emptied out. I cant find a method that does this.
$listOfProducts below shows me the current products that are in the order details, but I dont know how to empty that out.
 

                        $listOfproducts = OrderDetail::getList((int)$order->NumarComanda);


                        $order_detail = new OrderDetail(null, null, null);
                        $order_detail->createList($prestashopOrder, $cart, 4, $cartProducts);
                        $order_detail_list[] = $order_detail;

$order_detail->createList($prestashopOrder, $cart, 4, $cartProducts); 

Simply add the new products to the order details, but the old ones are not emptied so I end up with the correct price of the order but with too many being shown in the product details.

andtrx

andtrx


added tags to post

I have the following situation:

1. in a 3rd party a client can update a order I sent when it was created in the prestashop website.
2. I check via a cron job if the order has been updated in the 3rd party software and I pull it back in our website.
3. If they added products via the 3rd party software, should I remove all of my products from my order and re-create the order with the products from theirs? Or I can simple update and add what is missing?

Currently my codes empties the cart and re-ads the prodcuts. I have all that taken care of.

I have an issue though, where the order detail products are not emptied out. I cant find a method that does this.
$listOfProducts below shows me the current products that are in the order details, but I dont know how to empty that out.
 

                        $listOfproducts = OrderDetail::getList((int)$order->NumarComanda);


                        $order_detail = new OrderDetail(null, null, null);
                        $order_detail->createList($prestashopOrder, $cart, 4, $cartProducts);
                        $order_detail_list[] = $order_detail;

$order_detail->createList($prestashopOrder, $cart, 4, $cartProducts); 

Simply add the new products to the order details, but the old ones are not emptied so I end up with the correct price of the order but with too many being shown in the product details.

andtrx

andtrx

I have the following situation:

1. in a 3rd party a client can update a order I sent when it was created in the prestashop website.
2. I check via a cron job if the order has been updated in the 3rd party software and I pull it back in our website.
3. If they added products via the 3rd party software, should I remove all of my products from my order and re-create the order with the products from theirs? Or I can simple update and add what is missing?

Currently my codes empties the cart and re-ads the prodcuts. I have all that taken care of.

I have an issue though, where the order detail products are not emptied out. I cant find a method that does this.
$listOfProducts below shows me the current products that are in the order details, but I dont know how to empty that out.
 

                        $listOfproducts = OrderDetail::getList((int)$order->NumarComanda);


                        $order_detail = new OrderDetail(null, null, null);
                        $order_detail->createList($prestashopOrder, $cart, 4, $cartProducts);
                        $order_detail_list[] = $order_detail;

$order_detail->createList($prestashopOrder, $cart, 4, $cartProducts); 

Simply add the new products to the order details, but the old ones are not emptied so I end up with the correct price of the order but with too many being shown in the product details.

×
×
  • Create New...