I am use active javascript as countdown, it work fine in home page with tease view, but jump to the node page, countdown is broken.
I am use active javascript as countdown, it work fine in home page with tease view, but jump to the node page, countdown is broken.
Comments
Comment #1
WebNewCastle commentedWill you describe further in what way it doesn't work?
Comment #2
iSheng commentedat the node page with LTO, it show up Expires time correct at the very begining, then Expires in time jump to 0 immediately.
Comment #3
WebNewCastle commentedThis is confusing if the issue is on the full node view. Do you have a URL you feel comfortable posting? I don't have the bandwidth to try to help troubleshoot this week, but I can try to do so soon.
Comment #4
vidichannel commentedI have same problem here had to put it back to the non-counting version.
Flashes for a second on the countdown clock and goes straight to 0. I played with switching the JS source to my theme folder, but it made no difference. Also tried to remove it from the Catalog; no change. I am using Boost.
Expires in:
0 sec
Comment #5
WebNewCastle commentedHi,
Thanks for the report and information. So given the "flash" and that you've tried different JS files, there's something in the main part of the JS that is conflicting. Unfortunately, that could probably be a considerable number of things. And I don't know if using Boost is a conflict with this - I thought I had tested this on a site with Boost installed, but I'll have to double check on that.
When you were working on this, were there a variety of expiration times that you tried? And are you using user configurable timezones on the site?
- Matt
Comment #6
gakshay commentedHaving the same problem but in only occurs when there are more than one Active Expiration Timers on single page view => then it renders 0sec.
If the page view is having single Active Countdown timer on a single node (with all other content having Active Countdown = False) then it works fine...What shall be the fix in former case??
Comment #7
WebNewCastle commentedCurrently, that it doesn't display correctly where there is more than one timer on a page is "as designed". Not in the sense that such was the goal, but in the sense that the way the Javascript is put together it would get confused by more than one timer on a page.
So really this is an aspect that needs to be improved when it works out to have a completely different javascript mechanism for the module - which is a goal that hasn't quite reached the point of a "schedule and plan of action".
Comment #8
vidichannel commentedI have only one and still have the issue
Comment #9
andrews501 commentedVidiChannel,
Check this link, I was having the same problem and solved it.
http://drupal.org/node/821260#comment-3611722
Comment #10
arski commentedHey guys, just a hint - I was having similar issue when trying to add the countdown timer to a block that gets displayed on the same page as the actual product node. The problem turned out to be that the LTO JS settings were set twice.
What helps is to check the source of your page and look for a line like jQuery.extend(Drupal.settings in the very beginning.. then look to the right and you should see something like "ucLTO": { "expiration": 1288946820,. If instead of a proper timestamp you're seeing something like "expiration": [ 1288946820 , 1288946820 ], or if you're not seeing those settings at all, then that's a good debugging start already :)
Cheers
Comment #11
vidichannel commentedHere is a fix that worked for me. In line 374 of uc_lto.module change the "LTO" to lower case. Also works for number 9 above without having to add the path name for the theme.
if ($open && !$teaser && $node->lto_type == 9) {
drupal_add_js(array(
--- Original Code: 'ucLTO'
+++ 'uclto' => array(
'expiration' => $node->expiration + variable_get('date_default_timezone', 0),
'timeGran' => intval(variable_get('uc_lto_time_gran', 2)),
'doCountdown' => TRUE,
),
), 'setting');
Comment #12
WebNewCastle commentedVery peculiar.
I'm glad to hear it's working for you, and thanks for taking the time to post again. At the moment, I don't quite understand why that made a difference, but it certainly isn't an issue to patch the module if this is going to work for more people.
I still want to explore changing the javacript overall, hopefully in a couple weeks.
If anyone else tries this and finds it solves an issue, please post as well. Thanks!
- Matt
Comment #13
vidichannel commentedRather bizarre solution, I admit. I was guessing it must have been an issue for how the variable was defined originally. Just to provide platform specifics, I am running Windows Server 2008R2 and IIS. Since many are running Linux and Apache this may suggest some hint. From my experience this case-sensitive conclusion seems quite backward since Linux tends to be more case-sensitive than Windows, but it seems to work. The code issues are over my head.
Thanks for a great module.
Comment #14
WebNewCastle commentedWow, I'm confused because I could have sworn I circled back and responded to this. Thanks again, and yes, that does seem weird as I would have guessed the same thing in regards to platforms and case sensitivity.
Comment #15
seancorrales commentedI was battling with this some and have some information to share.
As someone else pointed out, the case here is the JS variables are getting set under drupal.settings more than once. The result is the settings look like
"expiration": [ 1294419600, 1294419600 ], "timeGran": [ 3, 3 ], "doCountdown": [ true, true ]
When the calculation is attempted on the expiration date, the "," and space cause an error resulting in a NaN JS error henceforth the "0 Secs" error that everyone is getting.
The error seems to specifically tie back to this function in the module file: uc_lto_status_form(). This function adds the JS. I put in some statements to see when this function was being called and, sure enough, it was being called twice.
In my case, I have a single product being loaded twice because it's in separate views so I suspect that's part of my problem. That being said, going to the individual product page produces three calls to the function instead of two.
I'm currently working on a solution to be sure that these items aren't inserted multiple times. I'll post my solution back here if it's worth sharing.
Comment #16
ktleow commentedI think I may have a fix for the 0 sec countdown bug.
Let me know if this works for you guys. Its basically a dirty hack to rely on form ID of the countdown and look for the correct index in expiration settings array.
Edit uc_lto.js file:
But there MAY be a situation whereby the order of the expiration settings is different from the form IDs.
Feel free to use it, improvise and post here your solution if you have a better one.
Comment #17
ktleow commentedOk I posted my solution too soon.
It doesnt work when a product has expired.
Will find a workaround and share here.
Comment #18
ktleow commentedAnyone who needs a quick fix:
Look at uc_lto.module
function uc_lto_status_form()Just follow what I did and uncomment the if-else condition.
Because my previous workaround editing the JS relies on the array indexes, what this does is simply output the expiration timestamp even though the product has already expired.
Comment #19
WebNewCastle commentedHi Everyone,
Sorry for the delay and thank you to all of you who have posted information.
I can work on making updates, but I'm at a bit of a fork in the road as I try to set aside time in 2011 to catch up. Primarily, I think the entire Javascript mechanism right now is too limited both for tackling a few issues and extending further for feature requests. One of the primary issues I've seen is language/translation related.
I think the entire mechanism actually just needs to be re-written entirely. I'll post further when I sit down and have thought through this further. I've drastically slowed down the number of projects I'm accepting, so I'm hoping this will allow some more time for contributed module development.
- Matt
Comment #20
beautifulmindMy issue was little different, I was not able to get the count down timer working on the node teasers, so I followed #18 and re-wrtitten the condition as
if ($open && $node->lto_type == 9) {And that worked for me.
I really appreciate posting your solutions here.
Thank you very much.
Regards.
Comment #21
brian brovelli commentedI achieved this by simply changing JS Style from Default to custom at /admin/store/settings/lto. No other changes.
Comment #22
lynx1976 commentedHi folks! I had the same problem during last days.. I fixed (temporary) downloading and installing jQuery countdown module and changing a bit the function theme_uc_lto_status into the .module file like this:
and adding a variable into $form array:
Seems it works succesfully.
Anyway I am waiting for a cleanest solution.
Comment #23
roman_l commentedThanks lynx1976!
#22 makes the JS countdown work, but with the code above it displays "NaN" (not a number) in the countdown div.
Just had to edit a few lines and all is ok with D6 / Ubercart 2.4 / uc_lto 6.x-1.1
Comment #24
jasonabc commentedThe fix in #21 worked for me. Thanks!