Shopify themes, liquid, logos, and UX
When reading the link below, it says Dawn will have a slider. Either I can't find it, or it hasn't been shipped in the last version. Does anyone have insight into this?
https://ux.shopify.com/next-generation-theme-design-5aae94f6d44c
Edit: I just found a slider example in a section named "featured-blog" which doesn't seem enabled. I don't know if it hasn't been completed yet or if we're supposed to figure out how to implement it on our own.
Solved! Go to the solution
This is an accepted solution.
There is a slider component that seems to be used on mobile only, in some sections.
The component CSS and JS can be found at:
/assets/component-slider.css
/assets/slider.js
It uses CSS Flex and you'd have to tweak the CSS to show it on desktop too.
Great, thanks. My goal is to enable desktop slider too, like in featured collection. Could you tell me how to do it?
@sapiens_sapiens If you follow my instructions this works on Dawn 9.0 theme. I tested as you can see below:
Otherwise you may have some CSS overriding it. If you install a fresh dawn theme and test it should work fine.
Thank u
Thanks @shadowsfall118 for also looking into it.
I posted my code on here but it got flagged as potential spam so that was useful - i dont know if you were able to save it before it was removed - so @made4Uo i tried to replace the code you posted with what i had but it is the same outcome. I also tried to do the walkthrough once again just in case i missed something - but still got the same result, no large image, some thumbnails and no slider activity. I have tried it over 10 times now with the same outcome sadly so i have to come to the conclusion there is something wrong 😞
Hopefully this dropbox link might work...
https://www.dropbox.com/sh/3rxwwufxg5sn8rl/AAAlY82qoOXDtsGJHUY7ZFSMa?dl=0
Thanks.
Hi @StewartM I fix it. Please check my website
I was able reproduce the problem. With my intention on mostly keeping the original Dawn code cause the elements to be hidden. Fixed code available in the website. Let me know if you still have issues
I just deleted the code following code in the large image
{%- assign variant_images = product.images | where: 'attached_to_variant?', true | map: 'src' -%}
{%- if product.selected_or_first_available_variant.featured_media != null -%}
{%- assign media = product.selected_or_first_available_variant.featured_media -%}
@shadowsfall118 Thanks for posting the file. I was able to find the problem
Thank you for the like. Yes. That is the other way
Thanks @made4Uo for the slider!!!! I can confirm it's working.
Another addition to @made4Uo code is to hide the slider buttons if there is less than 4 images.
global.js inside the INT() function right after this.update(); add the following:
const thumbCount = this.pageTotal.textContent; if (thumbCount <= 4) { document.getElementsByClassName('slider-buttons')[0].style.visibility = 'hidden'; } else { document.getElementsByClassName('slider-buttons')[0].style.visibility = 'visible'; } } |
Thank you @shadowsfall118 never think of hiding the slider 😁
Hi @shadowsfall118 . You do not need to add javascript code. Just change the product.media.size < 5 in the slider-buttons so the "small-hide" get activated. See the bold code. I updated my code in the website too. Thank you again
@made4Uo thanks for pointing this out. Although the "small-hide" css class does not seem to do anything on my vanilla (plain) shop. Maybe replace "small-hide" with "visually-hidden"?
OLD:
<div class="slider-buttons {% if product.media.size < 5 %} small-hide{% endif %}"> |
NEW:
<div class="slider-buttons {% if product.media.size < 5 %} visually-hidden{% endif %}"> |
@shadowsfall118 . If you go to the asset folder and open the base.css folder you see the visually hidden there (see below). This is not really what we want. I was able to find the small-hide and it only works in small screen. We can use 'hidden' instead. I updated my code in the website again. Code should look like this
<div class="slider-buttons {% if product.media.size < 5 %}hidden{% endif %}">
.visually-hidden {
position: absolute !important;
overflow: hidden;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
clip: rect(0 0 0 0);
word-wrap: normal !important;
}
@made4Uo I think this line needs to be 4 not 3.
this.totalPages = sliderItemsToShow.length - this.slidesPerPage + 4; |
I had a product with 5 images and the last was not showing / could not click the right arrow to reveal it.
You are right! Thank you
Thanks both of you for looking into to this so quickly and investigating, its much appreciated.
I know this will help an awful lot of people who are looking to get the same functionality with the theme 🙂
Thanks again @made4Uo and @shadowsfall118
No problem at all. Glad to help. Thank you @shadowsfall118 for helping me modify the code
@made4Uo Could I ask your permission to make a YouTube video using this method? I have people literally begging me to find a solution and I've been looking for a week and finally got it working thanks to your guide
I did create a YouTube video in my website but due to some code changes, you might not able to follow. I will be creating a YouTube video in a few. Stay tuned.
Hi,
For people that are looking to convert the Dawn product page with slider, please see video. Link with code in the video description. NO APP needed
For those who want a more intuitive slider, with actual slide functionality, I've created a blog on how to add flickity onto the dawn theme, found here https://www.bluish.io/shopify/how-to-create-a-product-image-slider-on-dawn-theme
You can test it out here - https://shopify.bluish.io/products/example
It's the bare minimum, so I can take any suggestions on what functionality you'd like, and I'll keep updating it.
Check out my blog for some awesome Shopify, SEO and Social Media Marketing content.
To hire me, visit my Upwork profile
Slider works really well!
Nice discovery! Some fresh air 🙂
Congratulations with your blog.
I will definetely follow.
Now it's time to learn a bit more with your tutorials!
Thank you
@JohnFromJotting The product image slider works great on desktop but my images are not showing while on the mobile viewer. My store's preview link.
Mouse can't slide
I followed the instructions, and the slider itself works great.
But I have a problem with the slider-counter. Since I edited my Dawn theme code and changed it to Right-to-Left, I believe it's making it a little bit mixed up.
For some reason it's not showing me all numbers, but only the total-media, while the current image number is different everytime.
I added a short video to demonstrate.
Help would be appreciated.
Hi,
Please update your codes. Transform you Dawn Theme in Debut theme product page for free.
Enjoy this features below:
Product slider working.
Zoom feature working.
Variant buttons connected to the large image and the product slider.
Resize your thumbnail images.
No more massive images in the product page.
Check the code here for free. No app needed. Check the video for preview
Hi, would you be able to help with creating a second product template for pre-order? I had it with the old theme but unable to recreate one for the new Dawn theme. It's pretty much another template to change the button from add to cart to Pre-order.
Also, is there a way to have a pop up alert when customer adding both pre-order and in tock items in the same cart?
Thanks.
Can you tell me more about it?
-I'm looking to have a separate product template for my pre-orders. So instead of the Add to Cart button, we will have a Pre-order button instead.
-The second part is for a possible pop-up alert for the shopping cart when a pre-order item is added to the cart that contain in stock item. Typically, with mix items (in stock & Pre-order), we will have to wait until the pre-order to arrive and ship the whole order at once. This pop up alert is to remind the buyer to not expecting the in stock items to ship right away when they are being carted and purchased along with pre-order items.
@made4Uo Thanks! I did it and it works just fine.
The only problem is when picking a variant it is not changing the large image. What did I do wrong and how should I fix it?
And one more thing, how can I use the same slider (without numbers/pagination) with collections on the home page?
You might have miss the step for the variant image. It is in global.js. I have a different slider for home page here
@made4Uo Thanks for the fast reply.
I just re-did the step with global.js again, but it's still won't work...
@Menibig it's hard to figure which one you did wrong without seeing your code. Can you message me in my website, Made4uo.com with your code?
@made4Uo I noticed one thing while working with my theme, your code works fine with the product slider on product page, but you know what the built-in slider component which comes with the dawn theme by default is not working on mobile/tablet.
change your code line in the slider.
onButtonClick(event) {
event.preventDefault();
const slideScrollPosition = event.currentTarget.name === 'next' ? this.slider.scrollLeft + this.sliderItems[0].clientWidth : this.slider.scrollLeft - this.sliderItems[0].clientWidth;
this.slider.scrollTo({
left: slideScrollPosition
});
}
to this
it will work then!
you can check on your own, I did it.
Just FYI. The code is made to specify the use of the productSlider (the one I added). This is the code that I wrote for the onButtonClick function.
onButtonClick(event) {
event.preventDefault();
if (this.productSlider) {
const slideScrollPosition = event.currentTarget.name === 'next' ? this.slider.scrollLeft + (this.slider.clientWidth): this.slider.scrollLeft - (this.slider.clientWidth);
this.slider.scrollTo({
left: Math.floor(slideScrollPosition)
});
this.currSlide = Math.round(slideScrollPosition / this.slider.clientWidth);
if (this.currSlide === 0 ) {
this.prevButton.setAttribute('disabled', true);
} else {
this.prevButton.removeAttribute('disabled');
}
if (this.currSlide === this.totalPages / 3 ) {
this.nextButton.setAttribute('disabled', true);
} else {
this.nextButton.removeAttribute('disabled');
}
} else {
const slideScrollPosition = event.currentTarget.name === 'next' ? this.slider.scrollLeft + this.sliderLastItem.clientWidth : this.slider.scrollLeft - this.sliderLastItem.clientWidth;
this.slider.scrollTo({
left: Math.floor(slideScrollPosition)
});
}
}
User | RANK |
---|---|
141 | |
113 | |
79 | |
64 | |
63 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023