static function photo_top($theme) { if (!basket_plus::getBasketVar(USE_SIDE_BAR_ONLY)) { if (bp_product::isForSale($theme->item()->id)) { $view = new View("add_to_basket.html"); $view->item = $theme->item(); return $view->render(); } } return ""; }
document.checkout.submit(); } } } } </SCRIPT> <div class="g-block"> <h2><?php echo t("Delivery and Contact (Step 1 of 3)"); ?> </h2> <div id="b-complete"> <?php $payment_details = basket_plus::getBasketVar(PAYMENT_OPTIONS); $webshop = basket_plus::getBasketVar(WEBSHOP); $payment_details = basket_plus::replaceStrings($payment_details, array("webshop" => $webshop)); /* here the payment options text is loaded */ if ($payment_details) { ?> <div class="basket-right" id="payment"> <h3> <?php echo t("Payment Options"); ?> </h3> <?php echo $payment_details; ?> </div> <?php }
static function send_order_copy($order) { $to = $order->email; $from = basket_plus::getBasketVar(EMAIL_FROM); //add text 'COPY' to the subject $subject = basket_plus::replaceStringsAll(basket_plus::getBasketVar(ORDER_COMPLETE_EMAIL_SUBJECT), $order) . " (" . t("COPY") . ")"; $final_msg = basket_plus::preparehtmlmail($order->text, $from); // give a function your html mail($to, $subject, $final_msg['multipart'], $final_msg['headers']); }
public function show_order($id) { access::verify_csrf(); self::check_view_orders(); $prefix = basket_plus::getBasketVar(ORDER_PREFIX); $length = strlen($prefix); if (strlen($id) > $length) { if ($prefix === strtolower(substr($id, 0, $length))) { $id = substr($id, $length); } } $order = ORM::factory("bp_order", $id); if ($order->loaded()) { $view = new View("view_order.html"); $view->order = $order; print $view; } else { print "Order " . $id . " not found."; } }
function validate_ipn($key) { // parse the paypal URL $url_parsed = parse_url($this->paypal_url); // generate the post string from the _POST vars as well as load the // _POST vars into an array so we can play with them from the calling // script. $post_string = 'cmd=_notify-validate'; foreach ($_POST as $field => $value) { $this->ipn_data["{$field}"] = $value; $value = urlencode(stripslashes($value)); $value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i', '${1}%0D%0A${3}', $value); $post_string .= '&' . $field . '=' . $value; } // open the connection to paypal $fp = fsockopen($this->secure_url, 443, $err_num, $err_str, 30); if (!$fp) { // could not open the connection. If logging is on, the error message // will be in the log. $this->last_error = "fsockopen error no. {$errnum}: {$errstr}"; $this->log_ipn_results($key, false); return false; } else { // Post the data back to paypal fputs($fp, "POST " . $url_parsed['path'] . " HTTP/1.1\r\n"); fputs($fp, "Host: " . $url_parsed['host'] . "\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: " . strlen($post_string) . "\r\n\r\n"); //fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $post_string . "\r\n\r\n"); // loop through the response from the server and append to variable while (!feof($fp)) { $this->ipn_response .= fgets($fp, 1024); } fclose($fp); // close connection } if (stristr($this->ipn_response, "VERIFIED") === false) { // Invalid IPN transaction. Check the log for details. $this->last_error = 'IPN Validation Failed. ' . $url_parsed['host'] . '\\' . $url_parsed['path']; $this->log_ipn_results($key, false); return false; } else { // Valid IPN transaction. // check recievers e-mail $business = basket_plus::getBasketVar(PAYPAL_ACCOUNT); if ($this->ipn_data['receiver_email'] != $business) { $this->last_error = 'receivers e-mail did not match ' . $business; $this->log_ipn_results($key, false); return false; } // if confirmed check message has not been received already if ($this->ipn_data['payment_status'] == "Completed") { $message = ORM::factory("bp_ipn_message")->where('key', "=", $key)->where('status', "=", 'completed')->where('txn_id', "=", $this->ipn_data['txn_id'])->find(); if ($message->loaded()) { $this->last_error = 'Message already received.'; $this->log_ipn_results($key, false); return false; } } $this->log_ipn_results($key, true); return true; } }
public function clear() { if (isset($this->contents)) { foreach ($this->contents as $key => $item) { unset($this->contents[$key]); } } // get default pickup setting $this->pickup = basket_plus::getBasketVar(IS_PICKUP_DEFAULT); }
<?php $total = 0; foreach ($orders as $i => $order) { ?> <tr class="order-status-<?php echo $order->status; ?> "> <td class="order-status-<?php echo $order->status; ?> "><a href="javascript:loadOrder(<?php echo $order->id; ?> )"><?php echo basket_plus::getBasketVar(ORDER_PREFIX) . $order->id; ?> </a></td> <td><?php echo $order->name; ?> </td> <?php $id = $order->id; ?> <td class="order-status-<?php echo $order->status; ?> "><a href="javascript:loadOrderLog(<?php echo $order->id; ?>
</b></td> <td></td> <td style="text-align:right;" id="total"><b><?php echo $basket->pickup ? basket_plus::formatMoneyForWeb($total) : basket_plus::formatMoneyForWeb($total + $postage); ?> </b></td> <td></td> </tr> <?php /* line with pickup choice: show only when postage > 0; when pickup is changed, trigger script (see top) */ ?> <?php if ($postage > 0) { ?> <?php if (basket_plus::getBasketVar(ALLOW_PICKUP)) { ?> <tr class="bp-table-noborder"> <td colspan="5"><input id="pickup" type="checkbox" <?php echo $basket->pickup ? "checked" : ""; ?> /><?php echo t(" Select if you wish to pick up the photos."); ?> </td> </tr> <?php } ?> <?php }
public function title() { return basket_plus::getBasketVar(ORDER_PREFIX) . $this->id . " " . $this->name . " " . t($this->status()); }