Tone Posted January 8, 2021 Share Posted January 8, 2021 Hi all! The question has to do with the display of the related products on any product page in the store: - If I have less than 3 items to display, I would love to center the related products on the page (takes 3 items/line max) - If I have more than 3 items to display, I would love to display only 3. No preference: random choice, or the 3 firsts... Is it possible? Could I solve that with some extra code? Can someone please assist me? Hope it's a good year 🙂 Link to comment
tazmeah Posted January 8, 2021 Share Posted January 8, 2021 Can you provide any links which show both scenarios? Link to comment
Tone Posted January 8, 2021 Author Share Posted January 8, 2021 Thanks for your reply tazmeah. Sadly my site isn't published yet, I don't know that I can share a link of my website...? Here are two pictures, first on shows two related products down the bottom and I'd like to center them if possible (same if it was only 1 item to display). Second image shows the case where there are more than 3 products. Ideally I'd like to show only three. If not, at least center the second line. What do you think? Link to comment
tuanphan Posted January 10, 2021 Share Posted January 10, 2021 On 1/8/2021 at 4:23 PM, Tone said: sorry, up You can setup password & share url. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Tone Posted January 16, 2021 Author Share Posted January 16, 2021 Sorry yes indeed, I just discovered that. Thanks. password is: pianoharbourtest There is one URL here with the 2 associated product scenario: https://www.pianoharbour.com.au/store/p/feurich125 And one here with more than 3 products: https://www.pianoharbour.com.au/store/p/pls-covers Thanks to anyone who could give me a plug! Link to comment
tuanphan Posted January 18, 2021 Share Posted January 18, 2021 On 1/16/2021 at 1:36 PM, Tone said: Sorry yes indeed, I just discovered that. Thanks. password is: pianoharbourtest There is one URL here with the 2 associated product scenario: https://www.pianoharbour.com.au/store/p/feurich125 And one here with more than 3 products: https://www.pianoharbour.com.au/store/p/pls-covers Thanks to anyone who could give me a plug! Add to Design > Custom CSS @media screen and (min-width:768px) { .ProductItem-relatedProducts { .list-grid { display: flex !important; flex-wrap: wrap; justify-content: center; } .grid-item { width: 25%; } } }  Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Tone Posted January 18, 2021 Author Share Posted January 18, 2021 1 hour ago, tuanphan said: Add to Design > Custom CSS @media screen and (min-width:768px) { .ProductItem-relatedProducts { .list-grid { display: flex !important; flex-wrap: wrap; justify-content: center; } .grid-item { width: 25%; } } }  Genius, geniussss 🙂 Link to comment
tuanphan Posted January 20, 2021 Share Posted January 20, 2021 On 1/18/2021 at 3:31 PM, Tone said: Genius, geniussss 🙂 Do you want to align left footer elements on mobile? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Tone Posted January 25, 2021 Author Share Posted January 25, 2021 On 1/20/2021 at 7:37 PM, tuanphan said: Do you want to align left footer elements on mobile? You picked my mind, I would like to center the "back to top" button on mobile, no clue how to do so though. Link to comment
Tone Posted January 29, 2021 Author Share Posted January 29, 2021 Sorry Tuanphan, was I supposed to get the code from your previous image, I'm confused now. Link to comment
tuanphan Posted February 1, 2021 Share Posted February 1, 2021 On 1/28/2021 at 5:11 PM, Tone said: Sorry Tuanphan, was I supposed to get the code from your previous image, I'm confused now. Hi. Sorry for the delay. I was off some day. Add to Design > Custom CSS /* Center back to top mobile */ @media screen and (max-width:767px) { div#block-yui_3_17_2_1_1606257616621_5795>div { margin: 0 auto; text-align: center; } }  Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.