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)
-   -   Removing Javascript (https://forum.x-cart.com/showthread.php?t=38772)

Cyber Matrix 04-02-2008 05:21 AM

Removing Javascript
 
Does this js need to be in the header?
<script type="text/javascript">
<!--
var number_format_dec = '.';
var number_format_th = '';
var number_format_point = '2';
var store_language = 'US';
var xcart_web_dir = "";
var images_dir = "/skin1/images";
var lbl_no_items_have_been_selected = 'No items have been selected';
var current_area = 'C';
-->If so where is it at to link to it instead of it being on each page? I have tried to remove it and link to it but I get errors.

balinor 04-02-2008 05:41 AM

Re: Removing Javascript
 
Yes, you need it and it has to stay visible.

BunnyburyBaby 04-29-2008 05:48 PM

Re: Removing Javascript
 
can this script be moved from presets_js.tpl to a .js file to remove it from the head html? If we have a site that only sells in the US, one language and one user type? Can we hard code it like this:

old code:
Code:

<script type="text/javascript">
<!--
var number_format_dec = '{$number_format_dec}';
var number_format_th = '{$number_format_th}';
var number_format_point = '{$number_format_point}';
var store_language = '{$store_language}';
var xcart_web_dir = "{$xcart_web_dir}";
var images_dir = "{$ImagesDir}";
var lbl_no_items_have_been_selected = '{$lng.lbl_no_items_have_been_selected|escape:javascript}';
var current_area = '{$usertype}';
-->
</script>


new code stored in a whateveryounameit.js file
Code:

<script src=" http://mysite.com/whateveryounameit.js" type="text/javascript"></script>

and have the whateveryounameit.js file contain the following:
Code:

var number_format_dec = '.';
var number_format_th = '';
var number_format_point = '2';
var store_language = 'US';
var xcart_web_dir = "";
var images_dir = "/skin1/images";
var lbl_no_items_have_been_selected = 'No items have been selected';
var current_area = 'C';


What are the limitations?

Thanks a bunch!
bunnyburybaby

BunnyburyBaby 04-30-2008 09:07 AM

Re: Removing Javascript
 
If it can be placed in a static form in an external .js file, could it be placed in the /skin1/common.js file?

HumanNature 05-15-2008 04:44 PM

Re: Removing Javascript
 
Quote:

Originally Posted by balinor
Yes, you need it and it has to stay visible.


Sorry to ask about it (maybe a silly question) but I have just removed the content of this template (in a test site) and my cart seems to work perfect.

Which is the problem about deleting this JS?

Yours

Cefko 06-30-2008 05:18 AM

Re: Removing Javascript
 
Any conclusion to this? Can it be removed safely?


All times are GMT -8. The time now is 10:59 PM.

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