Viewing 15 replies - 16 through 30 (of 44 total)
  • Hi. I have simillar issue. After update on some websites i have issue with product pre row/columns. can somebody tell me what was change in woocommerce templates in content-product.php or somewhere else to fix display product well ?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Naymapl Look for the code AndreNL posted above.

    Thanks for ansfer but I don`t know what I need to do with that ? Add this to functions.php ?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    No – look in your template files (in the theme) for that code.

    Or of course see if the theme author has a compatible update yet.

    @mike – I found taht in 2 files in my template. Change it for:
    if ( empty( $woocommerce_loop[‘columns’] ))

    and still this same:
    https://sklep.midu.pl

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Change what? Maybe you should share the file so I can actually see whats there.

    I change:

    if ( empty( $woocommerce_loop['columns'] ) ) {
    	$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 3 );
    }

    for

    if ( empty( $woocommerce_loop['columns'] ))

    here you have a full code of my file content-product.php:

    <?php
    /**
     * The template for displaying product content within loops.
     *
     * Override this template by copying it to yourtheme/woocommerce/content-product.php
     *
     * @author  WooThemes
     * @package WooCommerce/Templates
     * @version 2.4.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    global $product, $woocommerce_loop;
    
    // Store loop count we're currently on
    if ( empty( $woocommerce_loop['loop'] ) ) {
    	$woocommerce_loop['loop'] = 0;
    }
    
    // Store column count for displaying the grid
    if ( empty( $woocommerce_loop['columns'] ) ) {
    	$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 3 );
    }
    
    // Ensure visibility
    if ( ! $product || ! $product->is_visible() ) {
    	return;
    }
    
    // Increase loop count
    $woocommerce_loop['loop']++;
    
    // Extra post classes
    $classes = array();
    if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] ) {
    	$classes[] = 'first';
    }
    if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
    	$classes[] = 'last';
    }
    ?>
    <li <?php post_class( $classes ); ?>>
    
    	<?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
    
    		<?php
    			/**
    			 * woocommerce_before_shop_loop_item_title hook
    			 *
    			 * @hooked woocommerce_show_product_loop_sale_flash - 10
    			 * @hooked woocommerce_template_loop_product_thumbnail - 10
    			 */
    			do_action( 'woocommerce_before_shop_loop_item_title' );
    		?>
    
    		<div class="product-thumb">
    			<a href="<?php the_permalink(); ?>" class="product-link">
    
    				<?php
    				if( has_post_thumbnail() )
    				{
    					$thumbnail_ids[] = get_post_thumbnail_id( $product->id );
    					$attachment_ids = $product->get_gallery_attachment_ids();
    					$i = 0;
    
    					if( !empty( $attachment_ids ) )
    					{
    						$thumbnail_ids = array_slice( array_unique( array_merge( $thumbnail_ids, $attachment_ids ) ), 0, 2 );
    					}
    
    					foreach( $thumbnail_ids as $thumbnail )
    					{
    						echo wp_get_attachment_image( $thumbnail, 'shop_catalog', false, array( 'class' => sprintf( 'image_%s', ++$i ) ) );
    					}
    				}
    				elseif( woocommerce_placeholder_img_src() )
    				{
    					echo woocommerce_placeholder_img( 'shop_catalog' );
    				}
    				?>
    
    			</a>
    		</div>
    
    		<h3 class="h5"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    
    		<?php
    		/**
    		 * woocommerce_after_shop_loop_item_title hook
    		 *
    		 * @hooked woocommerce_template_loop_rating - 5
    		 * @hooked woocommerce_template_loop_price - 10
    		 */
    		do_action( 'woocommerce_after_shop_loop_item_title' );
    		?>
    
    	<?php
    
    	/**
    	 * woocommerce_after_shop_loop_item hook
    	 *
    	 * @hooked woocommerce_template_loop_add_to_cart - 10
    	 */
    	do_action( 'woocommerce_after_shop_loop_item' );
    
    	?>
    
    </li>

    Thanks a lot for any sugestions.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Remove all of those woocommerce_loop lines. They are not needed.

    What exactly ? Just this or something more:

    // Store loop count we're currently on
    if ( empty( $woocommerce_loop['loop'] ) ) {
    	$woocommerce_loop['loop'] = 0;
    }
    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    // Increase loop count
    $woocommerce_loop['loop']++;
    
    // Extra post classes
    $classes = array();
    if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] ) {
    	$classes[] = 'first';
    }
    if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
    	$classes[] = 'last';
    }

    too.

    I removed it but still thois same issue. I have just 2 columns not 4 display on store:

    https://sklep.midu.pl/sklep/

    Here is my content-product_cat.php file:

    <?php
    /**
     * The template for displaying product category thumbnails within loops.
     *
     * Override this template by copying it to yourtheme/woocommerce/content-product_cat.php
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     2.4.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    global $woocommerce_loop;
    
    // Store loop count we're currently on
    if ( empty( $woocommerce_loop['loop'] ) ) {
    	$woocommerce_loop['loop'] = 0;
    }
    
    // Store column count for displaying the grid
     if ( empty( $woocommerce_loop['columns'] ))
    
    // Increase loop count
    $woocommerce_loop['loop'] ++;
    ?>
    <li class="product-category product<?php
    	if ( ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] == 0 || $woocommerce_loop['columns'] == 1 )
    		echo ' first';
    	if ( $woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0 )
    		echo ' last';
    	?>">
    
    	<?php do_action( 'woocommerce_before_subcategory', $category ); ?>
    
    		<?php
    			/**
    			 * woocommerce_before_subcategory_title hook
    			 *
    			 * @hooked woocommerce_subcategory_thumbnail - 10
    			 */
    			do_action( 'woocommerce_before_subcategory_title', $category );
    		?>
    
    		<div class="product-thumb">
    			<a href="<?php echo get_term_link( $category->slug, 'product_cat' ); ?>" class="category-link">
    
    				<?php echo woocommerce_subcategory_thumbnail( $category ); ?>
    
    			</a>
    		</div>
    
    		<h3 class="h5">
    			<a href="<?php echo get_term_link( $category->slug, 'product_cat' ); ?>">
    
    				<?php
    					echo $category->name;
    
    					if ( $category->count > 0 )
    						echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">' . $category->count . '</mark>', $category );
    				?>
    
    			</a>
    		</h3>
    
    		<?php
    			/**
    			 * woocommerce_after_subcategory_title hook
    			 */
    			do_action( 'woocommerce_after_subcategory_title', $category );
    		?>
    
    	<?php do_action( 'woocommerce_after_subcategory', $category ); ?>
    
    </li>

    ok – I fix it. I have one more file in child theme. Sorry for taht ?? Thanks a lot for fix my issue. All the best for you.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I see 4 columns now.

    All of the loop lines needed to go,

    global $woocommerce_loop;
    
    // Store loop count we're currently on
    if ( empty( $woocommerce_loop['loop'] ) ) {
    	$woocommerce_loop['loop'] = 0;
    }
    
    // Store column count for displaying the grid
     if ( empty( $woocommerce_loop['columns'] ))
    
    // Increase loop count
    $woocommerce_loop['loop'] ++;

    including those.

    Thanks. I removed it and working well. Thanks again so much for help with this issue !!

    Good day, newly updated to version 2.6, everything has worked beautifully for me (congrats) but I have a little problem, does not allow me to edit “Product Data” when I load the BackEnd of a product at the time of loading shows me full options, but when it’s charging me 100% eliminates options “Product data”
    I can only navigate the tabs but unable to modify the content because it does not show it, I hope you can help me, thanks!
    I mean options as “General”, “Inventory”, “Shipping” and others

    ——————-

    Buen día, recién actualice a la versión 2.6, todo me ha funcionado de maravilla (felicidades) pero tengo un peque?o problema, no me permite editar “Datos del Producto” cuando cargo el BackEnd de un producto, al momento de la carga me muestra las opciones completas, pero cuando hace la carga al 100% me elimina las opciones de “Datos del Producto”
    Solo puedo navegar en las pesta?as pero sin poder modificar el contenido porque no lo muestra, espero me puedas ayudar, gracias!
    Me refiero a opciones como “General”, “Inventario”, “Envío” y demás

Viewing 15 replies - 16 through 30 (of 44 total)
  • The topic ‘Product per row function broken after update’ is closed to new replies.