I am working in a shopping cart, so that the customer can access the shopping cart needs to be registered, when the client starts session I create a variable $ _SESSION ['Client'] from which I extract certain data that previously registered, if the customer adds products to his shopping cart, then the variable $ _SESSION ['purchases'] is created. My idea is that when the client clicks on the buy button, this is sent to a php file where the purchase data is inserted into a table, here comes the problem. I want the data of the $ _SESSION ['Client'] to be in every $ _SESSION ['purchases'].
For example, This is the arrray that exists in $ _SESSION ['purchases'].
Array
(
[0] => Array
(
[Id] => 4
[Nombre] => Kit 2
[Precio] => 259
[Imagen] => sese.jpg
[Cantidad] => 1
)
[1] => Array
(
[Id] => 5
[Nombre] => Kit 3
[Precio] => 385
[Imagen] => ripo.png
[Cantidad] => 1
)
)
And the data that you get from the client that was given a login is in the following array.
Array
(
[0] => Array
(
[Nombre] => Raul Leyva
[Telefono] => 614-123-4567
[Ciudad] => chihuas
[Estado] => chihuas
[Pais] => mehico
)
)
What I want to do, would be the following:
Array
(
[0] => Array
(
[Id] => 4
[Nombre] => Kit 2
[Precio] => 259
[Imagen] => sese.jpg
[Cantidad] => 1
[Nombre] => Raul Leyva
[Telefono] => 614-123-4567
[Ciudad] => chihuas
[Estado] => chihuas
[Pais] => mehico
)
[1] => Array
(
[Id] => 5
[Nombre] => Kit 3
[Precio] => 385
[Imagen] => ripo.png
[Cantidad] => 1
[Nombre] => Raul Leyva
[Telefono] => 614-123-4567
[Ciudad] => chihuas
[Estado] => chihuas
[Pais] => mehico
)
)
my doubt is how together the arrays in that way. thanks