Jump to content

[WEB SERVICE CART] Delivery Options


mattiaPharmafox

Recommended Posts

Hi!

 

When I submit a Cart on webservice I need to specify the "delivery_options", this field is a string composed as follows:

 

a:1:{i:9;s:2:"2,";} 

 

My problem is what specify after "s:"

 

a:1 => first row

i:9 => id_adress of delivery

"2," => id_carrier 

s:2 => WHAT IS THAT MEAN?

 

Thanks so much

 

Mattia

  • Like 1
Link to comment
Share on other sites

  • 9 months later...
  • 2 years later...

Hello everyone,

To begin the 'delivery_options' is saved as the following example:

serialize(array(
	9 => "2,"
));

So if you execute this simple code you will get what you asked for before.

To be more clear :

a:1 => means that there one array

i:9 => means that there is an integer and the value is 9

s:2 => this means that a string of length 2 and the value in the next row wich is the id carrier

"2," => id_carrier

BUT

in new versions of Prestashop the serialize was replaced by json_encode so will find another expression in your case it will look like

{"9":"2,"}

I hope i was clear.

 

Edited by gabtnim (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...