Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e-commerce cart to checkout via email instead of paypal #529

Open
DiabloSV opened this issue Oct 23, 2017 · 0 comments
Open

e-commerce cart to checkout via email instead of paypal #529

DiabloSV opened this issue Oct 23, 2017 · 0 comments

Comments

@DiabloSV
Copy link

Good day,

I am currently working on a site for a client that wants to have products that is purchased from a website to be sent to his email address and then have his eft details sent with a invoice number back to the client's email.

The cart page is working perfectly, I am just struggling to get the content onto the checkout.php/send-email.php page and have all information sent to the owner of the site's email address. I have tried setting up the mailing code but no email gets sent and when it get's sent it doesn't display any information.

Code is as follows:
/////////////////////////////
add-to-cart.php
/////////////////////////////

array("item_id" => $pid, "quantity" => 1)); } else { // RUN IF THE CART HAS AT LEAST ONE ITEM IN IT foreach ($_SESSION["cart_array"] as $each_item) { $i++; while (list($key, $value) = each($each_item)) { if ($key == "item_id" && $value == $pid) { // That item is in cart already so let's adjust its quantity using array_splice() array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $pid, "quantity" => $each_item['quantity'] + 1))); $wasFound = true; } // close if condition } // close while loop } // close foreach loop if ($wasFound == false) { array_push($_SESSION["cart_array"], array("item_id" => $pid, "quantity" => 1)); } } header("location: cart.php"); exit(); } ?> = 100) { $quantity = 99; } if ($quantity < 1) { $quantity = 1; } if ($quantity == "") { $quantity = 1; } $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $i++; while (list($key, $value) = each($each_item)) { if ($key == "item_id" && $value == $item_to_adjust) { // That item is in cart already so let's adjust its quantity using array_splice() array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $item_to_adjust, "quantity" => $quantity))); } // close if condition } // close while loop } // close foreach loop } ?> Your shopping cart is empty"; ?> '; // Start the For Each loop $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $item_id = $each_item['item_id']; $sql = mysqli_query($con,"SELECT * FROM products WHERE id='$item_id' LIMIT 1"); while ($row = mysqli_fetch_array($sql)) { $product_name = $row["name"]; $price = $row["price"]; $details = $row["description"]; $img = $row['img1']; $amount = $row['amount']; $rgb = $row['rgb']; $ing = $row['ingredients']; } $pricetotal = $price * $each_item['quantity']; $cartTotal = $pricetotal + $cartTotal; setlocale(LC_MONETARY, "en_US"); // Dynamic Checkout Btn Assembly $x = $i + 1; $pp_checkout_btn .= ' '; // Create the product array variable $product_id_array .= "$item_id-".$each_item['quantity'].","; // Dynamic table row assembly $cartOutput .= ""; $cartOutput .= '' . $product_name . '
' . $product_name. '
'; $cartOutput .= '' . $details . ''; $cartOutput .= 'R' . $price . '.00'; $cartOutput .= ' Change '; //$cartOutput .= '' . $each_item['quantity'] . ''; $cartOutput .= '' . $pricetotal . ''; $cartOutput .= 'X'; $cartOutput .= ''; $i++; } setlocale(LC_MONETARY, "en_US"); $cartTotal = "
Cart Total : ".$cartTotal.".00 Rand
"; // Finish the Paypal Checkout Btn $pp_checkout_btn .= ' Checkout '; } ?>

/////////////////////////////
cart.php
/////////////////////////////

<title>Your Cart</title>
Toggle navigation
<div class="container">
    <div class="row">
        <div class="col-lg-10 col-lg-offset-1 col-md-12">
            <div class="datagrid">
                <table class="table">
                    <thead>
                        <tr>
                            <th>Product</th>
                            <th>Product Description</th>
                            <th>Unit Price</th>
                            <th>Quantity</th>
                            <th>Total</th>
                            <th>Remove</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php echo $cartOutput; ?>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="12">
                                <div class="paging" style="background-color:rgba(4,4,4,0);">
                                    <ul>
                                        <li>
                                            <?php echo $pp_checkout_btn; ?>
                                        </li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
                <?php echo $cartTotal; ?>
            </div>
        </div>
    </div>
</div>
<div class="footer-dark" style="background-color:rgba(1,1,1,0.75);">
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-md-push-6 col-sm-8 item text">
                    <h1>Vape-Elicious </h1>
                    <h3>Give us a call!</h3>
                    <p>Hein Meyer - 0713523474 </p>
                    <p>Email:hein@vape-elicious.co.za </p>
                    <p>Mon - Fri, 8:00-22:00 </p>
                    <p style="color:rgb(250,251,252);"> </p>
                    <h3 style="color:rgb(252,127,1);">Products not for sale to anyone under 18</h3></div>
                <div class="col-md-3 col-md-pull-6 col-sm-4 hidden item">
                    <h3>Services</h3>
                    <ul>
                        <li><a href="#">Web design</a></li>
                        <li><a href="#">Development</a></li>
                        <li><a href="#">Hosting</a></li>
                    </ul>
                </div>
                <div class="col-lg-6 col-md-6 col-md-pull-6 col-sm-4 item"><img src="assets/img/header.png" style="width:250px;">
                    <h3 class="hidden"> The story behind Vape-Elisious </h3>
                    <p>The Bearded Traveler adventured great distances, far across the land, from country to country, from continent to continent, to experience each and every culture on Earth, in search of inspiration for the perfect flavor that would
                        reunite all of the different cultures that have finally come together in an astonishing series of products known as vape-elicious. </p>
                    <ul></ul>
                </div>
                <div class="col-md-12 col-sm-12 item social"><a href="https://www.facebook.com/vapeelicious/"><i class="icon ion-social-facebook"></i></a><a class="hidden" href="#"><i class="icon ion-social-twitter"></i></a><a class="hidden" href="#"><i class="icon ion-social-snapchat"></i></a>
                    <a
                    class="hidden" href="#"><i class="icon ion-social-instagram"></i></a>
                </div>
            </div>
            <p class="copyright">Vape-Elicious © 2017</p>
            <p class="copyright">Developed by Sector36Technologies © 2017</p>
        </div>
    </footer>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/Full-Page-Background1.js"></script>
<script src="assets/js/Full-Page-Background2.js"></script>
<script src="assets/js/Full-Page-Background3.js"></script>
<script src="assets/js/Full-Page-Background.js"></script>
<script src="assets/js/bs-animation.js"></script>

//////////////
send-email.php
/////////////

////////////////
checkout.php
////////////////

<title>Vape elicious</title>
Toggle navigation

Checkout

Please fill out the following information in order to complete your order.

First Name*
Last Name*
E-Mail*
Phone*
Message
Send

*Required fields

    </div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/Full-Page-Background1.js"></script>
<script src="assets/js/Full-Page-Background2.js"></script>
<script src="assets/js/Full-Page-Background3.js"></script>
<script src="assets/js/Full-Page-Background.js"></script>
<script src="assets/js/bs-animation.js"></script>
<script src="assets/js/Contact-FormModal-Contact-Form-with-Google-Map.js"></script>
<script src="assets/js/PHP-Contact-Form-dark.js"></script>
<script src="assets/js/PHP-Contact-Form-dark1.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant