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)
-   -   Pop up for CVV2 definition - need help (https://forum.x-cart.com/showthread.php?t=7055)

webman 04-07-2004 04:51 PM

Pop up for CVV2 definition - need help
 
I am trying to make a popup page that describes where to find the CVV2 code on one's credit card. However, I'm having trouble because I can't put the <script></script> html in the page header without the template deleting itself.

Can anyone suggest a way to create a simple popup page?

I'm using the latest version 3.5.x

Thanks!

TelaFirma 04-07-2004 05:25 PM

Enclose them in {literal} tags.. such as:

Code:

{literal}
<script></script>
{/literal}

This will prevent Smarty from parsing the script.

webman 04-07-2004 06:27 PM

I tried that but it still didn't work. Probably because I suck at writing javascript. I'll keep trying.

Thanks!

g0t0pless 04-13-2004 01:10 PM

How would you just add the text to the page. without it being any kind of popup?

I'd be happy if it was just noted below the field.

webman 04-19-2004 10:38 AM

thanks!

I just ended up adding a page describing where to find the CVV2 that opens in a new window.

minorgod 05-20-2004 11:19 AM

Ah...an easy one. All curly braces in your script must be enclosed in smarty {literal} tags to keep smarty from mistaking the javascript braces as smarty template tags. I usually just enclose the whole script in literal tags unless I need to substitute smarty variables into the actual javascript. So it would look like this in your template.
Code:

{literal}
<SCRIPT language=JavaScript1.2>
<!--
function popup_cvv2_instructions(product_id) {
    var w = "420"; //width of popup window
    var h = "420"; //height of popup
    window.open('/path/to/cvv2/instructions.html',"cvv2 help window","width="+w+",height="+h+",resizable,scrollbars=yes");
}
-->
</SCRIPT>
{/literal}

Then on your link or button you want to use to open the window, you'd do this:
Code:

What's CVV2?
or you could put the exact same syntax from the above href into an onClick event for a button or whatever.


All times are GMT -8. The time now is 11:21 AM.

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