
Error en código
Publicado por Alejandro (6 intervenciones) el 14/07/2015 17:34:34
Buenas tardes,
Estoy en un apuro bastante importante. He adquirido un modulo para un ecomerce que a mi empresa le ha costado un ojo de la cara y oparte del otro y hay un apartado que no funciona.
El caso es que auqnue no tengo nada de idea de programación, revisando todos los ficheros de este modulo, he encontrado un error de sintaxisen javascript en un php que coincide justo con la parte que no opera.
Tal vez sea extremadamente sencillo, pero es que no tengo ni idea, y aunque he buscado algun tutorial, no encuentro la forma de validarlo. Os dejo aquí el fragmento, mil gracias por vuestras aportaciones =):
Estoy en un apuro bastante importante. He adquirido un modulo para un ecomerce que a mi empresa le ha costado un ojo de la cara y oparte del otro y hay un apartado que no funciona.
El caso es que auqnue no tengo nada de idea de programación, revisando todos los ficheros de este modulo, he encontrado un error de sintaxisen javascript en un php que coincide justo con la parte que no opera.
Tal vez sea extremadamente sencillo, pero es que no tengo ni idea, y aunque he buscado algun tutorial, no encuentro la forma de validarlo. Os dejo aquí el fragmento, mil gracias por vuestras aportaciones =):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<script type="text/javascript">
$(document).ready(function(){
tinySetup({
editor_selector :"autoload_rte",
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,pagebreak",
});
});
var noTax = '{$noTax}';
var taxesArray = '{$taxesArray}';
function addressInvoiceChange(id_customer, id_address)
{
if(id_customer == 0)
var hrefCust = "#";
else
var hrefCust = "?tab=AdminCustomers&id_customer="+id_customer+"&viewcustomer&token={getAdminToken tab='AdminCustomers'}";
$.ajax({
url: "../modules/devisperso/ajaxdevis.php",
cache: false,
data: "ajaxAddress=1&id_customer="+id_customer+"&id_address="+id_address,
success: function(html){
$("#id_address_invoice").html(html);
$("a[rel=fiche]").attr({
title: document.getElementById("id_customer").options[document.getElementById("id_customer").selectedIndex].innerHTML,
href: hrefCust
});
visuAddress(id_address, '_invoice');
},
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Adresse ajax error: '+textStatus);
}
});
$("select.adInvoice").fadeOut("slow");
$("select.adInvoice").fadeIn("slow");
}
function addressDeliveryChange(id_customer, id_address)
{
$.ajax({
url: "../modules/devisperso/ajaxdevis.php",
cache: false,
data: "ajaxAddress=1&id_customer="+id_customer+"&id_address="+id_address,
success: function(html){
$("#id_address_delivery").html(html);
visuAddress(id_address, '_delivery');
},
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Adresse ajax error: '+textStatus);
}
});
$("select.adDelivery").fadeOut("slow");
$("select.adDelivery").fadeIn("slow");
}
function visuAddress(id_address, chp_address)
{
var adSelect = document.getElementById("id_address"+chp_address).options[document.getElementById("id_address"+chp_address).selectedIndex].innerHTML;
if(id_address == 0)
var hrefAd = "#";
else
var hrefAd = "?tab=AdminAddresses&id_address="+id_address+"&updateaddress&token={getAdminToken tab='AdminAddresses'}";
document.getElementById(chp_address).href = hrefAd;
document.getElementById(chp_address).title = adSelect;
}
function taxFill(id_address_delivery, id_lang, id_tax_devis)
{
$.ajax({
url: "../modules/devisperso/ajaxdevis.php",
cache: false,
data: "ajaxTax=1&id_address_delivery="+id_address_delivery+"&id_lang="+id_lang+"&id_tax_devis="+id_tax_devis,
success: function(html){
$("#id_tax").html(html);
calculTotal();
},
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Tax ajax error: '+textStatus);
}
});
$("select.tax").fadeOut("slow");
$("select.tax").fadeIn("slow");
}
function shippingChange(id_carrier, id_devis, total, poids)
{
var freeshipp = document.getElementById("free_shipp");
if (freeshipp.checked == false)
{
$.ajax({
url: "../modules/devisperso/ajaxdevis.php",
cache: false,
data: "ajaxShipping=1&id_carrier="+id_carrier+"&id_devis="+id_devis+"&total="+total+"&poids="+poids,
success: function(html){
$("div.shipp").html(html);
calculTotal();
},
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Shipping ajax error: '+textStatus);
}
});
$("div.shipp").fadeOut("fast");
$("div.shipp").fadeIn("fast");
}
}
function getTax()
{
if ({$noTax}) (<------en esta linea me da el error, el resto esta OK)
return 0;
var taxesArray = [
{foreach from=$taxesArray item=tax}
"{$tax}",
{/foreach}
];
var selectedTax = document.getElementById("id_tax");
var taxId = selectedTax.options[selectedTax.selectedIndex].value;
return taxesArray[taxId];
}
function calculTotal ()
{
var tax = getTax();
var tot_out_ht = parseFloat(document.getElementById("total_out_shipp").value);
var tot_ttc = tot_out_ht * ((tax/100) + 1);
var shipp = parseFloat(document.getElementById("total_shipping").value);
var total = tot_ttc + shipp >= 0 ? Math.round(total = (tot_ttc + shipp)*100)/100 : 0.00;
document.getElementById("tot_ttc").innerHTML = Math.round(tot_ttc*100)/100;
document.getElementById("total_devis").value = total;
}
function shippingNull ()
{
document.getElementById("total_shipping").value = 0;
calculTotal();
}
</script>
Valora esta pregunta


0