function startCart()
{
    if (!isset($_SESSION['cart'])) {
        emptyCart();
    }
}
            $txtEmailDownload = $user_email_row['email'];
            $subjectDownload = "Digital Product Order placed at " . SITE_NAME;
            $headers = "MIME-Version: 1.0" . "\r\n";
            $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
            $headers .= "From: " . SITE_EMAIL . "<" . SITE_EMAIL . ">" . "\r\n";
            /*-------Email Template reading function call------------*/
            $mailcontent_digital_product = readEmailTemplate('digital_product');
            $product_download_details .= "\n\n*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*\r\n";
            $product_download_details .= "<font color='#FF0000'>Note: If you do not have pop-ups enabled on your browser, the product download many not work properly.So please enable pop-ups before downloading !!</font>";
            $mailcontent_digital_product = str_replace('[product_details]', $product_download_details, $mailcontent_digital_product);
            $mailcontent_digital_product = nl2br($mailcontent_digital_product);
            $mail_send_details = "<html><head><link href='" . SITE_URL . "/style/template1-admin.css' rel='stylesheet' type='text/css'></head><body><center><div align='left' id='layout'><div align='left' class='header'><div align='left' class='logo'><img src=" . $logofolder . "/" . $logoimage . " width='125' height='39'/></div></div><div>" . $mailcontent_digital_product . "</div></div><div align='left' class='clear_float'><img src=" . $imagefolder . "/clear.gif width=1 height=1/></div></div></div></center></body></html>";
            //$mailsent = mail($txtEmailDownload,$subjectDownload,$mail_send_details,$headers);
        }
        /*-----------------Digital Product Mail Sending Ends----------------*/
        // Send Giftcertificate Mails
        if ($gift_coupon_flag == 1) {
            sendgiftCertificateMail_Buyer($orderid, $CustomArray[0]);
        } else {
            sendBuyerEmail($orderid, $CustomArray[0]);
            sendSellerEmail($orderid, $CustomArray[0]);
            sendAdminEmail($orderid, $CustomArray[0]);
        }
        //Send Mail To Buyer
    }
    // end if paypal check
}
//end ipn check if
emptyCart($CustomArray[0]);
$_SESSION["sess_addresses_collected"] = false;
$_SESSION["sess_stock_adjusted"] = false;
     sendgiftCertificateMail_Seller($orderid, $_SESSION["sess_userid"]);
     sendgiftCertificateMail_Admin($orderid, $_SESSION["sess_userid"]);
 }
 //Send Digital Certificate Mails
 if ($product_download_flag == 1) {
     sendDigitalCertificateMail_Buyer($orderid, $_SESSION["sess_userid"], $usertype);
     sendDigitalCertificateMail_Seller($orderid, $_SESSION["sess_userid"]);
     sendDigitalCertificateMail_Admin($orderid, $_SESSION["sess_userid"]);
 }
 if ($product_download_flag != 1 && $gift_coupon_flag != 1) {
     sendBuyerEmail($orderid, $_SESSION["sess_userid"], $usertype);
     sendSellerEmail($orderid, $_SESSION["sess_userid"]);
     sendAdminEmail($orderid, $_SESSION["sess_userid"]);
 }
 adjustStock($_SESSION["sess_userid"], "-");
 emptyCart($_SESSION["sess_userid"]);
 $_SESSION["sess_addresses_collected"] = false;
 $_SESSION["sess_stock_adjusted"] = false;
 $_SESSION["sess_addresses_collected"] = false;
 $_SESSION["sess_stock_adjusted"] = false;
 $_SESSION['couponCode_det'] = '';
 if (isset($_SESSION['guest_login']) && $_SESSION['guest_login'] != '') {
     session_unregister($_SESSION['guest_login']);
     session_unregister($_SESSION['sess_userid']);
     $_SESSION['guest_login'] = '';
     $_SESSION["sess_userid"] = '';
 }
 $_SESSION["sess_guest_username"] = '';
 $_SESSION["sess_guest_password"] = '';
 $_SESSION["sessShippingDisplayName"] = '';
 $_SESSION['sess_giftcertificate_code'] = '';
Exemplo n.º 4
0
        <title></title>
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    </head>
    <body>
    <center>
        <?php 
require_once '../includes/session-start.req-inc.php';
require_once '../functions/cart-functions.php';
require_once '../functions/dbconnect.php';
require_once '../functions/util.php';
require_once '../functions/category-functions.php';
require_once '../functions/products-functions.php';
$action = filter_input(INPUT_POST, 'action');
if ($action == 'Empty cart') {
    emptyCart();
}
startCart();
$total = 0;
$checkoutProducts = array();
$items = getCart();
foreach ($items as $id) {
    $checkoutProducts[] = getProduct($id);
}
include '../includes/checkout.html.php';
?>
        
         <form action="#" method="post">
        <a href="index.php">Go Back</a>
        <input type="submit" name="action" value="Empty cart">
        </form>
                } else {
                    if ($digital_flag == 1) {
                        sendDigitalCertificateMail_Buyer($orderid, $userid, $usertype);
                        sendDigitalCertificateMail_Seller($orderid, $userid);
                        sendDigitalCertificateMail_Admin($orderid, $userid);
                    } else {
                        sendBuyerEmail($orderid, $userid, $usertype);
                        sendSellerEmail($orderid, $userid);
                        sendAdminEmail($orderid, $userid);
                    }
                }
                $sql_update_order_payment = "UPDATE " . $tableprefix . "orders SET payment_completed_status='Y' where order_id=" . $orderid . " ";
                $res_update = mysql_query($sql_update_order_payment) or die(mysql_error());
            }
            adjustStock($userid, "-");
            emptyCart($userid);
        }
    }
} else {
    //exit('DoDirectPayment failed: <br>' . print_r($httpParsedResponseAr, true));
    $errorArry = $httpParsedResponseAr;
    $errorMsg = "DoDirectPayment failed: <br>" . urldecode($httpParsedResponseAr['L_LONGMESSAGE0']);
}
$active_template = displayTemplate();
//print_r($active_template);
include "includes/htmltop.php";
/* Top File Name */
include_once "includes/" . $active_template[0];
?>
<!--<div class="pcm_content_rightcolumn">
<div align="left" class="main_body">
Exemplo n.º 6
0
require_once '../functions/until.php';
require_once '../functions/category-functions.php';
require_once '../functions/products-functions.php';
startCart();
$allCategories = getAllCategories();
$allProducts = getAllProducts();
$categorySelected = filter_input(INPUT_GET, 'cat');
if ($categorySelected != "") {
    $allProducts = getProductByCat($categorySelected);
}
$action = filter_input(INPUT_POST, 'action');
if ($action === 'buy') {
    $productID = filter_input(INPUT_POST, 'product_id');
    addToCart($productID);
}
if ($action === 'Empty cart') {
    //Empty the $_SESSION['cart'] array
    unset($_SESSION['cart']);
    emptyCart('Location: ?cart');
    exit;
}
include_once '../includes/categories.html.php';
include_once '../includes/products.html.php';
?>
        
        <p><a class="btn btn-primary btn-lg btn-block" href="./checkout.php">Check Out</a></p>
        <p><a class="btn btn-primary btn-lg btn-block" href="../index.php">Start Over</a></p>
        
    </body>
</html>
Exemplo n.º 7
0
 function addFreeProduct($items, $customer_info, $sid)
 {
     global $database, $configs, $my;
     $tax = calc_price($items, $customer_info, $sid);
     $now = time();
     $non_taxed = $tax['total'];
     //$total;
     $total = $tax['taxed'];
     $currency = $tax['currency'];
     $licenses = $tax['licenses'];
     $taxa = $tax['value'];
     $shipping = $tax['shipping'];
     $orderid = $this->addOrder($items, $customer_info, $now, 'free', $sid);
     $this->addLicenses($items, $orderid, $now);
     $this->dispatchMail($orderid, $total, $licenses, $now, $items, $sid);
     emptyCart($sid);
     $_SESSION['in_trans'] = 1;
     $this->storeTransactionData($items, $orderid, $tax, $sid);
     $this->goToSuccessURL($sid);
     return;
 }
Exemplo n.º 8
0
function addItemToCart()
{
    global $messages;
    if (!isset($_SESSION['cart'])) {
        emptyCart();
    }
    $ratePlanId = $_REQUEST['ratePlanId'];
    if (isset($_REQUEST['chargeAndQty'])) {
        $chargeAndQty = $_REQUEST['chargeAndQty'];
    } else {
        $chargeAndQty = null;
    }
    if (isset($_SESSION['cart'])) {
        $_SESSION['cart']->addCartItem($ratePlanId, $chargeAndQty);
    } else {
        addErrors(null, 'Cart has not been set up.');
        return;
    }
    $messages = $_SESSION['cart'];
}
Exemplo n.º 9
0
<?php

include 'modules.php';
if (!isset($_COOKIE['uid'])) {
    header('Location: index');
}
$uid = $_COOKIE['uid'];
if (isset($_POST['orderButton'])) {
    orderPlaced($uid);
    emptyCart($uid);
    header('Location: home');
}
?>


<!DOCTYPE html>
<html>
<head>
  <meta charset="ISO-8859-1">
  <title>Payment Page</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet"
  href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <script
  src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script
  src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <script>
  $(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip();
  });