-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcart-zipcode.php
executable file
·69 lines (51 loc) · 2.65 KB
/
cart-zipcode.php
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
<table width="300" border="0" cellpadding="3" cellspacing="0" style="background-color:#FFF;">
<tr>
<td colspan="4" style="background-color:#cccccc; height:3px; overflow:hidden;"></td>
</tr>
<tr style="background-color:#F0F0E7;">
<td colspan="4" style="padding-left:10px; padding-right:10px;">
<?php
# Turn off all error reporting
error_reporting(0);
if (!isset($_SESSION)) session_start();
if (isset($_SESSION['zipcode']))
{
// Check ZIPCODE against the data base
$zipcode = $_SESSION['zipcode'];
require "includes/config/config.php";
require "includes/Sql/sql.class.php";
/* trabalhar com a faixa de cep para itajai e balneario direto no codigo
http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuFaixaCep
Itajaí 88300-001 a 88319-999
Balneário Camboriú 88330-001 a 88339-999
*/
// Olhar o metodo getDeliveryArea( $zipcode ) a faixa de CEP permitido esta sendo controlada nele..
$arr_area = GenericSql::getDeliveryArea($database, $zipcode);
if ( $arr_area == 0 ) {
// Allow Checkout is used in jcart checkout cart
$_SESSION['allow_checkout'] = null;
//unset($_SESSION['allow_checkout']);
$_SESSION['allow_checkout'] = 0; ?>
<small>* Validate your Zipcode ->
<a href="javascript:void(0);" onclick="tb_show('ZIPCODE Here', 'change-zipcode.php?item_id=&item_pos=&KeepThis=true&TB_iframe=true&height=100&width=250', false);"> HERE </a>
<?php die( "<br />Unfortunately we not deliver to your area.<br />But you can still browse our menu. " );
} else {
$_SESSION['allow_checkout'] = null;
//unset($_SESSION['allow_checkout']);
$_SESSION['allow_checkout'] = 1;
} ?>
<small>* Your Zipcode ->
<a href="javascript:void(0);" onclick="tb_show('Informar CEP', 'change-zipcode.php?item_id=&item_pos=&KeepThis=true&TB_iframe=true&height=100&width=250', false);"> <?=$_SESSION['zipcode'];?> </a>
<a onClick="window.location.reload()"><img src="images/icons/loop-alt.png" height=8 border=0 title="Refresh" alt="Refresh" /></a>
<?php } // Essa condicao e usada exclusivamente para compras de personal chef services (PCS)
elseif ( !empty( $_SESSION['PCS']['order_id'] )) {
$_SESSION['allow_checkout'] = null;
$_SESSION['allow_checkout'] = 1;
} else { ?>
<small>* Enter with your zipcode ->
<a href="javascript:void(0);" onclick="tb_show('ZIPCODE', 'change-zipcode.php?item_id=&item_pos=&KeepThis=true&TB_iframe=true&height=100&width=250', false);"> HERE </a>
<?php } ?>
</small>
</td>
</tr>
</table>