• Hi,

    I have problem with using ACF Gallery with Woocomerce Product Filtering. When I am searching product by its attribute everything is ok, ACF Gallery of colors under text is displayed:

    Colors displayed

    Problem occurs when I try to search by text (Woocommerce Product Filtering), I wrote the name of the product:

    Problem with displaying ACF Gallery

    Colors under text are not displaying, I am getting:
    Illegal string offset ‘url’ in woocommerce/content-product.php

    My code there is:

    $images = get_field('colors');
    
    if( $images ) { ?>
            <?php 
    		for ($i = 0;$i < count($images) && $i < 38;$i++) { ?>
            
    		<img src="<?php echo $images[$i]['sizes']['thumbnail']; ?>" alt="<?php echo $images[$i]['alt']?>" />         
       <?php } ?>  
    <?php } ?>
    • This topic was modified 7 years, 9 months ago by bienio.
Viewing 1 replies (of 1 total)
  • Thread Starter bienio

    (@bienio)

    Problem still not solved.

    I did var_dump on array $images.

    When searching by string (by the name of product) array is not showing right data.
    Img1

    When I am searching by attributes (as I mentioned, I am using this plugin WOOF Product Filtering for Woocommerce, attributes of products such as material, ect. are signed to the products) everything is okay, I am getting:
    Img2

    Full array with every data as it should be (below are also color images).

    So when I am searching by string I’ve got illegal string offset, array is not showing right data, images are missing.

    When I am searching by attributes everything is okay.

    Anyone have an idea how can I solve it? Help will be greatly appreciated.

Viewing 1 replies (of 1 total)
  • The topic ‘ACF Gallery and searching by text: Illegal string offset (Woocommerce, WOOF)’ is closed to new replies.