Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

WooCommerce 3.3.3 – old column fix no longer works

columnswoocommerce
    • 7 years, 4 months ago rebeccaolson
      Participant

      Expired

      Hello –

      I would like 4 columns (4 products) to display as cross-sells in my WooCommerce cart. Up until this most recent update, the fix was to go to includes/wc-template-functions.php and change

      $defaults = array(
      ‘posts_per_page’ => 2,
      ‘columns’        => 2,

      TO

      $defaults = array(
      ‘posts_per_page’ => 2,
      ‘columns’        => 4,

      However – that code no longer exists in the newest update (3.3.3) and I can’t find anything else that is similar in that file. Is there another place I need to look, or perhaps CSS code I need to add to the template to achieve this result? I see from searching the forum that this is a common request (changing the default 2 columns to 4 columns for product display) so hopefully it’s an easy fix, as before.

      Please note: the products are displaying as 4 columns everywhere else on the site – it is only within the cart, as cross-sells, that they are defaulting to 2 products.

      Thanks!

      Rebecca

       

    • 7 years, 4 months ago Mirela
      Participant

      Hello,

      Please go to the same file and look for this block of code:

      /**
      	 * Output the cart cross-sells.
      	 *
      	 * @param  int    $limit (default: 2).
      	 * @param  int    $columns (default: 2).
      	 * @param  string $orderby (default: 'rand').
      	 * @param  string $order (default: 'desc').
      	 */

      Change here the values of limit and columna from 2, to 4. Save changes and refresh page.
      Let us know how it goes.

      Best regards!

    • 7 years, 1 month ago rebeccaolson
      Participant

      Expired

      Hey there – I made the changes, but it did not work. I found the code directly beneath that:

      function woocommerce_cross_sell_display( $limit = 2, $columns = 2, $orderby = ‘rand’, $order = ‘desc’ )

      and changed it to:

      function woocommerce_cross_sell_display( $limit = 4, $columns = 4, $orderby = ‘rand’, $order = ‘desc’ )

      That worked! I just wanted to put it on the thread, in case someone else is searching with this same issue.
      Rebecca

    • 7 years, 1 month ago Mirela
      Participant

      Hello,

      Thank you for sharing this Rebecca!

      Best regards!

Viewing 3 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password