Resolved: issues while creating order from webservice api

This commit is contained in:
Sumit Panwar
2023-03-31 14:32:00 +05:30
parent 087f69a88d
commit bee9b42694
2 changed files with 8 additions and 4 deletions

View File

@@ -4817,12 +4817,12 @@ class CartCore extends ObjectModel
);
if ($hotelRoomData = $objBookingDetail->dataForFrontSearch($bookingParams)) {
// unset already added rooms to cart as per sepcific parametrs
if (isset($hotelRoomData['rm_data'][0]['data']['available']) && $hotelRoomData['rm_data'][0]['data']['available']) {
foreach ($hotelRoomData['rm_data'][0]['data']['available'] as $keyRoom => $roomInfo) {
if (isset($hotelRoomData['rm_data'][$idProduct]['data']['available']) && $hotelRoomData['rm_data'][$idProduct]['data']['available']) {
foreach ($hotelRoomData['rm_data'][$idProduct]['data']['available'] as $keyRoom => $roomInfo) {
if (isset(
$roomsAddedToCart[strtotime($dateFrom).'_'.strtotime($dateTo).'_'.$objCart->id.'_'.$roomInfo['id_product'].'_'.$roomInfo['id_room']]
)) {
unset($hotelRoomData['rm_data'][0]['data']['available'][$keyRoom]);
unset($hotelRoomData['rm_data'][$idProduct]['data']['available'][$keyRoom]);
$hotelRoomData['stats']['num_avail'] -= 1;
}
}

View File

@@ -259,6 +259,8 @@ class OrderCore extends ObjectModel
),
);
// This variable is created to hold the transaction id received from api order
public $transaction_id;
protected $webserviceParameters = array(
'objectMethods' => array('add' => 'addWs'),
'objectNodeName' => 'order',
@@ -1634,7 +1636,9 @@ class OrderCore extends ObjectModel
$customer = new Customer($this->id_customer);
$extraVars = array();
$extraVars['transaction_id'] = $this->transaction_id;
if (isset($this->transaction_id)) {
$extraVars['transaction_id'] = $this->transaction_id;
}
if ($this->total_paid_real > 0) {
$orderStatus = Configuration::get('PS_OS_REMOTE_PAYMENT_ACCEPTED');