X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   adding java script (https://forum.x-cart.com/showthread.php?t=526)

seaCOAST 11-04-2002 12:39 PM

adding java script
 
I have a hosted live-chat customer service and want to insert into a template (ie- poweredby.tpl).

I tried adding the code, but I got a smarty error.

Is there a way to do this successfully? :?

ArmyNavy 11-04-2002 12:45 PM

I'm interested in this, as well. :)

syddos 11-04-2002 02:21 PM

Hi seaCost, ArmyNavy,

I'm not sure I understand your requirements correctly, are you trying to add the text "Powered By XXXX", or a graphic like the "Powered by Xcart", or is it a template file you want to insert into another template?

Regards,

Ian 11-04-2002 03:33 PM

Hi all

Is it "Live Helper" by chance you are using ? If so I have been testing it and I maybe able to help you

Ian
:D

ATKOgirl 11-04-2002 04:27 PM

Hi,

I'm quite interested in this too!

ATKOgirl

Ian 11-04-2002 04:45 PM

The way I have been testing "Live Helper" from http://www.turnkeywebtools.com/ is like this.

I install the program onto my server as in their instructions and the address I use in the admin set up is my normal http URL.

In X-Cart I use the following at the bottom of the powered.tpl file

Note this end uses the secure address

This allows me to track people as they enter and move around inside X-Cart and they can call up for an on-line chat to ask questions. All seems to work well and it is in my 3.2.1 version that should be going live in a few days.

Hope this helps everyone.
Ian
:D

ArmyNavy 11-04-2002 09:00 PM

Live help stuff will come later for me, I'm sure. My main issue is adding any javascript at all. After I add some, the system chokes and won't generate pages. I'm still totally new to x-cart, and I'm no php meister. So, I'm sure the problem is likely on my end, but I thought I'd mention my interest to see what's what.

How do you like that live help system? Can it handle lots of simultaneous users?

Many thanks :)

Ian 11-04-2002 09:20 PM

Live Helper is good, you can have as many operators as you want to take the calls. If you get too many at one time it will queue them and notify them to what number they are in the queue. Quite impressive for a small collection of files. I tried it for a short time on my live site and I quickly had a few people call so I think its worth it. I spotted it on one of Boomers sites I think and thats how I came to give it a go.

Ian
:D

ATKOgirl 11-04-2002 10:47 PM

Here's an extremely interesting article about this functionality:

http://www.internetretailer.com/article.asp?id=7742

Definitely boosts ROI!!!


ATKOgirl

seaCOAST 11-04-2002 11:44 PM

Quote:

Originally Posted by Ian
Hi all

Is it "Live Helper" by chance you are using ? If so I have been testing it and I maybe able to help you

Ian
:D


Hi Ian,

It's similar only I don't run any scripts from my site. It's a hosted-service. The javascript just opens a chat window.

I'm just not sure where to put the javascript. I tried putting it in poweredby.tpl after the image, but that generated errors. Maybe I need it in a seperate template?

funkydunk 11-05-2002 02:25 AM

Can you add the javascript as an include and have the whole javscript as a separate file?

such as:
Code:

<script language="JavaScript1.2" src="myjavascript.js"></script>

Funkydunk

seaCOAST 11-05-2002 02:35 AM

Quote:

Originally Posted by funkydunk
Can you add the javascript as an include and have the whole javscript as a separate file?

such as:
Code:

<script language="JavaScript1.2" src="myjavascript.js"></script>

Funkydunk


The script I paste into my html's looks like this:

Code:

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from old browsers
function newscreen4() {
                window.open("","talk","width=300,height=350,resizable=no,scrollbars=auto")
                }
// Stop hiding from old browsers -->
Stamp = new Date();
year = Stamp.getYear();
document.write('http://www.theirsite.com/include/operator/icon.php?clientid=3627&'+Stamp+'');
</SCRIPT>


I tried pasting it directly into the poweredby.tpl and the smarty errors came. :?

funkydunk 11-05-2002 02:53 AM

Try this:

Code:

{literal}
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from old browsers
function newscreen4() {
                window.open("","talk","width=300,height=350,resizable=no,scrollbars=auto")
                }
// Stop hiding from old browsers -->
Stamp = new Date();
year = Stamp.getYear();
document.write('[img]http://www.theirsite.com/include/operator/icon.php?clientid=3627&'+Stamp+'[/img]');
</SCRIPT>
{/literal}


seaCOAST 11-05-2002 03:05 AM

WOOHOO!

It worked! :D


THANK YOU FUNKY :!: :!:


What is the {literal} for?

funkydunk 11-05-2002 03:09 AM

It just tells smarty to keep its mitts off the code and show exactly what is written. The problem is in the { brackets which smarty then tries to substitue code/variables etc.

Great to be of help.

Funkydunk

chris 11-05-2002 04:46 AM

ArmyNavy - adding javascript within a tpl
 
I think other have gone off at a tangent

all you have to do is add the line:
{literal}
at the beginning of your javascript
and finish off with
{/literal}

what this does is tell smarty to ignore everything inside the brackets - i.e to read it (javascript) literally,

Chris

funkydunk 11-05-2002 04:58 AM

absolutely.

8)

syddos 11-05-2002 03:21 PM

seaCost, ArmyNavy,

you can mix smarty and javascript together using the {literal} {/literal} tags describe by Ian.

Here is an example; Ignore the lines begining with "//alert", they are just for variable debuging.

Quote:

{literal}
<SCRIPT language=javascript1.2>
<!--

framePath.jsFirstname={/literal}"{$userinfo.firstname}"{literal}
//alert('jsFirstname = '+framePath.jsFirstname );

framePath.jsLastname={/literal}"{$userinfo.lastname}"{literal}
//alert('jsLastname = '+framePath.jsLastname );

framePath.jsCurrentarea={/literal}"{$current_area}"{literal}
//alert('jsCurrentarea = '+framePath.jsCurrentarea );

framePath.jsMinicart_t_items={/literal}"{$minicart_total_items}"{literal}
//alert('jsMinicart_t_items = '+framePath.jsMinicart_t_items );

framePath.jsCurrency_symbol={/literal}"{$config.General.currency_symbol}"{litera l}
//alert('jsCurrency_symbol = '+framePath.jsCurrency_symbol );

framePath.jsMinicart_t_cost={/literal}"{$minicart_total_cost}"{literal}
//alert('jsMinicart_t_cost = '+framePath.jsMinicart_t_cost );
//-->
</script>
{/literal}



Regards,

ArmyNavy 11-05-2002 08:18 PM

Many thanks, Syddos. As soon as I saw that "literal" thing, I knew that's what we were looking for. More Smarty stuff...

:) :)

aostuff 12-12-2002 12:25 PM

I've been using PHPLiveSupport from http://www.phplivesupport.com/ on my site for quite some time for the chat functionality. Very, very easy to integrate, and I get a ton of customers online using it. I forget the fee, but the software is like $100 one-time-fee, so it's not hosted, and you don't pay a recurring fee.

If you'd like to see a live example, you can visit my site at www.aostuff.com.

Take care,

Nick


All times are GMT -8. The time now is 02:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.