Exemplo n.º 1
0
 function cart()
 {
     use_ssl(TRUE);
     $data['cart'] = $this->Order_model->get_cart($this->session->userdata('cart_id'));
     if ($_POST && $_POST['coupon_submit'] == 'Apply') {
         $this->form_validation->set_rules("coupon", 'Coupon code', 'alpha_numeric');
         $this->form_validation->set_error_delimiters('<span class="error error_span">', '</span>');
         if ($this->form_validation->run() == TRUE) {
             $tcart = get_tiny_cart();
             if ($coupon = get_coupon_discount($_POST['coupon'], $tcart->total)) {
                 $this->session->set_userdata('coupon', $_POST['coupon']);
                 $coupon->discount = $coupon->discount_amount ? $coupon->discount_amount : $coupon->discount_percentage * $tcart->total / 100;
                 $data['coupon'] = $coupon;
             } else {
                 $this->session->unset_userdata('coupon');
             }
         }
     } elseif ($this->session->userdata('coupon') && count($data['cart']) > 0) {
         $tcart = get_tiny_cart();
         $coupon = get_coupon_discount($this->session->userdata('coupon'), $tcart->total);
         $data['coupon'] = $coupon;
         $coupon->discount = $coupon->discount_amount ? $coupon->discount_amount : $coupon->discount_percentage * $tcart->total / 100;
         $data['coupon'] = $coupon;
     }
     $this->load->Model('Occasion_model');
     $data['current_page'] = 'shoppingcart';
     $data['occasions'] = $this->Occasion_model->get_occasions_array();
     $data['page'] = $this->Pages_model->return_page('shoppingcart');
     $data['paths'] = array('Home' => path(), 'Shopping Cart' => '');
     $this->load->view('shopping_cart.php', $data);
 }
Exemplo n.º 2
0
 function cart()
 {
     use_ssl(false);
     $previ = $_SERVER['HTTP_REFERER'];
     //echo $previ;
     $data['cart'] = $this->Order_model->get_cart($this->session->userdata('cart_id'));
     if ($_POST && $_POST['coupon_submit'] == 'Apply') {
         $this->form_validation->set_rules("coupon", 'Coupon code', 'alpha_dash|max_length[25]');
         $this->form_validation->set_error_delimiters('<span class="error error_span">', '</span>');
         if ($this->form_validation->run() == TRUE) {
             $tcart = get_tiny_cart();
             if ($coupon = get_coupon_discount($_POST['coupon'], $tcart->total)) {
                 $this->session->set_userdata('coupon', $this->input->post('coupon'));
                 $coupon->discount = $coupon->discount_amount ? $coupon->discount_amount : $coupon->discount_percentage * $tcart->total / 100;
                 $data['coupon'] = $coupon;
             } else {
                 $this->session->unset_userdata('coupon');
             }
         }
     } elseif ($this->session->userdata('coupon') && count($data['cart']) > 0) {
         $tcart = get_tiny_cart();
         $coupon = get_coupon_discount($this->session->userdata('coupon'), $tcart->total);
         $data['coupon'] = $coupon;
         $coupon->discount = $coupon->discount_amount ? $coupon->discount_amount : $coupon->discount_percentage * $tcart->total / 100;
         $data['coupon'] = $coupon;
     }
     $this->load->Model('Occasion_model');
     $data['current_page'] = 'shoppingcart';
     $data['occasions'] = $this->Occasion_model->get_occasions_array();
     $data['page'] = $this->Pages_model->return_page('shoppingcart');
     $data['paths'] = array('Home' => path(), 'Shopping Cart' => '');
     $carrito = $this->Order_model->get_cart($this->session->userdata('cart_id'));
     if ($previ == 'http://test.memorialflowers.ca/shop/cart') {
         if ($carrito) {
             $this->load->view('shopping_cart.php', $data);
         } else {
             redirect('/');
         }
     } else {
         $this->load->view('shopping_cart.php', $data);
     }
 }
Exemplo n.º 3
0
<?php

$tcart = get_tiny_cart();
$ci =& get_instance();
?>
<!doctype html>
<html lang="en">
<head>
<meta name="robots" content="noodp,noydir"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php 
if (isset($page) && !empty($page->page_title)) {
    echo $page->page_title;
} elseif (isset($title)) {
    echo $title;
} else {
    echo 'MemorialFlowers.ca - Online flowers Canada';
}
?>
</title>
<meta name="description" content="<?php 
if (isset($description)) {
    echo $description;
} elseif (isset($page) && !empty($page->description)) {
    echo $page->description;
} else {
    echo 'Order flowers, roses, and gift baskets online & send same day flower delivery for birthdays and anniversaries from trusted florist 1-800-Flowers.ca.';
}
?>
" />
<meta name="keywords" content="<?php