Items quantities for session not updating

edited February 2015 in Developers
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.

Comments

  • edited March 2015
    Specifying a quantity for a line in the alter parameter in a booking/session request is only supported for simple priced items, typically those included in package attachments. You can enabled "simple pricing" for items under the "Pricing" tab -- this will however disable any pricing mechanisms beyond the simple quantity multiplier.

    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.
  • Hello: i have tried with PHP SDK with the follow code

    $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
  • If you're running the above as listed, and sending the second $data array, what it would appear to be doing is removing the first line, then attempting to set a quantity on it.

    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.
Sign In or Register to comment.