Jump to content

[SOLVED] Need desperate help with a complicated array


foreverdita

Recommended Posts

OK, I got as far as to print out my array in a readable format:

 

Array

(

    [169:67700e59c283ae4bc5550efa3e273762] => Array

        (

            [qty] => 21

            [attributes] => Array

                (

                    [1] => 79

                )

 

        )

 

    [412] => Array

        (

            [qty] => 1

        )

 

    [151:e8ca3ed62287fae344adf76181387670] => Array

        (

            [qty] => 1

            [attributes] => Array

                (

                    [1] => 1

                )

 

        )

 

    [55] => Array

        (

            [qty] => 1

        )

 

)

 

The actual array used (to get this far and print out the above is:

 

 

function print_r_html ($arr) {

        ?><pre><?

        print_r($arr);

        ?></pre><?

}

 

print_r_html($_SESSION['cart']->contents);

 

 

What I have left to do is to grab this:

[169:67700e59c283ae4bc5550efa3e273762] => Array

        (

            [qty] => 21

            [attributes] => Array

                (

                    [1] => 79

                )

 

        )

 

and update the attributes array to a different number.  I cannot for the life of me figure out how to do this.  Is there anyone that can help?

 

 

so in other words, this:

 

[169:67700e59c283ae4bc5550efa3e273762] => Array

        (

            [qty] => 21

            [attributes] => Array

                (

                    [1] => 79

                )

 

        )

 

 

Would become this:

 

[169:67700e59c283ae4bc5550efa3e273762] => Array

        (

            [qty] => 21

            [attributes] => Array

                (

                    [1] => 105

                )

 

        )

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.