Not sure what you mean by extra javascript.
Javascript is integral to the fuctionality of OpenCart. It simply will not function without javascript without a major rewrite of the core code
Javascript is integral to the fuctionality of OpenCart. It simply will not function without javascript without a major rewrite of the core code
Thanks to reply
actually i want to move internal javascript to external file , such as some module like currency converter has javascript in his own files like .tpl files i need to move them in external files and how i call them please
actually i want to move internal javascript to external file , such as some module like currency converter has javascript in his own files like .tpl files i need to move them in external files and how i call them please
OK, I see now what you mean.
try moving the code to an external file and then reference it
Please know that some javascript needs to be in the position it is within tpl files etc and cannot simply be moved to the HEAD or FOOTER
try moving the code to an external file and then reference it
Code: Select all
<script type="text/javascript" src="link/to/external/file.js"></script>
thanks for reply
i did it according to your instructions but it does not work, following is the code which i need to move in external file from internal file of currency converter module see this code of tpl file
javascript code was at end and then i move it to another file and reference it like that please see....
Javascript code is following which i grab from above file at the bottom
i did it according to your instructions but it does not work, following is the code which i need to move in external file from internal file of currency converter module see this code of tpl file
javascript code was at end and then i move it to another file and reference it like that please see....
Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-currency">
<div class="c-amount">
<?php echo $text_amount; ?>
<input style="text-align:right" type="text" size="10" value="<?php echo $currency_value; ?>" name="currency_value"/>
</div>
<div class="c-from">
<?php echo $text_from; ?><br />
<select style="max-width:160px" name="currency_from">
<?php foreach($currencies as $currency){ ?>
<option <?php echo ($currency['currency_code'] == $currency_from) ? 'selected="selected"' : ''; ?> value="<?php echo $currency['currency_code']; ?>"><?php echo $currency['currency_name'].'('.$currency['country_code'].')';?></option>
<?php } ?>
</select>
</div>
<div class="c-to">
<?php echo $text_to;?><br />
<select style="max-width:160px" name="currency_to">
<?php foreach($currencies as $currency){ ?>
<option <?php echo ($currency['currency_code'] == $currency_to) ? 'selected="selected"' : ''; ?> value="<?php echo $currency['currency_code']; ?>"><?php echo $currency['currency_name'].'('.$currency['country_code'].')';?></option>
<?php } ?>
</select>
</div><br />
<div style="text-align:center" class="converter">
<div id="c-loadding"></div>
<a class="button" id="goconverter" ><span><?php echo $text_converter;?></span></a>
</div><br />
<div class="c-results">
<p class="prices"> <?php echo $currency_value.$currency_from.' = '.$currencyconverter['amount'].$currency_to; ?></p>
<p style="font-size:10px"><?php echo $text_rate.$currencyconverter['date'].' '.$currencyconverter['time']; ?></p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="catalog/view/theme/default/template/module/currencyconverter.js"></script>
Code: Select all
<script type="text/javascript"><!--
$('a#goconverter').bind('click',function(){
$.ajax({
type: 'POST',
url: 'index.php?route=module/currencyconverter',
data: 'currency_value=' + encodeURIComponent($('input[name=\'currency_value\']').val()) + '¤cy_from=' + encodeURIComponent($('select[name=\'currency_from\']').val()) + '¤cy_to=' + encodeURIComponent($('select[name=\'currency_to\']').val()),
dataType: 'json',
beforeSend: function() {
$('#c-loadding').html('<img src="catalog/view/theme/default/image/loading.gif" id="loading" style="padding-left: 5px;" />');
},
success:function(json){
if(json.error)
{
$('.c-results').html('<p style="color:red">'+json.error+'</p>');
$('#c-loadding').html('');
}
if(json.currencyconverter)
{
var html = '';
html += '<p class="prices">';
html += json.currency_value + json.currency_from;
html += ' = '+ json.currencyconverter['amount'] +'';
html += json.currency_to;
html += '</p>';
html += '<p style="font-size:10px">';
html += '<?php echo $text_rate; ?>';
html += json.currencyconverter['date']+json.currencyconverter['time'];
html += '</p>';
$('.c-results').html(html);
$('#c-loadding').html('');
}
}
})
});
//--></script>
Try removing the first and last lines in you .js file as they should not be there
If it still doesn't work after that, I'm guessing that it is important that some js code needs to be left inline, which is probably why Daniel did it that way.
If it still doesn't work after that, I'm guessing that it is important that some js code needs to be left inline, which is probably why Daniel did it that way.
Another problem is i need to remove welcome content in error page here i show you code of not_found.tpl code...
when i remove <?php echo $content_bottom; ?> it disappear all bottom cotent but i just need to remove welcome content from that page and search page..is there way to solve this?
<?php echo $header; ?>
<div class="container"><?php echo $content_top; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<div class="content"><?php echo $text_error; ?></div>
<!--<div class="buttons">
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
</div>--!>
<?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>
when i remove <?php echo $content_bottom; ?> it disappear all bottom cotent but i just need to remove welcome content from that page and search page..is there way to solve this?
<?php echo $header; ?>
<div class="container"><?php echo $content_top; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<div class="content"><?php echo $text_error; ?></div>
<!--<div class="buttons">
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
</div>--!>
<?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>
If you are referring to the Welcome module, then you specify which pages to include it on.
in your admin, go in to Extensions -> Modules -> Welcome and make sure you only have it set to appear on your home page.
in your admin, go in to Extensions -> Modules -> Welcome and make sure you only have it set to appear on your home page.
Similar question to the original posting...
I probably do have some extra javascripts, either called from the files and not used anywhere, or .js files that exist but not even called from anywhere.
what would be the best way to check for those files in order to just delete them and speed up a bit the loading time?
thank you...
I am talking about customized oc installation.
I probably do have some extra javascripts, either called from the files and not used anywhere, or .js files that exist but not even called from anywhere.
what would be the best way to check for those files in order to just delete them and speed up a bit the loading time?
thank you...
I am talking about customized oc installation.
Hi what javascript can be removed that without breaking open cart i.e. what i don't want to use
eg jquery.jcarousel.min.js ,jquery.nivo.slider.pack.js jquery.colorbox.js
what files and code needs to be deleted?
eg jquery.jcarousel.min.js ,jquery.nivo.slider.pack.js jquery.colorbox.js
what files and code needs to be deleted?
open cart 2.3.0.2 & 3.0.2.0
Depends on what modules you do not need anymore.appsfinder wrote:Hi what javascript can be removed that without breaking open cart i.e. what i don't want to use
eg jquery.jcarousel.min.js ,jquery.nivo.slider.pack.js jquery.colorbox.js
what files and code needs to be deleted?
carousel & nivo = product presentation & manufactors
colorbox = popup windows (e.g. TOS at checkout)
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Who is online
Users browsing this forum: No registered users and 37 guests