seikan / Cart

A simple PHP shopping cart class to use in ecommerce web applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why Double Array?

giugit opened this issue · comments

I'm finding your cart very interesting, i wondered why the product are inside a double array?
I'm curious to kown the reason. Thank You Very Much!

Array
(
    [1] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [quantity] => 1
                    [hash] => 82aa6954b3eecf592b1e8fb86063fd80
                    [attributes] => Array
                        (
                            [price] => 349
                            [color] => Silver
                        )

                )

        )

    [2] => Array
        (
            [0] => Array
                (
                    [id] => 2
                    [quantity] => 1
                    [hash] => a4da6514bfe02e8b9ad747387005561a
                    [attributes] => Array
                        (
                            [price] => 449
                            [color] => Silver
                            [size] => Small
                        )

                )

        )

)

OK I understood, is about the same product with different hash! ;-) Thanks