Jump to content

taylorjes

Members
  • Content count

    14
  • Joined

  • Last visited

About taylorjes

  • Birthday 02/07/1985

Profile Information

  • Real Name
    Jesse
  • Gender
    Male
  1. taylorjes

    Halt Cart with no available shipping options.

    Here is the full files for refrence: <?php /* $Id: checkout_shipping.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require('includes/classes/http_client.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping destination address was selected, use the customers own address as default if (!tep_session_is_registered('sendto')) { tep_session_register('sendto'); $sendto = $customer_default_address_id; } else { // verify the selected shipping address if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) { $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); $check_address = tep_db_fetch_array($check_address_query); if ($check_address['total'] != '1') { $sendto = $customer_default_address_id; if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); } } } require(DIR_WS_CLASSES . 'order.php'); $order = new order; // register a random ID in the session to check throughout the checkout procedure // against alterations in the shopping cart contents if (!tep_session_is_registered('cartID')) tep_session_register('cartID'); $cartID = $cart->cartID; // if the order contains only virtual products, forward the customer to the billing page as // a shipping address is not needed if ($order->content_type == 'virtual') { if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); $shipping = false; $sendto = false; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // load all enabled shipping modules require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping; if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { $pass = false; switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) {$pass = true;} break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) {$pass = true;} break; case 'both': $pass = true; break; } $free_shipping = false; if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $free_shipping = true; include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); } }else{ $free_shipping = false; } // process the selected shipping method if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) { if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) { $shipping = $HTTP_POST_VARS['shipping']; list($module, $method) = explode('_', $shipping); if ( is_object($$module) || ($shipping == 'free_free') ) { if ($shipping == 'free_free') { $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE; $quote[0]['methods'][0]['cost'] = '0'; } else { $quote = $shipping_modules->quote($method, $module); } if (isset($quote['error'])) { tep_session_unregister('shipping'); } else { if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) { $shipping = array('id' => $shipping, 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module']), 'cost' => $quote[0]['methods'][0]['cost']); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } } } else { tep_session_unregister('shipping'); } } } else { $shipping = false; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } } // get all available shipping quotes $quotes = $shipping_modules->quote(); //if no shipping modules halt flag $no_shipping_flag = false; if(tep_count_shipping_modules() <= 0) $no_shipping_flag = true; // if no shipping method has been selected, automatically select the cheapest method. // if the modules status was changed when none were available, to save on implementing // a javascript force-selection method, also automatically select the cheapest shipping // method if more than one module is now enabled if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest(); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.checkout_address.shipping[0]) { document.checkout_address.shipping[buttonSelect].checked=true; } else { document.checkout_address.shipping.checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <?php if($no_shipping_flag == true){ ?> <form id="freightForm" name="freightForm" action="freightform.php" method="POST" onsubmit="return validateText();"> <div class="section"> <h1>We're Sorry</h1> <ul> <li>In an effort to get you the best possible price for your order, we need to process your order further.</li> <li>Some of the products in your cart are either too large, or heavy for standard shipping.</li> <li>We will contact multiple freight carriers and find the the best price to ship your order.</li> <li>Your order will be reviewed and a shipping quote will be sent back to you.</li> <li>Please varify your email address below.</li> </ul> </div> <div class="section"> <h3>Shipping Address:</h3> <?php echo ucfirst($order->delivery['firstname']) . ' ' . ucfirst($order->delivery['lastname']);?><br /> <?php echo $order->delivery['street_address']; ?><br /> <?php echo $order->delivery['city'] . ', ' . $order->delivery['state'] .' ' . $order->delivery['postcode'];?><br /><br /> <?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?> </div> <div class="section"> <h3>Products:</h3> <?php foreach($order->products as $value){ echo $value['qty'] . ' x ' . $value['name'] . '<br />'; } ?> </div> <div class="section"> <label for="email">Email:</label><input id="email" name="email" type="text" onfocus="clearRed(this);" /><span id="hiddenHelpText">Please enter your login email address.</span> <br /><br /> <?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);?> </div> <script type="text/javascript"> // <![CDATA[ function validateText() { var email = document.freightForm.email; var helpText = document.getElementById("hiddenHelpText"); var flag = false; if (email.value.length == 0||email.value == "") {// Check Email email.style.backgroundColor = "#ff0000"; flag = true; }else if(email.value != "<?php echo $order->customer['email_address']; ?>"){ email.style.backgroundColor = "#ff0000"; flag = true; } if (flag == true){ helpText.style.visibility = "visible"; return false; }else return true; } function clearRed(element){ element.style.backgroundColor = "#fff"; } //]]> </script> </form> <?php }else{ ?> <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td> <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if (tep_count_shipping_modules() > 0) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td> <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } elseif ($free_shipping == false) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } if ($free_shipping == true) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$i]['icon']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)"> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { $radio_buttons = 0; for ($i=0, $n=sizeof($quotes); $i<$n; $i++) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php if (isset($quotes[$i]['error'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) { // set the radio button to be checked if it is the method chosen $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false); if ( ($checked == true) || ($n == 1 && $n2 == 1) ) { echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } else { echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td> <?php if ( ($n > 1) || ($n2 > 1) ) { ?> <td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td> <td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td> <?php } else { ?> <td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td> <?php } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php $radio_buttons++; } } ?> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } } ?> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> </tr> </table></td> <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td> </tr> </table></td> </tr> <tr> <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></form></td> <?php } ?> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> taylorjes
  2. taylorjes

    Halt Cart with no available shipping options.

    So I've dug into the checkout_shipping and modified it myself. Here goes: BACKUP BACKUP BACKUP BACKUP ---------------------------------------------------------------------------------------------------- Find (Line 132ish): // get all available shipping quotes $quotes = $shipping_modules->quote(); Insert Directly Below: //if no shipping modules halt flag $no_shipping_flag = false; if(tep_count_shipping_modules() <= 0) $no_shipping_flag = true; This code will 'count' the number of shipping modules that are active and IF none are active FLAG ---------------------------------------------------------------------------------------------------- Find (Line 203ish): <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> Directly below this insert: <?php if($no_shipping_flag == true){ ?> This code begins the section where you would post a notice/form/whatever to your customer to inform them that they cannot proceed to the checkout ---------------------------------------------------------------------------------------------------- My Example Form: <form id="freightForm" name="freightForm" action="freightform.php" method="POST" onsubmit="return validateText();"> <div class="section"> <h1>We're Sorry</h1> <ul> <li>In an effort to get you the best possible price for your order, we need to process your order further.</li> <li>Some of the products in your cart are either too large, or heavy for standard shipping.</li> <li>We will contact multiple freight carriers and find the the best price to ship your order.</li> <li>Your order will be reviewed and a shipping quote will be sent back to you.</li> <li>Please varify your email address below.</li> </ul> </div> <div class="section"> <h3>Shipping Address:</h3> <?php echo ucfirst($order->delivery['firstname']) . ' ' . ucfirst($order->delivery['lastname']);?><br /> <?php echo $order->delivery['street_address']; ?><br /> <?php echo $order->delivery['city'] . ', ' . $order->delivery['state'] .' ' . $order->delivery['postcode'];?><br /><br /> <?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?> </div> <div class="section"> <h3>Products:</h3> <?php foreach($order->products as $value){ echo $value['qty'] . ' x ' . $value['name'] . '<br />'; } ?> </div> <div class="section"> <label for="email">Email:</label><input id="email" name="email" type="text" onfocus="clearRed(this);" /><span id="hiddenHelpText">Please enter your login email address.</span> <br /><br /> <?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);?> </div> <script type="text/javascript"> // <![CDATA[ function validateText() { var email = document.freightForm.email; var helpText = document.getElementById("hiddenHelpText"); var flag = false; if (email.value.length == 0||email.value == "") {// Check Email email.style.backgroundColor = "#ff0000"; flag = true; }else if(email.value != "<?php echo $order->customer['email_address']; ?>"){ email.style.backgroundColor = "#ff0000"; flag = true; } if (flag == true){ helpText.style.visibility = "visible"; return false; }else return true; } function clearRed(element){ element.style.backgroundColor = "#fff"; } //]]> </script> </form> Please DO NOT simply replicate this code. I created a whole other page to deal with the information. This is an example ---------------------------------------------------------------------------------------------------- Directly below your notice/form/whatever insert: <?php }else{ ?> This completes the 'no shipping available, do something, section'. ---------------------------------------------------------------------------------------------------- Find (Line 490ish): <tr> <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></form></td> Insert directly below: <?php } ?> and directly above: <!-- body_text_eof //--> This part was a little tricky so the final lines should be EXACTLY: <tr> <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></form></td> <?php } ?> <!-- body_text_eof //--> This includes the ELSEIF for when the no shipping flag is off, ie: shipping is possible. I will update this as needed taylorjes
  3. THIS IS A REPOST - I attempted to contact a moderator, but have yet to hear back. Please remove the original Post I've heavily customized some shipping modules to work with our specific products and consumer base. Our standard shipping applies the following: If -> In Canada and BC -> allow shipping -> if -> in "local delivery area" -> allow shipping for 0 to 999lbs (forced weight for certain products) -> offer FedEx for 0 to 150lbs -> offer flat rate for 150lbs+ -> if -> NOT in "local delivery area" -> offer FedEx for 0 to 150lbs The Problem: If a shopping cart falls outside of these parameters the cart SHOULD not allow the customer to proceed. It SHOULD show an error and allow them to contact us via phone to process the order for them. (we would need to quote shipping) It doesn't... I can get right through the shipping page and proceed to payments. How do I flag OSC to halt the cart process? taylorjes
  4. So, I've been tinkering with Local Delivery Service v3.0 in an attempt to reduce the work needed to canvas an area for delivery. I've pinpointed the area of the code I need to fix, but I'm no PHP guru and frankly I'm stumped. I would like to do three things First: $order->delivery['postcode'] = strtoupper($order->delivery['postcode']); $order->delivery['postcode'] = str_replace(' ', '', $order->delivery['postcode']); I added below: $order_foo = substr(str_replace(' ', '',strtoupper($order->delivery['postcode'])), 0, 3);//strip PC to prefix #A# Second: if (in_array($order->delivery['postcode'], $zipcodes0)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes1)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes2)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes3)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes4)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes5)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes6)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes7)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes8)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes9)){$check_flag = true;} elseif (in_array($order->delivery['postcode'], $zipcodes10)){$check_flag = true;} I want to change to: if ($order_foo == $zipcodes0){$check_flag = true;} elseif ($order_foo == $zipcodes1){$check_flag = true;} elseif ($order_foo == $zipcodes2){$check_flag = true;} elseif ($order_foo == $zipcodes3){$check_flag = true;} elseif ($order_foo == $zipcodes4){$check_flag = true;} elseif ($order_foo == $zipcodes5){$check_flag = true;} elseif ($order_foo == $zipcodes6){$check_flag = true;} elseif ($order_foo == $zipcodes7){$check_flag = true;} elseif ($order_foo == $zipcodes8){$check_flag = true;} elseif ($order_foo == $zipcodes9){$check_flag = true;} elseif ($order_foo == $zipcodes10){$check_flag = true;} Third: if (in_array($order->delivery['postcode'], $zipcodes0)){$shiping_costs = MODULE_SHIPPING_DLY3_COST0;} elseif (in_array($order->delivery['postcode'], $zipcodes1)){$shiping_costs = MODULE_SHIPPING_DLY3_COST1;} elseif (in_array($order->delivery['postcode'], $zipcodes2)){$shiping_costs = MODULE_SHIPPING_DLY3_COST2;} elseif (in_array($order->delivery['postcode'], $zipcodes3)){$shiping_costs = MODULE_SHIPPING_DLY3_COST3;} elseif (in_array($order->delivery['postcode'], $zipcodes4)){$shiping_costs = MODULE_SHIPPING_DLY3_COST4;} elseif (in_array($order->delivery['postcode'], $zipcodes5)){$shiping_costs = MODULE_SHIPPING_DLY3_COST5;} elseif (in_array($order->delivery['postcode'], $zipcodes6)){$shiping_costs = MODULE_SHIPPING_DLY3_COST6;} elseif (in_array($order->delivery['postcode'], $zipcodes7)){$shiping_costs = MODULE_SHIPPING_DLY3_COST7;} elseif (in_array($order->delivery['postcode'], $zipcodes8)){$shiping_costs = MODULE_SHIPPING_DLY3_COST8;} elseif (in_array($order->delivery['postcode'], $zipcodes9)){$shiping_costs = MODULE_SHIPPING_DLY3_COST9;} elseif (in_array($order->delivery['postcode'], $zipcodes10)){$shiping_costs = MODULE_SHIPPING_DLY3_COST10;} to: if ($order_foo == $zipcodes0){$shiping_costs = MODULE_SHIPPING_DLY3_COST0;} elseif ($order_foo == $zipcodes1){$shiping_costs = MODULE_SHIPPING_DLY3_COST1;} elseif ($order_foo == $zipcodes2){$shiping_costs = MODULE_SHIPPING_DLY3_COST2;} elseif ($order_foo == $zipcodes3){$shiping_costs = MODULE_SHIPPING_DLY3_COST3;} elseif ($order_foo == $zipcodes4){$shiping_costs = MODULE_SHIPPING_DLY3_COST4;} elseif ($order_foo == $zipcodes5){$shiping_costs = MODULE_SHIPPING_DLY3_COST5;} elseif ($order_foo == $zipcodes6){$shiping_costs = MODULE_SHIPPING_DLY3_COST6;} elseif ($order_foo == $zipcodes7){$shiping_costs = MODULE_SHIPPING_DLY3_COST7;} elseif ($order_foo == $zipcodes8){$shiping_costs = MODULE_SHIPPING_DLY3_COST8;} elseif ($order_foo == $zipcodes9){$shiping_costs = MODULE_SHIPPING_DLY3_COST9;} elseif ($order_foo == $zipcodes10){$shiping_costs = MODULE_SHIPPING_DLY3_COST10;} But it doesn't work... any I don't know why.
  5. taylorjes

    PayPay - Pro v Standard / Installation

    Thanks Chris, I've started the legwork to get Pro setup, but I've noticed that the OSC mod contains: "Note: PayPal requires the PayPal Express Checkout payment module to be enabled if this module is activated." as well as PayPal's fine-print also notes: "To qualify for this rate, you must offer your online customers Express Checkout. If you don't, your rates could be up to 0.50% higher and you'll disappoint the millions of online shoppers who look for PayPal." Is this accurate? taylorjes
  6. taylorjes

    PayPay - Pro v Standard / Installation

    Hi, I'm finishing a website for an existing company with an international presence. Our company is a construction company with a retail division. We operate in both the US and Canada and our current retail offerings are in the US only. We are branching out by targeting our Canadian market with an online retail store. So, We need three things from PayPal: online processing, "off"-line processing, international control of funds. I'm assuming I need a PayPal Pro setup, so I can offer Virtual Terminal in-the field. Do I need to offer PayPal Express? What are my signifigant risks? Is there anything I should know regarding OSC? I'm asking all the questions, not because I can't find the answers I just would like some confimration. Finally, is there a comprehensive installation guide for PayPal Pro? - taylorjes
  7. The correct OSC way to add this to the catalog.php is: in "catalog/admin/includes/boxes/catalog.php" find: '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>'); change to: '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' . and add below: '<a href="' . tep_href_link(FILENAME_EASYPOPULATE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_EASYPOPULATE . '</a><br>'); at the end of "catalog/admin/includes/filenames" add before final ?>: define('FILENAME_EASYPOPULATE', 'easypopulate.php');//Easy Populate in "catalog/admin/includes/languages/english.php" (or whatever your languages) find: define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected'); add after: define('BOX_CATALOG_EASYPOPULATE', 'Easy Populate');//Easy Populate I've found that by following the "standard" of OSC your files and site will resemble something to other's when they have to deal with it. taylorjes
  8. I do not know if this is the correct place, but any help would be great. I have STS and Multi-Image... FancyBox working and without errors (kinda) I keep getting an error in my error_log(at the catalog level): PHP Warning: reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in home/.../store/includes/modules/sts_inc/fancybox_tag.php on line 30 PHP Warning: Invalid argument supplied for foreach() in /home/...a/store/includes/modules/sts_inc/fancybox_tag.php on line 31 I have searched through the code and frankly I'm boggled... thanks taylorjes
  9. is breaking stuff.... in a good way

  10. taylorjes

    [Contribution] STS v4

    Hello I've been experimenting with STS for a new site and I'm running my templates around in circles trying to solve what is probably a simple design issue. I have STS 4.6 w/ Enchanced Specials, Simple Multi Images, and Fancy Tag for STS working perfectly. I am evolving a free template into a "multi" template with header/footer/sidebar/content pages using CSS. My problem occurred when I was following a click stream through our "catalog": Home > Pools > Inground > Accessories Within the Accessories Sub-Catergory I have both products and other sub-categories (yes the logic is flawed, but..) I would like to display the sub-categories at the top and the products below. I would also like to alter the layout of any sub_category pages with sub_categories within them... (wow that was painful) I though that creating an index.php_X.html and index.php_X_X.html would solve this, but that only changes the product_info pages... Please shed some light on this subject or maybe I'm simply not reading the Users Manual/Beginners Tut correctly... thanks -jt
×