Jump to content

[Solved] Countdown Timer For Special Prices (Current V0.8.1)


Recommended Posts

  • 1 month later...
  • 2 weeks later...

Hi All,

 

I managed to display the counter in drop-prices product page. (product.tpl)

The problem is that i dont know where to place the PHP code so it will transfer the reduction to date and the current date to the tpl file.

without these calculations, i will always get a 24 hours count.

 

If someone can assist with that, i can publish here the way to display a counter on product page (works with 1.4.4.0)

 

Thanks.

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...
Can you tell what you did?

 

The main change was to change the return line at the hotprice.php to:

return $this->display(__FILE__, 'product.tpl');

This way it will send the data to the product page.

 

In addition, i added the hot price block to the right side which is invisable at my tpl.

At the product.tpl i added all the literal script and some more graphical changes.

 

Also, fixed another bug i find (when you are looking at the page and it came to zero, it will continue for another day!!):

in the literal part:

var ended = 0;

//days ='30';

{literal}

<!--

function setCountDown()

{

seconds--;

if ((days < 1) && (hours < 1) && (minutes < 1) && (seconds < 1 ))

{

ended=1;

}

if (seconds < 0){

minutes--;

seconds = 59

}

if (minutes < 0){

hours--;

minutes = 59

}

if (hours < 0){

days--;

hours = 23

}

if (days < 1){

$("#remain").html(hours+":"+minutes+":"+seconds);

}

else {

var d = (days > 1 ? ldays : lday );

$("#remain").html(days +" " + d + " "+hours+":"+minutes+":"+seconds);

}

if ( ended < 1)

{

setTimeout ("setCountDown()", 1000 );

}

 

 

 

and later on i am using it:

{if $ended > 0}

<div class="block_content">

<div id="hotprice">

<table><BR>

<tr><td class="on_sale"><b><font color=red>{l s='SORRY : Special Sale Ended!'}</font></b></td></tr>

</table>

</div>

</div>

{/if}

 

 

 

Hope it helps...

Share this post


Link to post
Share on other sites
  • 5 months later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 3 months later...
  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...
  • 2 weeks later...
  • 1 month later...

Hi everyone.

I can make some fixes if this module in not working for you Prestashop version.

 

Fixed price of this work is 5 euros by paypal.

 

PM me ftp access of your site, i will look, tell you if i can fix it, you pay and get working module.

If you need some change of design also i can help you.

 

 

Hello, i need this module for my page.
As I get?
One question, how many products can be active or no limit.
thanks!

Josep 

 

 

 

As i understand a code it will show you a counter of ONE random product with discount.

Edited by anseme (see edit history)

Share this post


Link to post
Share on other sites

Try left side or in my footer my account 

 

Hi lightsb,

 

Thank you for your script I tested it locally. It does not work in 1.5.4.1 :-(
Same result on your site:

NaN Ore  NaN Min  NaN Sec

 

Thank you for your attention,

post-10503-0-19404900-1379331339_thumb.png

Share this post


Link to post
Share on other sites

Hi,

 

Pls find this line (row:459):

 

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

<div class="clear"></div>
 
And below put this cod:
 
 
{if ($product->specificPrice.reduction) AND ($product->specificPrice.to|date_format:'%Y-%m-%d' >= $smarty.now|date_format:'%Y-%m-%d')}
<b>Oferta este valabila :</b>
<link rel="stylesheet" type="text/css" href="{$base_dir}css/jquery.countdown.css" />
<script type="text/javascript" src="{$base_dir}js/jquery/jquery.countdown.js"></script>
<div id="reductioncountdown" style="overflow:auto;"></div>
<script type="text/javascript">
 $("#reductioncountdown").countdown({ldelim}until: new Date('{$product->specificPrice.to|date_format:'%Y-%m-%d'}'){rdelim});
</script>
<b>sau in limita stocului disponibil</b>
{/if}

 

 

Try again.

Share this post


Link to post
Share on other sites

Hi,

 

Pls find this line (row:459):

 

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

<div class="clear"></div>
 
And below put this cod:
 
 
{if ($product->specificPrice.reduction) AND ($product->specificPrice.to|date_format:'%Y-%m-%d' >= $smarty.now|date_format:'%Y-%m-%d')}
<b>Oferta este valabila :</b>
<link rel="stylesheet" type="text/css" href="{$base_dir}css/jquery.countdown.css" />
<script type="text/javascript" src="{$base_dir}js/jquery/jquery.countdown.js"></script>
<div id="reductioncountdown" style="overflow:auto;"></div>
<script type="text/javascript">
 $("#reductioncountdown").countdown({ldelim}until: new Date('{$product->specificPrice.to|date_format:'%Y-%m-%d'}'){rdelim});
</script>
<b>sau in limita stocului disponibil</b>
{/if}

 

 

Try again.

 

No effect. Same result on a 1.5.4.1:

 

NaN

OreNaN

MinuteNaN

Secunde

 

 

 

A note, here is your code -----COD pentru 1.4.X----

{if ($product->specificPrice.reduction) AND ($product->specificPrice.to|date_format:'%Y-%m-%d' >= $smarty.now|date_format:'%Y-%m-%d')}
<b>Oferta este valabila :</b>
<link rel="stylesheet" type="text/css" href="{$base_dir}css/jquery.countdown.css" />
<script type="text/javascript" src="{$base_dir}js/jquery/jquery.countdown.js"></script>
<div id="reductioncountdown" style="overflow:auto;"></div>
<script type="text/javascript">
 $("#reductioncountdown").countdown({ldelim}until: new Date('{$product->specificPrice.to|date_format:'%Y-%m-%d'}'){rdelim});
</script>
<b>sau in limita stocului disponibil</b>
{/if} 

here is your code ----COD pentru 1.5.X----

{if ($product->specificPrice.reduction) AND ($product->specificPrice.to|date_format:'%Y-%m-%d' >= $smarty.now|date_format:'%Y-%m-%d')}
<b>Oferta este valabila :</b>
<link rel="stylesheet" type="text/css" href="{$base_dir}css/jquery.countdown.css" />
<script type="text/javascript" src="{$base_dir}js/jquery/jquery.countdown.js"></script>
<div id="reductioncountdown" style="overflow:auto;"></div>
<script type="text/javascript">
 $("#reductioncountdown").countdown({ldelim}until: new Date('{$product->specificPrice.to|date_format:'%Y-%m-%d'}'){rdelim});
</script>
<b>sau in limita stocului disponibil</b>
{/if}

Exactly the same one, seems to me it…

Share this post


Link to post
Share on other sites

Ok .. sorry.

this script is another alternative module countdown.

 

 

Shams .. 

 

copy file in location:
- root/css/jquery.countdown.css
- root/js/jquery/jquery.countdown.js
 

for 1.5.4.0 work .. link

for 1.4.5.0 work .. i tested on localhost.

Share this post


Link to post
Share on other sites

 

Ok .. sorry.

this script is another alternative module countdown.

 

 

Shams .. 

 

 

 

Is this code protected or just obfuscated? Why we cant see the code it self if this is for free?

 

May be its bad js who make some iframe with another code?

 

Can you provide version where everyone can read the code?

Edited by anseme (see edit history)

Share this post


Link to post
Share on other sites

 

Is this code protected or just obfuscated? Why we cant see the code it self if this is for free?

 

May be its bad js who make some iframe with another code?

 

Can you provide version where everyone can read the code?

 

 

 

:)

code is clean... and can be read ... try tis link

Share this post


Link to post
Share on other sites

i get it but there only 2 files.

 

with css no problem but .js... did you see what is in there?

 

 

eval(function(p,a,c,k,e,r){e=function©{return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e©]=k[c]||e©;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e©+'\\b','g'),k[c]);return p}('(A($){A 1i(){8.1B=[];8.1B[\'\']={1j:[\'2t\',\'2u\',\'2v\',\'2w\',\'2x\',\'2y\',\'2z\'],2A:[\'2B\',\'2C\',\'2D\',\'2E\',\'2F\',\'2G\',\'2H\'],1k:[\'y\',\'m\',\'w\',\'d\'],1C:\':\',1R:1e};8.1f={1S:E,1T:E,1U:E,1V:E,1W:\'2I\',1l:\'\',1X:1e,1D:\'\',1Y:\'\',1Z:\'\',20:1e,21:E,22:E};$.1t(8.1f,8.1B[\'\'])}x w=\'G\';x Y=0;x O=1;x W=2;x D=3;x H=4;x M=5;x ....

 

This is a code what anyone can read? Are you kidding me?

Share this post


Link to post
Share on other sites
  • 5 months later...

It works for me in PS 1.5 . You need to open the archive and you will find a directory, in there you will find 4 files.

Ffollow the readme file

 

Copy :

 

- root/css/jquery.countdown.css
- root/js/jquery/jquery.countdown.js

 

After this depends what type of PS you have to insert in your theme director/product.tpl the code...i put it after line 448 in product.tpl.

 

 

Thank you for this script.

Can I set it for categories, please?

Edited by Rasq (see edit history)

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 year later...
  • 6 months later...

Hi!!

 

I have inserted this code in my prestashop, but this doesn't work correctly.

 

I can see the countdown perfectly, but when I introduce an offer in a certain hour it shows wrong the time until the end of the offer. If I define both the starting date and the final date in 00:00 in the back office of the module in Prestashop, there's no problem. But when I define the starting or final date in an hour different from 00:00, it ignores me. It is like the module don't caught de hour, only the day. Is this possible?

 

Can anybody help me, please? Any idea?

 

Thanks!

Edited by Edlloro (see edit history)

Share this post


Link to post
Share on other sites
  • 3 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More