Tagged: woocommerce
-
AuthorPosts
-
May 12, 2017 at 11:49 am #792228
Hi,
I found this code for increasing columns of related products:
function avia_chance_wc_related_columns(){ global $avia_config; $avia_config['shop_single_column'] = 4; // columns for related products and upsells $avia_config['shop_single_column_items'] = 4; // number of items for related products and upsells } add_action('wp_head', 'avia_chance_wc_related_columns', 10);
Is there a similar code to increase the cross-sells columns in the cart?
Thanks in advance
May 12, 2017 at 8:25 pm #792485Hey westefan,
Can you show me the page please so I can check which section it is and if it is controlled from WooCommerce or our framework?
Thank youBest regards,
BasilisMay 13, 2017 at 7:42 am #792667Hey Basilis,
no worry placing products in the cart – the shop is in test mode
Thanks, westefan
May 14, 2017 at 12:13 pm #792901Hi westefan,
Here is the code you can put in your funtions.php
remove_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count'); remove_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count'); add_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count_mod'); add_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count_mod'); function avia_woocommerce_cross_sale_count_mod($count) { return 5; }
If you need further assistance please let us know.
Best regards,
VictoriaMay 14, 2017 at 12:41 pm #792905Many thanks for your effort, Victoria – but the code doesn’t work.
Any idea?
Best regards, StefanMay 14, 2017 at 2:02 pm #792930Hi Stefan,
Try adjusting the code like this:
remove_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count', 10); remove_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count', 10); add_filter('woocommerce_cross_sells_total', 'avia_woocommerce_cross_sale_count_mod', 21); add_filter('woocommerce_cross_sells_columns', 'avia_woocommerce_cross_sale_count_mod', 21); function avia_woocommerce_cross_sale_count_mod($count) { return 5; }
Best regards,
VictoriaMay 14, 2017 at 2:20 pm #792936That works, Victoria, many thanks!
Now 5 products are shown in 2 rows. Is it possible to adust the width of the single cross sells product, so that all 5 are in 1 row?
Best regards, Stefan
May 14, 2017 at 3:45 pm #792962Hi Stefan,
Here is the css for that:
div .products .product { width: 18.6%; }
If you need further assistance please let us know.
Best regards,
VictoriaMay 14, 2017 at 5:11 pm #792992Now it’s perfect, Victoria!
Many thanks and have a wonderful day,
StefanMay 14, 2017 at 5:14 pm #792995 -
AuthorPosts
- The topic ‘Increase columns for cross-sells products’ is closed to new replies.