fields(‘o’) ->condition(‘id’, $act_id) ->execute() ->fetchAssoc(); $ship_address = “”; $mail_sent = $order_detail[‘mail_sent’]; $order_detail = json_decode($order_detail[‘order_detail’], TRUE); $shippingOpt = $_GET[“shippingOpt”]; $shipping = $_GET[“shipping”]; $ship_fee = 0.00; $ship_title = ”; /*if ($shipping == “11”) { $ship_fee = “28.79”; $ship_title = “UPS Standard”; }elseif ($shipping == “13”) { $ship_fee = “30.40”; $ship_title = “UPS Saver”; }elseif ($shipping == “14”) { $ship_fee = “83.00”; $ship_title = “UPS Express Early A.M.”; }elseif ($shipping == “2”) { $ship_fee = “29.41”; $ship_title = “UPS Expedited”; }elseif ($shipping == “1”) { $ship_fee = “42.82”; $ship_title = “UPS Express”; }elseif ($shipping == “12”) { $ship_fee = “169.75”; $ship_title = “UPS 3 Day Select”; } elseif ($shipping == “54”) { $ship_fee = “380.02”; $ship_title = “UPS Worldwide Express Plus “; } elseif ($shipping == “65”) { $ship_fee = “284.74”; $ship_title = “UPS Saver”; } elseif ($shipping == “07”) { $ship_fee = “299.53”; $ship_title = “UPS Worldwide Express”; } elseif ($shipping == “08”) { $ship_fee = “184.31”; $ship_title = “UPS Worldwide Expedited”; }*/ if ($shipping) { $shipping_value = explode(‘|’, $shipping); $ship_fee = $shipping_value[1]; $ship_title = $shipping_value[0]; } // Free shipping when ordering over 100 pcs (both U.S and Canada, no restriction) if ($order_detail[“item”][“offer_code”] == ‘FSE100PCSALL’ && $order_detail[“qty”] > 100) { $ship_fee = “0.00”; $ship_title = “”; } //Free shipping when ordering over 200 pcs (within Canada) if ($order_detail[“item”][‘offer_code’] == ‘FSE200PCS’ && $_GET[“shippingCountry”] == “CA” && $order_detail[“qty”] > 200) { $ship_fee = “0.00”; $ship_title = “”; } //Free shipping when ordering over 100 pcs (within Canada if ($order_detail[“item”][‘offer_code’] == ‘FSE100PCS’ && $_GET[“shippingCountry”] == “CA” && $order_detail[“qty”] > 100) { $ship_fee = “0.00”; $ship_title = “”; } //Order 100 pcs or above get additional 10 pcs free if ($order_detail[“item”][‘offer_code’] == ‘FSE100PCS10’ && $order_detail[“qty”] >= 100) { $order_detail[“qty”] = $order_detail[“qty”] + 10; } //Order 100 pcs or above get additional 20 pcs free if ($order_detail[“item”][‘offer_code’] == ‘FSE100PCS20’ && $order_detail[“qty”] >= 100) { $order_detail[“qty”] = $order_detail[“qty”] + 20; } $shippingCountry = $_GET[“shippingCountry”]; $shippingPostCode = $_GET[“shippingPostCode”]; if ($shippingOpt == ‘pickup’) { $set_tax = 0.13; } else { $set_tax = 0.05; //$ship_fee=0; if ($shippingCountry == ‘CA’) { $postal_code = strtolower(str_replace(‘ ‘, ‘+’, $shippingPostCode)); //$geo_url = “http://maps.googleapis.com/maps/api/geocode/json?address=L4B 1J9&sensor=false”; $a = 0; while ($a <= 2) { $geo_json = file_get_contents(“http://maps.googleapis.com/maps/api/geocode/json?address=$postal_code&sensor=false”); $geo_arr = json_decode($geo_json, TRUE); if (!empty($geo_arr)) { $address_components = $geo_arr[‘results’][0][‘address_components’]; foreach ($address_components as $address_component) { if ($address_component[‘types’][0] == ‘administrative_area_level_1’) { $addr_prov = $address_component[‘short_name’]; if ($addr_prov != ‘ON’) { $set_tax = 0.05; } else { $set_tax = 0.13; } } } } if ($set_tax < 0) $a = 6; else $a = $a + 1; } // while ends here } } //added Jan 10 2018 if ($shippingCountry == ‘US’) { $set_tax = 0; } ?> $value) { ?>

9) { echo “Case Bound Glue Binding”; } elseif ($order_detail[“item”][‘color_pages’] > 0 && $order_detail[“item”][‘bw_pages’] > 0) { print “Case Bound Glue Binding”; } else { echo “Casebound Smyth Sewn Binding”; } } elseif ($value == “saddle”) { echo “Saddle Stitch”; } elseif ($value == “coil”) { echo “Coil Bound”; } elseif ($value == “wire”) { echo “Wire-O Bound”; } elseif ($value == “12card”) { echo “Printed Full Color on 12pt Cardstock Cover”; } elseif ($option == “BindingType” && $value == “board”) { echo “Board Book Binding”; } elseif ($option == “BindingType” && $value == “board”) { echo “Board Book Binding”; } elseif ($value == “board” && $option == “cover_stock”) { echo “Printed full color on 2.5mm board”; } elseif ($value == “10bristol”) { echo “Printed Full Color on 10pt Bristol Cover”; } elseif ($value == “imitation”) { echo “Leather”; } elseif ($value == “cloth”) { echo “Cloth / Linen”; } elseif ($option == “free”) { echo “Free”; } elseif ($value == “0”) { echo “None”; } elseif ($value == “self”) { echo “Self Cover”; } elseif ($value == “gloss”) { echo “Gloss Coated”; } elseif ($value == “matte”) { echo “Matte Coated”; } elseif ($value == “board_book_lamination”) { echo “Printed full color on 2mm white card”; } elseif ($value == “soft”) { echo “Soft Touch Silk Laminated”; } elseif ($value == “no”) { echo “No Lamination”; } elseif (($value == “bw” || $value == “color”) && $order_detail[“item”][‘color_pages’] > 0 && $order_detail[“item”][‘bw_pages’] <= 0) { echo ‘Full Color’; } elseif (($value == “bw” || $value == “color”) && $order_detail[“item”][‘color_pages’] > 0 && $order_detail[“item”][‘bw_pages’] > 0) { echo ‘Black & White / Color’; } elseif ($value == “bw”) { echo “Black & White”; } elseif ($value == “color”) { echo “Full Color”; } elseif ($value == “cream_paper”) { echo “Cream Paper”; } elseif ($value == “1”) { echo “Yes”; } elseif ($option == “paper_weight”) { if ($value == “2”) { echo “2mm thick artcard”; } else { echo $value . ” lb”; } } elseif ($option == “quantity”) { echo $order_detail[“qty”]; } else { echo ($value) ? ucwords($value) : “None”; } ?>

Cover Finishing

Payment Summary

Prices in Canadian Dollars (CAD)

Order Reference Number:

Offer Code

Print Cost

$

HST/GST

$

Shipping Fee:

$ ( )

Please contact us for shipping rate

Shipping Address:

Shipping Fee:

Customer Pickup

Total Amount:

$

$ />   Secure Check Out fields(array( ‘hst_gst’ => $tax_fee, ‘shipping_fee’ => $ship_fee, ‘shipping_title’ => $ship_title, ‘shipping_address’ => $ship_address )) ->condition(‘id’, $act_id) ->execute(); if ($mail_sent != 1) { if (!function_exists(‘curl_init’)) { die(‘Sorry cURL is not installed!’); } $url = (((!empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] !== ‘off’) || $_SERVER[‘SERVER_PORT’] == 443) ? ‘https://’ : ‘http://’) . $_SERVER[‘HTTP_HOST’] . “/order_email.php”; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, “act_id=” . $act_id); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $result = curl_exec($ch); curl_close($ch); db_update(‘tbl_order’) ->fields(array( ‘mail_sent’ => ‘1’ )) ->condition(‘id’, $act_id) ->execute(); } ?>