Shopify themes, liquid, logos, and UX
I want to make related products in a carousel style like the desktop
Mobile:
Can anyone help me?
Solved! Go to the solution
This is an accepted solution.
Hey @KhallP,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference
@media only screen and (max-width: 768px) {
product-recommendations ul {
display: flex !important;
flex-wrap: nowrap !important;
overflow-x: scroll !important;
}
}
Screenshot is for reference only, the correct code to paste is the one shown above.
This is an accepted solution.
Hey @KhallP,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference
@media only screen and (max-width: 768px) {
product-recommendations ul {
display: flex !important;
flex-wrap: nowrap !important;
overflow-x: scroll !important;
}
}
Screenshot is for reference only, the correct code to paste is the one shown above.
I liked the result although I thought it would look different, couldn't I make something similar to what I already have in the store's collections? Such that:
Hey @KhallP,
It is possible but it would take alot of development to do so because you have to create the pages ( like "1/4"), create the buttons, add the action to the buttons to go forwards or backwards, make the buttons deactivated if we are on the end of each side, etc... Therefore, I'm afraid as a short code, I can only give you the one I already provided.
And by text here it's also hard to explain how you can recycle the code for the store collections because it also takes abit of heavy lifting there to move the code properly and test it to make sure nothing is broken.
Ok, it's okay, thank you for your work anyway, could you just help centering the related products header on mobile?
No problem.
Here's the full code along with the previous one
@media only screen and (max-width: 768px) {
product-recommendations ul {
display: flex !important;
flex-wrap: nowrap !important;
overflow-x: scroll !important;
}
h2.related-products__heading.inline-richtext.h2 {
text-align: center !important;
}
}
It worked, thank you very much 🙂
I don't find where to pas the code in the current version of Shopify.
Can you make step by step tutorial with images ?
Thanks in advance
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024