That should be doable. Give me several days to see what I can come up with.
Another question. Are the users of the site only going to be local or do you expect folks from other time zones to want to buy products? I ask because working with time zones is a nightmare on computers. It hurts my brain! 🙂
Please see Store Product Detail Add To Cart Show After Date Time.
Note this code takes care of hiding the atc buttons for you. This code hides all atc buttons and then decides to show or not.
Remove any existing atc button hiding code you have.
Let us know how it goes.
I purchased this plugin to help a friend.
He has 40-50 galleries with hundreds of images on a page, the site loads very slowly. With the plugin, the speed has improved significantly, but still a bit slow.
The JS is looking for the first element with the class event-date (the start date) but it needs to look for the second element with this class (the end date). You can do this by changing the line:
var eventDate = document.getElementsByClassName("event-date")[0].getAttribute("datetime");
to
var eventDate = document.getElementsByClassName("event-date")[1].getAttribute("datetime");
Did this help? Please give feedback by clicking an icon below ⬇️
Thanks so much @paul2009
This didn't work for me using the section ID, but it did with the block ID...
<div id="no-events"></div>
<script>
window.addEventListener('DOMContentLoaded',function () {
var sfSummaryExists = document.querySelector("#block-yui_3_17_2_1_1639337200029_6221 .summary-title");
if (sfSummaryExists == null) {
document.getElementById('no-events').innerHTML = "Sorry, we don't currently have any guided tours upcoming.";
}
});
</script>
@iamdavehart Sorry - have only just seen your reply! Great suggestion, will test this one too and report back. Thanks guys!
Instead of looking for a single class of summary-title like this:
document.getElementsByClassName("summary-title")[0]
you'll need to look for each class within each section. For example, where the section ID is wxyz, you might use:
I think I figured it out. Again, super rusty w/ CSS, but here's what I did. Hope this helps!
/* Make sure to target your gallery. Each gallery has its own unique collection ID, which can be found via View Source. */
#collection-5f047ea7c17ab563ed1595c4{
.gallery-grid-item {
position: relative;
display: inline-block;
}
.gallery-caption-wrapper {
display: table;
height: 100%;
}
/* Caption Container */
figcaption.gallery-caption {
padding: 0;
position: absolute;
z-index: 999;
margin: 0 auto;
left: 0;
right: 0;
top: 0%;
width: 100%;
height: 100%;
}
.gallery-caption-content {
display: table-cell;
vertical-align: middle;
}
}