Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    105
    Plugin Contributions
    0

    bug where can I find out the "discount count down by the time"

    I am trying to make a web site as http://1saleaday.com/wireless/
    I want to have a add on for countdown timer or something that I can countrol the sales time

  2. #2
    Join Date
    Dec 2017
    Location
    Adelaide
    Posts
    16
    Plugin Contributions
    0

    Default Re: where can I find out the "discount count down by the time"

    Hey All,

    Zen Cart 1.5.5e and PHP 7.0
    with Fast and easy checkout (fec) Numinix. www.slayitqueen.com

    I am trying to add a Javascript timer to the billing details main_page=no_account (Numinix fec) to add urgency.

    It says "An item you ordered is in high demand. Your order is reserved for (counts down from 10 mins)".

    I tried to put in in includes/modules/pages/no_account and named it on_load_countdown.js as per: https://www.zen-cart.com/wiki/index....s_-_Javascript.

    I can make it work in a browser no problem, but in zen cart? No.

    It loads but outside the inner part of the page and only code shows. I put the Div class and ID of the navBreadCrumb in the code so that it would append, as that's where I want it to go (just after that, but cant get it to work.

    Any ideas? Here is the javascript:

    Code:
    function create(htmlStr) {
        var frag = document.createDocumentFragment(),
            temp = document.createElement('div');
        temp.innerHTML = htmlStr;
        while (temp.firstChild) {
            frag.appendChild(temp.firstChild);
        }
        return frag;
    }
    
    function startTimer(duration, display) {
        var start = Date.now(),
            diff,
            minutes,
            seconds;
        function timer() {
            diff = duration - (((Date.now() - start) / 1000) | 0);
    
            minutes = (diff / 60) | 0;
            seconds = (diff % 60) | 0;
    
            minutes = minutes < 10 ? "0" + minutes : minutes;
            seconds = seconds < 10 ? "0" + seconds : seconds;
    
            display.textContent = minutes + ":" + seconds; 
    
            if (diff <= 0) {
                start = Date.now() + 1000;
            }
        };
        timer();
        setInterval(timer, 1000);
    }
    
    window.onload = function () {
    	
    	var fragment3 = create('<div style="background:#fff0f2 ;padding:10px 20px;border:1px solid #e3df74; font-size:14px; color:#2c2c2c; font-weight:bold;-webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; margin:10px 0px 20px 0px">An item you ordered is in high demand. Your order is reserved for <span id="time"></span> minutes!</div>');
    	document.getElementsByClassName('main__header')[0].appendChild(fragment3);
    
    
    	var ten = 60 * 10,
    	display = document.querySelector('#time');
      
    	startTimer(ten, display);
    };

    HTML Code:
    <div class="main__header">
    </div>
    <div id="time">
    </div>
    Any ideas?

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,691
    Plugin Contributions
    123

    Default Re: where can I find out the "discount count down by the time"

    Not sure this is a good idea, since the order is in fact not reserved. If you have quantity 1, someone else can buy it underneath you, and you'd have a very unhappy customer ...
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: where can I find out the "discount count down by the time"

    And if the system is changed to in fact "reserve" the item, what's to prevent someone from cycling through and keeping it/them in reserve indefinitely?

    Certainly perhaps other text could be used to instill urgency, but like swguy said in summary, first to check-out wins...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,691
    Plugin Contributions
    123

    Default Re: where can I find out the "discount count down by the time"

    Quote Originally Posted by mc12345678 View Post
    And if the system is changed to in fact "reserve" the item, what's to prevent someone from cycling through and keeping it/them in reserve indefinitely?
    Part of the "reserve" modification needs to be logic to prevent this kind of abuse. You might even associate a fee with the reservation.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Dec 2017
    Location
    Adelaide
    Posts
    16
    Plugin Contributions
    0

    Default Re: where can I find out the "discount count down by the time"

    That is true, you guys make a good point.

    I would have to modify this with logic of course, but any ideas why I cant get get it to load inside the page using the on_load override??

 

 

Similar Threads

  1. Replies: 8
    Last Post: 17 Oct 2015, 01:13 AM
  2. Where do I find the "PDT Token" on my PayPal account?
    By CookieMonster in forum General Questions
    Replies: 4
    Last Post: 27 Apr 2013, 04:56 AM
  3. v151 Where is the code for the product listing sort "up" and "down' arrow?
    By rcrosier in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 30 Jan 2013, 06:38 PM
  4. Can't find where to change the name of the "Documents" sidebox..
    By candylotus in forum Basic Configuration
    Replies: 3
    Last Post: 23 Apr 2008, 12:07 AM
  5. can't find answer to "where is the rest of the cc number"
    By Karole in forum Managing Customers and Orders
    Replies: 6
    Last Post: 23 Jul 2007, 10:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR