Items quantities for session not updating
Hi everybody. I am new in this forum.
I am having a problem, the alter function for update quantity for an item for the session is not updating and IDK why.
this is the code:
$booking->alter( array(1=>3));
Here I am using the alter function, sending the line_id item and the new quantity. But seems that is not updating.
I followed the code to the root, and the api call is being made. With my data.
I receive a OK response with a bunch of data. but quantity is not updating.
Idk why exactly.
I am having a problem, the alter function for update quantity for an item for the session is not updating and IDK why.
this is the code:
$booking->alter( array(1=>3));
Here I am using the alter function, sending the line_id item and the new quantity. But seems that is not updating.
I followed the code to the root, and the api call is being made. With my data.
I receive a OK response with a bunch of data. but quantity is not updating.
Idk why exactly.
Comments
To alter the quantities of non-"simple priced" items in a session, you will have to perform a new item request with updated parameters, remove the old entry from the session (alter[line_id]=remove), and add the new slip. This allows a complete availability and pricing check to be run to ensure that the item can be added to the booking correctly.
If you have optional package items in your session (they'll be shown in all session responses), you can use the alter[line_id]=optin and alter[line_id]=optout functions to determine if they should be included. For non-"simple priced" items, these will be added using the parameter input of the parent item's request; there is however a parameter remapping capability being added to the package setup in our next release.
$data=array(
"session_id"=>$response['booking']['session']['id'],
'slip'=>$slips,
"alter"=> array(
1=>"remove"
)
);
$response=$this->Checkfront->post("booking/session",$data);
$data=array(
"session_id"=>$response['booking']['session']['id'],
'slip'=>$slips,
"alter"=> array(
1 => 7
)
);
for change the qty of the first product from 1 (default) to 7... but this not work.
What is broken? Thank you
For a "simple priced" item, if the first call were not being made to remove the line, the quantity alteration would apply.
If the item isn't "simple priced", and therefore requires a complex availability request, you will need to remove it, perform a new item query with the dates and parameters to get a rated response with a SLIP. You can then add that SLIP into the existing session.