This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkialasmall-1-4.js
79 lines (73 loc) · 1.59 KB
/
kialasmall-1-4.js
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
function ksDisplayKialaPoint(content)
{
$('#kiala').remove();
$('#id_carrier' + KS_KIALA_ID_CARRIER).parents('tr').after(content);
}
function ksGetKialaPoint()
{
$.ajax(
{
type: 'POST',
url: KS_KIALA_MODULE_DIR + 'ajax.php',
data: {'token' : KS_KIALA_TOKEN,
'page_name' : KS_PAGE_NAME},
success: function(html)
{
ksDisplayKialaPoint(html);
},
error: function(xhr, ajaxOptions, thrownError)
{
//console.log(thrownError);
// Put debug to see error detail
}
});
}
function ksUpdateCarrierInCart(id_carrier)
{
$.ajax(
{
type: 'POST',
url: KS_KIALA_MODULE_DIR + 'ajax.php',
data: {'token' : KS_KIALA_TOKEN,
'id_carrier' : id_carrier},
error: function(xhr, ajaxOptions, thrownError)
{
//console.log(thrownError);
// Put debug to see error detail
}
});
}
$(document).ready(function()
{
$('#search_link').live('click', function(event)
{
$.fancybox(this.href
,
{
//'autoDimensions' : true,
'width' : 800,
'height' : 600,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe',
'onComplete' : function()
{
// Rewrite some css properties of Fancybox
$('#fancybox-wrap').css('width', '');
$('#fancybox-content').css('background-color', '');
$('#fancybox-content').css('border', '');
}
})
;
event.preventDefault();
});
$('input[name=id_carrier]').change(function(event)
{
if ($(this).val() == KS_KIALA_ID_CARRIER)
ksGetKialaPoint();
else
ksDisplayKialaPoint('');
if (!KS_IS_OPC)
ksUpdateCarrierInCart($(this).val());
});
});