• Resolved itay13

    (@itay13)


    Hello,

    I activated the shop section for my front page but it is giving a message. I’m currently using xampp to test the site before I transfer to my host

    Warning: size of():Parameter must be an array or an object that implements Countable in C:\Xampp\htdocs\WP\wp-content\themes\hestia\inc\sections\hestia-shop-section.php on line 121

    The code on line 121 in that file is
    `if (size of($hestia_shop_categories)>=1 & & ! empty($hestia_shop_categories[0] ) ){‘

    How do I correct this?

    • This topic was modified 6 years, 10 months ago by itay13.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @itay13,

    Could you please try to replace this:

    if ( sizeof( $hestia_shop_categories ) >= 1 && ! empty( $hestia_shop_categories[0] ) ) {
    			array_push(
    				$args['tax_query'],
    				array(
    					'taxonomy' => 'product_cat',
    					'field'    => 'term_id',
    					'terms'    => $hestia_shop_categories,
    				)
    			);
    		}

    with:

    if ( ! empty( $hestia_shop_categories ) ) {
    			array_push(
    				$args['tax_query'],
    				array(
    					'taxonomy' => 'product_cat',
    					'field'    => 'term_id',
    					'terms'    => $hestia_shop_categories,
    				)
    			);
    		}

    and let me know if that’s ok?
    We’ll also add this in the next release, we are working on.
    Regards,
    Rodica

    I don’t know about itay13, but for me it worked!

    Thanks a lot, rodicaelena.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shop section on frontpage’ is closed to new replies.