Jump to content

Buy before x and get delivered by x module


mikevalueav

Recommended Posts

Very similar to what Amazon has where it displays

 

Want it tomorrow, 11 March? Order it within 13 hrs 16 mins and choose One-Day Delivery at checkout

 

Is this possible ? i have tried adding javascripts i have found online but it just displays the code on the page or breaks it completly.

 

Any help would be awesome.

 

I need it to be text not images or banners etc :()

 

Thanks,

 

Mike

Link to comment
Share on other sites

To be honest i dont remember where i put it - would it make a difference ? and now i cant even find the code i used :(

 

But i would REALLY like to have something like this on my site so if anyone out there knows how to do it i would love it if you shared your knowledge

Link to comment
Share on other sites

Hi Chavkilla,

On which page(s) would you like to add this? In the header of all pages, only product detail page, the category/Product-list pages etc.

 

Please be specific what you need, so we can better help you find a solution.

What PrestaShop version?

 

pascal.

Link to comment
Share on other sites

To be honest i dont remember where i put it - would it make a difference ? and now i cant even find the code i used :(

 

But i would REALLY like to have something like this on my site so if anyone out there knows how to do it i would love it if you shared your knowledge

Yes it makes a difference and if you do not remember where you put the code, you can say on wich page it appears.

 

And if you 'REALLY' want it, gather your mind to provide, at least, minimum technical informations and implication <_<

Link to comment
Share on other sites

I am sorry if my "technical informations and implication" provided was not enough but considering i was asking if it was possible to have done i wasnt under the impression that i needed to provide version numbers etc - not really an obvious obversation imho.

 

But i am using PrestaShop 1.5.4.1 and would like it to show on the homepage and product pages under the "referance" section.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I made some time clock that gets a specific time (say 17:00 hours) and then shows in hours, minutes, seconds how long you still have to go until it's 17:00 hrs.

 

As an example, I added it to the themes/<your theme folder>/header.tpl file (backup the file, just in case)

 

I added some javascript code just before the {$HOOK_HEADER}  :

...

<script>
function getTimeDifference( endtime)
{
   var now = new Date();
   var endtime = new Date(new Date(now.getFullYear(), now.getMonth(), now.getDate(), 17, now.getTimezoneOffset(), 0)).getTime();
   var now = now.getTime();

    if(isNaN(endtime)) {
        $("#demo").html('');
        return;
    }

    if (endtime < now) {
        var milisec_diff = endtime + 1000*3600*24 - now;
    } 
    else {
        var milisec_diff = endtime - now;
    }


    var date_diff = new Date( milisec_diff );

    $("#demo").html(date_diff.getHours() + " Hours " + date_diff.getMinutes() + " Minutes " + date_diff.getSeconds() + " Seconds");
    return;
}


var myVar=setInterval(function () {
        getTimeDifference();
    },1000);

</script>


		{$HOOK_HEADER}
	</head>

and a

 

<span id="demo"></span>

 

somewhere in the code (I put it just below the breadcrumb)

...
{include file="$tpl_dir./breadcrumb_top.tpl"}

<span id="demo"></span>
...

This span will be the place where the couter will be displayed.

 

 

Example:

post-455771-0-76520100-1396559034_thumb.png

 

of course you can just add some css code and maybe some more text around the span like:

 

Want it tomorrow? Order within <span id="demo"></span> and choose One day Delivery at checkout

 

(note that the span text itself is updated in the javascript, so don't put anything extra between the <span></span> as it will be overwritten. (Or add it inside the javascript instead)

 

See working sample (link to test site, may not work/be available in future)

http://ps1550.buymethai.com/

 

Hope this helps,

pascal

Link to comment
Share on other sites

  • 7 months later...

I made some time clock that gets a specific time (say 17:00 hours) and then shows in hours, minutes, seconds how long you still have to go until it's 17:00 hrs.

 

As an example, I added it to the themes/<your theme folder>/header.tpl file (backup the file, just in case)

 

I added some javascript code just before the {$HOOK_HEADER}  :

...

<script>
function getTimeDifference( endtime)
{
   var now = new Date();
   var endtime = new Date(new Date(now.getFullYear(), now.getMonth(), now.getDate(), 17, now.getTimezoneOffset(), 0)).getTime();
   var now = now.getTime();

    if(isNaN(endtime)) {
        $("#demo").html('');
        return;
    }

    if (endtime < now) {
        var milisec_diff = endtime + 1000*3600*24 - now;
    } 
    else {
        var milisec_diff = endtime - now;
    }


    var date_diff = new Date( milisec_diff );

    $("#demo").html(date_diff.getHours() + " Hours " + date_diff.getMinutes() + " Minutes " + date_diff.getSeconds() + " Seconds");
    return;
}


var myVar=setInterval(function () {
        getTimeDifference();
    },1000);

</script>


		{$HOOK_HEADER}
	</head>

and a

 

<span id="demo"></span>

 

somewhere in the code (I put it just below the breadcrumb)

...
{include file="$tpl_dir./breadcrumb_top.tpl"}

<span id="demo"></span>
...

This span will be the place where the couter will be displayed.

 

 

Example:

attachicon.gifcountdown timer.png

 

of course you can just add some css code and maybe some more text around the span like:

 

Want it tomorrow? Order within <span id="demo"></span> and choose One day Delivery at checkout

 

(note that the span text itself is updated in the javascript, so don't put anything extra between the <span></span> as it will be overwritten. (Or add it inside the javascript instead)

 

See working sample (link to test site, may not work/be available in future)

http://ps1550.buymethai.com/

 

Hope this helps,

pascal

Hi,

 

How do i change the time with 30 minutes?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...