- This topic has 9 replies, 3 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 30, 2022 at 8:07 pm #2443853
Debra
My WooCommerce cart is set to show 2 columns for Cross Sells. I’m not sure if this is something I set somewhere or not (I cannot find a setting option). I want to change this to 1 column. Any suggestions?
November 30, 2022 at 8:32 pm #2443878Fernando Customer Support
Hi Debra,
Can you go to Appearance > GeneratePress, and enable the WooCommerce module if it’s disabled?
Then, go to Appearance > Customize > Layout > WooCommerce > Single Product, and change the Related/Upsell Columns value to your preference –
1.Reference: https://docs.generatepress.com/article/woocommerce-overview/#single-product
November 30, 2022 at 8:44 pm #2443885Debra
Hi Fernando,
Thanks for the response. Changing that setting to 1 still formats the cross-sells in the cart with 2 columns. However, it does change the columns on my Single Product display.
If possible, I would like to keep the number of columns on my Single Product pages set to something different than on the cart page.
When I inspect the CSS on the cart page I see:
<div class="cross-sells"><ul class="products columns-2">. (This is the same regardless of what number I set in the Appearance > Customize > Layout > WooCommerce > Single Product > Related/Upsell Columns value.)November 30, 2022 at 8:54 pm #2443891Fernando Customer Support
I see. Sorry, I misunderstood. The column setting for that section is controlled by WooCommerce.
To alter it, you can try adding this PHP snippet:
add_filter( 'woocommerce_cross_sells_columns', 'change_cross_sells_columns' ); function change_cross_sells_columns( $columns ) { return 1; }Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
This should turn
columns-2tocolumns-1.Let us know how it goes.
November 30, 2022 at 9:04 pm #2443898Debra
That changes the CSS to show
<div class="cross-sells"><ul class="products columns-1">However, I was hoping my product would resize to fill that column. Instead, it still displays as if it’s in a 2 column format.November 30, 2022 at 9:31 pm #2443919Fernando Customer Support
I see. Try adding this through Appearance > Customize > Additional CSS:
.cross-sells ul.products.columns-1 > li { width: 100% !important; text-align: center; } .cross-sells ul.products.columns-1 > li .inside-wc-product-image { width: 100% } .cross-sells ul.products.columns-1 > li .star-rating { margin-left: auto; margin-right: auto; }December 1, 2022 at 9:30 am #2444887Debra
That works perfectly! Is there a tip jar here for outstanding support?
December 1, 2022 at 9:33 am #2444901David
StaffCustomer SupportHi there,
we do have a tip jar 🙂 It can be found here:
December 1, 2022 at 9:40 am #2444942Debra
Perfect! Thanks, David!
December 2, 2022 at 1:58 am #2446310David
StaffCustomer SupportThank you ! It is much appreciated 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.