-
AuthorPosts
-
July 5, 2021 at 2:38 pm #1308787
Hi!
Below my products I have chosen “Upsell products”. How do I center this column? It’s now placed to the left.BR
July 5, 2021 at 2:55 pm #1308791Hi,
Thanks for contacting us!
Could you please post a link to your page? I could not reproduce it on my local installation. Attached a screenshot in private content field below :)
Regards,
YigitJuly 5, 2021 at 3:17 pm #1308795Hi!
Thanks for your fast respond :) Unfortunately it’s in maintaince mode. Just how the pictures are centered is how I wan’t them to be :) And the text “You may also like” centered too.. My page is set to stretched layout.Is there any code I can try to center the Upsell product column on evey single product page?
Thanks again Yigit!
Br!July 6, 2021 at 6:34 am #1308867Hi,
Thanks for the update. If your site is in maintenance mode, then please provide us with login details in private. It’s much easier for us to help you out, if we can see the elements on your actual site.
Best regards,
RikardJuly 7, 2021 at 8:28 am #1309052Hi!
Posted a link in private content.
It’s the “Matcha med…” under the product gallery I want to be centered…Br
July 7, 2021 at 9:12 am #1309056Sorry, I mean it’s the “Du gillar kanske också…” column.
July 7, 2021 at 1:08 pm #1309099Hi,
Do you always add 2 products to upsells? If so, please add following code to bottom of Functions.php file of your child theme
/** * Change number of upsells output */ add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 ); function wc_change_number_related_products( $args ) { $args['posts_per_page'] = 2; $args['columns'] = 2; //change number of upsells here return $args; }
Then add following code to Quick CSS field in Enfold theme options > General Styling
#top.single-product .up-sells .products.columns-2 { width: 50%; margin: auto; } #top.single-product .up-sells .products.columns-2 .product { width: 49%; } #top .upsells.products h2 { text-align: center; }
Best regards,
YigitAugust 11, 2021 at 2:40 pm #1316274Hi!
Thank you, I want to add more than two products to upsell. Probably 7 as maximum.
I added the code below which did center the heading “You may also like”:
#top .upsells.products h2 { text-align: center; }But now I also wan’t to center the pictures, how do I do this?
And is there anyway I can make the pictures a little bit smaller?Br
August 11, 2021 at 5:02 pm #1316296Hi,
You would need to change the code to following one to display 7 columns
/** * Change number of upsells output */ add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 ); function wc_change_number_related_products( $args ) { $args['posts_per_page'] = 7; $args['columns'] = 7; //change number of upsells here return $args; }
and use following CSS code instead
#top .product_column_4 .upsells .products .product { width: 13.4%; } #top .upsells.products h2 { text-align: center; }
Result should be as following – https://imgur.com/a/TRDKsrV
Best regards,
YigitAugust 11, 2021 at 5:11 pm #1316299Hi!
Thank you for your fast respond :)
So there isn’t a way to just center the picture column without changing the amount of products to display?Br
August 11, 2021 at 5:18 pm #1316302Hi,
Would you like to display 7 products in 2 column layout? If so, you would need to change the code in functions.php file to following one
/** * Change number of upsells output */ add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 ); function wc_change_number_related_products( $args ) { $args['posts_per_page'] = 7; $args['columns'] = 2; //change number of upsells here return $args; }
If that too does not help, can you post a screenshot and show the changes you would like to make so we can make sure that we are on the same page? :)
Best regards,
YigitAugust 11, 2021 at 5:39 pm #1316309Hi!
Thanks again for your fast respond :)
I will have different amount of Upsell products depending on which product page it is.
All I want to do is center the column so the Upsell products aren’t placed to the left.
Right now the title “You may also like..” is centered, but the products underneath the title are aligning to the left.
This is how the upsell products are placed right now (but the title “you might also like..” centered):Br
August 13, 2021 at 2:41 pm #1316633Hi,
I now understand the changes you would like to make however unfortunately such customization would be out of the scope of our support I am afraid. If that is really important for you, please consider to hire a freelance developer for the task :)
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.