Bestellformular für Black Friday nur von 0:00Uhr bis 23:59Uhr aktivieren

  • KAPA
  • KAPA's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 0

KAPA created the topic: Bestellformular für Black Friday nur von 0:00Uhr bis 23:59Uhr aktivieren

Hallo,
ist es möglich, ein Formular zeitlich begrenzt zu aktivieren?

Für Black Friday benötige ich ein Formular, welches genau nur zu diesem Zeitraum aktiv ist. Davor und danach dürfen keine Eingaben mehr möglich sein bzw. es darf nichts zu senden sein.

Es grüßt aus dem deutschen Ruhrpott

Der Klaus

Sofern nicht anders angegeben:
Joomla aktuellste Version, Breezingforms PRO aktuellste Version, Breezingcommerce aktuellste Version, Template aktuellste Version!
Support gekauft: JA! :-)
#215583
  • Posts: 2222
  • Karma: 44
  • Thank you received: 279

marko.bosnjak replied the topic: Bestellformular für Black Friday nur von 0:00Uhr bis 23:59Uhr aktivieren

Hello,

we are currently little short on German speaking supporters, so I hope you don't mind me answering in English.
I made an example. Find the form attached.

1) In Section "TIMER"> Description: Edit > SourceCode you will find the placeholder DIV for your timer:
<div style="display: flex; justify-content: center;">
<h3>Time left = <span id="timer"></span></h3>
</div>

2) Then in form's properties > Advanced tab > More options > Form pieces > Before Form > Type > Custom you'll find this code:
echo '
<script>
// Set the date we are counting down to
var countDownDate = new Date("Nov 10, 2017 11:01:25").getTime();

// Update the count down every 1 second
var x = setInterval(function() {

    // Get todays date and time
    var now = new Date().getTime();
    
    // Find the distance between now an the count down date
    var distance = countDownDate - now;
    
    // Time calculations for days, hours, minutes and seconds
    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    
    // Output the result in an element with id="demo"
    document.getElementById("timer").innerHTML = hours + "h "
    + minutes + "m " + seconds + "s ";
    
    // If the count down is over, write some text 
    if (distance < 0) {
        clearInterval(x);
        document.getElementById("timer").innerHTML = "EXPIRED";
        location.href = "https://www.google.com";
    }
}, 1000);
</script>
';
IMPORTANT:
In this line you'll specify the date:
var countDownDate = new Date("Nov 10, 2017 11:01:25").getTime();
If I'm not mistaking, the date for Black Friday should be:
var countDownDate = new Date("Nov 24, 2017 23:59:00").getTime();
When the countdown is over, users will be automatically redirected to a certain page, in my case it's Google:
location.href = "https://www.google.com";
Ideally would be if you could start the countdown on Friday at 00:00 so the script would only count hours, minutes and seconds without additional calculation of days, etc.. Of course, if that's OK with you.

Test it out and let me know if it works for you.

Regards,
Marko

======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!
#215632
Attachments:
Moderators: ForumSupporttomeperica
Time to create page: 0.062 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here