| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
jQuery mod on Xcart (countdown for special offers) | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
jQuery mod on Xcart (countdown for special offers)
Dear friends,
I did a modification on store/skin/common_files/customer/service_head.tpl to include a counter for products with disccount.. The idea is that when the customer open a product with a special offer avilable the page shows a countdown and the user can buy that product on the desired time. For this mod I also change store/skin/common_files/customer/main/product.tpl The modification using PHP is ready, and the countdown is a jQuery script I bought on codecanyon. But the issue is that when I'm include the jQuery files on the .tpl the javascript code doesnt work properly. In fact it seems that it doesnt recognize the divs to show the countdown. I did the same modification on a litecommerce store and it works properly. Do you have some ideas or is a known issue that jQuery can not be included on the .tpl files of X-cart??.. Let me show you the code: store/skin/common_files/customer/service_head.tpl PHP Code:
store/skin/common_files/customer/main/product.tpl Here is the div #test where the countdown have to be loaded. PHP Code:
Hope someone could helpme!!.. I need to get this mod asap. Regards
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#2
|
|||||||
|
|||||||
Re: jQuery mod on Xcart (countdown for special offers)
S.o.s.
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#3
|
|||||||||
|
|||||||||
Re: jQuery mod on Xcart (countdown for special offers)
Don't use {php} in template files - not a good practice.
What are you trying to accomplish with the second piece of code? The php code there will not do anything - the div will still show just the way you have it - empty. The first part posted is similar
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#4
|
|||||||
|
|||||||
Re: jQuery mod on Xcart (countdown for special offers)
Steve thanks for your reply,
The second part of the code shows the div whether the product has special offer or not. That's the idea. Initially I tried using css but it doesn't work... And yes, I know that use {php} is not a good practice but by the moment I need to get this done asap. The issue is that the countdown it simply does'nt work. I don't know exactly if the jQuery library <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> casuses conflict with X-cart.
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#5
|
|||||||||
|
|||||||||
Re: jQuery mod on Xcart (countdown for special offers)
<!--countdown -->
<div id="counter_tlapalero" > <div id="test"> </div> </div> <!--/coutdown --> will load no matter what you have in the {php} since this code is not part of the {php} code but part of the template. And since you are using similar code in the first part there is nothing to load - the php 'if/else' you are putting out there will not do anything for the template - you have the html code as part of the template not as part of the php code
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: jQuery mod on Xcart (countdown for special offers)
You shouldn't be including the jquery library, jquery is used in current versions of X-cart already. I suspect you are including jquery twice.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||
|
|||||||
Re: jQuery mod on Xcart (countdown for special offers)
Mike
Thanks for your reply.. I'm not an expert on jQuery, thats the reason why I buy the countdown. I just have a question. It doesnt matter the jQuery version I load??. The gallery will always works?. Thankyou!!
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#8
|
|||||||
|
|||||||
Re: jQuery mod on Xcart (countdown for special offers)
Mike I've remove the line where I load jQuery and the issue is the same. The contdown it doesnt work.
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#9
|
|||||||
|
|||||||
Re: jQuery mod on Xcart (countdown for special offers)
Hey.. I found the error. If I remove the line <script type="text/javascript" src="http://store.com/var/cache/_c036329c826190c5a2b1124219029131.js"></script> where X-cart loads jQuery I mean, the count down works properly.
At the same time I need to load <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> What do you recommend me to do?.. Could somebody helpme? Regards!!
__________________
X-Cart 4.5.5 Litecommerce Version: 2.2.45 MИxico |
|||||||
#10
|
|||||||||
|
|||||||||
Re: jQuery mod on Xcart (countdown for special offers)
Do not remove the line with the cached file - all js code needed for the cart to function is in there. You can try to turn off the Spped up tools in admin settings and see if it works. If XC loads jQuery version lower than the one required by your plugin then it will not work. You may need to replace it with your jQuery call
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|