Jump to content

Recommended Posts

hey thanks seems to be getting somewhere it just seems to be showing a load of images though for some reason you can see the on compareandchoose.com.au/shopping.php

 

 

I have attached the full page code for clairity sake

 

 

 

once again I personally thank you

shopping.php

 This code is looping over the images stored in the imageList array

        // display product images
        echo '<p><b>Images: </b>';

        $imageListKey = ($key == 'offer') ? 'imageList' : 'images';
        foreach($item[$key][$imageListKey]['image'] as $image)
        {
            echo '<img src="'.$image['sourceURL'].'" />   ';
        }
        echo '</p>';

If you only want to display one image size, say a 200px x 200px image of the product then replace the above code with

echo '<p><b>Image: </b><img src="'.$item[$key][$imageListKey]['image'][1]['sourceURL'].'" /></p>';
Edited by Ch0cu3r

That seems to have done it and extracted the images, thanks again, although I have no idea what is happening lol these multidimensional arrays are frying my brain

 

I just have to figure out how to get the minimum price in the array and why some of the Buy froms and Manufacturers are blank after all I am aiming along the lines of 3 products found, prices from $$$ then click compare which shows the different stores prices if you know what I mean

 [2] => Array
                                                (
                                                    [name] => Store
                                                    [attributeURL] => http://www.au.shopping.com/washing-machines/washing-machine/products~all-store~MS-1?oq=washing_machine&linkin_id=8084586
                                                    [attributeValues] => Array
                                                        (
                                                            [attributeValue] => Array
                                                                (
                                                                    [0] => Array
                                                                        (
                                                                            [name] => Appliances Online
                                                                            [attributeValueURL] => http://www.au.shopping.com/washing-machines/washing-machine+store-appliances-online-4114784/products~linkin_id-8084586
                                                                            [id] => store_appliances_online_4114784
                                                                            [matchingItemsCount] => 76
                                                                        )

                                                                    [1] => Array
                                                                        (
                                                                            [name] => Masters Home Improvement
                                                                            [attributeValueURL] => http://www.au.shopping.com/washing-machines/washing-machine+store-masters-home-improvement-9689/products~linkin_id-8084586
                                                                            [id] => store_masters_home_improvement_9689
                                                                            [matchingItemsCount] => 19
                                                                        )

                                                                    [2] => Array
                                                                        (
                                                                            [name] => The Good Guys
                                                                            [attributeValueURL] => http://www.au.shopping.com/washing-machines/washing-machine+store-the-good-guys/products~linkin_id-8084586
                                                                            [id] => store_the_good_guys
                                                                            [matchingItemsCount] => 3
                                                                        )

                                                                    [3] => Array
                                                                        (
                                                                            [name] => Mr Appliance
                                                                            [attributeValueURL] => http://www.au.shopping.com/washing-machines/washing-machine+store-mr-appliance-9689/products~linkin_id-8084586
                                                                            [id] => store_mr_appliance_9689
                                                                            [matchingItemsCount] => 3
                                                                        )

                                                                )

                                                            [matchedValueCount] => 4
                                                            [returnedValueCount] => 4

Hi Ch0cu3r

 

I aint touch any of the code since you last mailed me but I have noticed that in the array its trying to out put the store name but I only seem to get on store even though there are 4 stores in there as shown

 

Any ideas why its only showing appliances online and not the rest?

 

again for clarity sake I have attached the page code, but to be fair I have never changed anything

 

 

Thanks

Alan

 

 

shopping.php

My code does not use that store array for displaying the store name.

 

This code only displays the store, if the current item has a store array defined, hence the if statement

        // the store logo and name
        echo '<p><b>Buy From: </b>';
        if(isset($item[$key]['store']))
        {
            echo '<img src="'.$item[$key]['store']['logo']['sourceURL'].'" /> ' .$item[$key]['store']['name'] .'</p>';
        }

Hi again

 

Still baffled with this array

 

how do I actually drill down to the min price and number of stores in the array so I can show in format like this

 

 

item, description, number of stores, prices from, CompareButton(which goes to the stores)

 

 

thanks in advance

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.