chrometweaks.org

If I opt for an application iPage hosting service, then, who will provide technical support?

Click Here To View All Answers...


First off, If I opt for an application iPage hosting service, then, who will provide technical support? Thanks for any comment. Another question... Guys. One last thing I can go live for one of my store (hope so).

I m using this contribution ans it works fine.

Http://forums.oscommerce.com/index.php?sho...2&hl;=gift++wrap.

Its giftwrap one. you can add this module from admin and do configure it from admin just like shipping or payment. now my problems is that I want a case for that..

I want it this way that.

If the weight of any one of the product is over (say 100lbs) then show the module, else do not show and do not take values to next pages either..

I guess I need some simple if statement, but guys I just born for php. I really need some help. I can pm, post code if needed..

I see the radio boxes for.

Gift wrap.

Or.

No gift wrap.

On checkout_shipping page the first time. I guess if we add an if statement up there, it wont show and take the values to rest. plz help....

Plz tell me code as I dont know which variable is for what..

Thanks in advance..

Now code for my checkout_shipping.php.

<?php.

/*.

 $Id: checkout_shipping.php,v 1.16 2003/06/09 23:03:53 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 [URL=http://www.oscommerce.com]http://www.oscommerce.com[/URL].

 Copyright 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.

   $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 giftwrap module.

 require(DIR_WS_CLASSES'gift.php');.

 $giftwrap_modules = new gift;.

// process the selected giftwrap method.

 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {.

   if (!tep_session_is_registered('giftwrap_info')) tep_session_register('giftwrap_info');.

   if (tep_count_giftwrap_modules() > 0) {.

     if ( (isset($HTTP_POST_VARS['giftwrap'])) && (strpos($HTTP_POST_VARS['giftwrap'], '_')) ) {.

       $giftwrap_info = $HTTP_POST_VARS['giftwrap'];.

       list($module, $method) = explode('_', $giftwrap_info);.

       if (is_object($$module)) {.

         $quote1 = $giftwrap_modules->quote1($method, $module);.

         if (isset($quote1['error'])) {.

           tep_session_unregister('giftwrap');.

         } else {.

           if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {.

             $giftwrap_info = array('id' => $giftwrap_info,.

                                    'title' => $quote1[0]['module']' ('$quote1[0]['methods'][0]['title']')',.

                                    'cost' => $quote1[0]['methods'][0]['cost']);.

           }.

         }.

       } else {.

         tep_session_unregister('giftwrap_info');.

       }.

     }.

   } else {.

     $giftwrap_info = false;.

   }    .

 }.

// get all available giftwrap quotes.

 $quotes1 = $giftwrap_modules->quote1();.

// add gift message.

 if ($HTTP_GET_VARS['action'] == 'update') {.

   if (tep_not_null($HTTP_POST_VARS['giftMessage']) && tep_session_is_registered('giftwrap_info')) {.

     $giftMessage = tep_db_prepare_input($HTTP_POST_VARS['giftMessage']);.

     if (tep_session_is_registered('customer_id')) {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '"$customer_id"' and orders_id = '"$order_id"'");.

     } else {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '0' and orders_id = '"$order_id"'");.

     }.

     tep_session_unregister('giftwrap_info');.

   }.

 }.

// end gift card.

// 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']' ('$quote[0]['methods'][0]['title']')'),.

                               '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 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 HTML 4.01 Transitional//EN">.

<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 //>.

   <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_giftwrap_modules() > 0) {.

?>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">.

         <tr>.

           <td class="main"><b><?php echo TABLE_HEADING_GIFTWRAP_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.

   $quotes1_size = sizeof($quotes1);.

   if ($quotes1_size > 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_GIFTWRAP_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.

   } else {.

?>.

             <tr>.

               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

               <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_GIFTWRAP_INFORMATION; ?></td>.

               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

             </tr>.

<?php.

   }.

   $radio_buttons = 0;.

   for ($i=0; $i<$quotes1_size; $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">.

<?php.

     if (isset($quotes1[$i]['error'])) {.

?>.

                 <tr>.

                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                   <td class="main" colspan="3"><?php echo $quotes1[$i]['error']; ?></td>.

                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                 </tr>.

<?php.

     } else {.

       $size = sizeof($quotes1[$i]['methods']);.

       for ($j=0, $n2=$size; $j<$n2; $j++) {.

// set the radio button to be checked if it is the method chosen.

         $checked = (($quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) ? true : false);.

         if ( ($quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {.

           echo '                  <tr>'"\n";.

         } else {.

           echo '                  <tr>'"\n";.

         }.

?>.

                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                 <td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>.

<?php.

         if ( ($quotes1_size > 1) || ($n2 > 1) ) {.

?>.

                 <td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>.

                 <td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'], $checked); ?></td>.

<?php.

         } else {.

?>.

                 <td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost'])tep_draw_hidden_field('giftwrap', $quotes1[$i]['id']'_'$quotes1[$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>.

<?php.

 }.

?>.

<?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>&nbsp;<?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>&nbsp;<?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>'"\n";.

           } else {.

             echo '                  <tr>'"\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>.

<! 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'); ?>.

This post has been edited by.

211655.

: 15 May 2004, 09:10..

Comments (178)

I would like to know the answer too. Anyone here know what is the answer to your question. I'll do some research in Google and get back to you if I find an decent answer. You should email the people at iPage as they probably could answer your iPage question..

Comment #1

Anyone enjoying the wknd. any hint what to do will help or tell me whats the variable is the one which read price of a product and where hsould I put an if statement...

Clues?..

Comment #2

Anyone plz... I just need some one to get me started if cant help in code. plz plz help. I appreciate your time..

Comment #3

I will pay if someone can add an if statement? around 7-8 dollars... plz help..

Comment #4

I added the if statement like:.

If ($total_weight > 100){.

// then all the gift module.

}.

It works and whn total weight is above 100lbs then it shows the module. but I dont want that. I want if one of them is over 100 dollars then do it. coz 2 products with 50 lbs will mak ethe total weight to 100. plz anyone help.. there might be an array somewhere in some file that I need to bring and compare etc... plz....

Comment #5

Here, I wrote this but havn't tested it, let me know if it does or doesn't work.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While (i < $count) {.

  if ($cartProducts[$count]['weight'] >= 10) {.

   $heavy = true;.

  }.

  i++;.

}.

If ($heavy == true) {.

  //your IF statment here.

}.

Hope it helps,.

Ryan.

This post has been edited by.

Ryanf.

: 18 May 2004, 17:41..

Comment #6

It gives me thsi error:.

Parse error: parse error, unexpected T_INC in D:\vsites\xscom\root\html\checkout_shipping.php on line 72.

Line 72 is:.

I++;..

Comment #7

While ($i < $count).

Forgot the $ try that.

And.

$i++; forgot them both.

This post has been edited by.

Ryanf.

: 18 May 2004, 18:01..

Comment #8

Also, if that works and you want everything OVER 10, change the >= 10 to just > 10 or it will include wieghts of 10...

Comment #9

Thanks a lot. you r my savier but it's still has this prob..

Ur code:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While ($i < $count) {.

 if ($cartProducts[$count]['weight'] >= 10) {.

    $heavy = true;.

 }.

 $i++;.

}.

If ($heavy == true) {.

It still doesnt show when product is over 10 lbs. I chnaged.

$heavy = false;.

To true then it showe din all, it means that code is correct, something is misisng..

Thanks..

Comment #10

If ($heavy = false) it works?.

Try.

If ($heavy = true) <- with one =.

Or it might not be grabbing anything from.

$cartProducts[$count]['weight'].

That may not be right, let me try to find that call somewhere else..

Comment #11

I think it's not grabbing anything. I tested some stuff but no luck. I m really happy and appreciate your help. I have been waiting as I dont know php and dont wanna screw up. please let me know....

Thanks ryan.

Dan.

This post has been edited by.

211655.

: 18 May 2004, 18:27..

Comment #12

Here I got it:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While ($i < $count) {.

If ($cartProducts[$count]['weight'] < 10) {.

$heavy = true;.

}.

$i++;.

}.

If ($heavy == true) {.

Echo 'it works!';.

}.

This post has been edited by.

Ryanf.

: 18 May 2004, 18:48..

Comment #13

Thanks ryan..

Its now showing in both cases, eithe rth eweight is below 10 or above..

Its show sthe module..

Something to be checked??.

Thanks a lot...

Comment #14

Ah, it shows for each item? as it's set up now it will show once for the cart it any of the items are over 10. Just change it to this to show up for each item over 10.

Also in my last post, I had it < 10 instead of > 10 so I could test it and forgot to change it back..

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$i = 0;.

While ($i < $count) {.

If ($cartProducts[$count]['weight'] > 10) {.

//your IF code.

}.

$i++;.

}.

This post has been edited by.

Ryanf.

: 18 May 2004, 19:06..

Comment #15

I tried that but still doesnt show when I add a larger product..

My code full:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$i = 0;.

While ($i < $count) {.

If ($cartProducts[$count]['weight'] > 10) {.

 .

 //your IF statment here.

 .

 //begin code..

// load giftwrap module.

 require(DIR_WS_CLASSES'gift.php');.

 $giftwrap_modules = new gift;.

// process the selected giftwrap method.

 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {.

   if (!tep_session_is_registered('giftwrap_info')) tep_session_register('giftwrap_info');.

   if (tep_count_giftwrap_modules() > 0) {.

     if ( (isset($HTTP_POST_VARS['giftwrap'])) && (strpos($HTTP_POST_VARS['giftwrap'], '_')) ) {.

       $giftwrap_info = $HTTP_POST_VARS['giftwrap'];.

       list($module, $method) = explode('_', $giftwrap_info);.

       if (is_object($$module)) {.

         $quote1 = $giftwrap_modules->quote1($method, $module);.

         if (isset($quote1['error'])) {.

           tep_session_unregister('giftwrap');.

         } else {.

           if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {.

             $giftwrap_info = array('id' => $giftwrap_info,.

                                    'title' => $quote1[0]['module']' ('$quote1[0]['methods'][0]['title']')',.

                                    'cost' => $quote1[0]['methods'][0]['cost']);.

           }.

         }.

       } else {.

         tep_session_unregister('giftwrap_info');.

       }.

     }.

   } else {.

     $giftwrap_info = false;.

   }    .

 }.

// get all available giftwrap quotes.

 $quotes1 = $giftwrap_modules->quote1();.

// add gift message.

 if ($HTTP_GET_VARS['action'] == 'update') {.

   if (tep_not_null($HTTP_POST_VARS['giftMessage']) && tep_session_is_registered('giftwrap_info')) {.

     $giftMessage = tep_db_prepare_input($HTTP_POST_VARS['giftMessage']);.

     if (tep_session_is_registered('customer_id')) {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '"$customer_id"' and orders_id = '"$order_id"'");.

     } else {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '0' and orders_id = '"$order_id"'");.

     }.

     tep_session_unregister('giftwrap_info');.

   }.

 }.

// end gift card.

/// end of gidt ....

}.

$i++;.

}..

Comment #16

Does it show without the if statement?.

When do you want it to show, for every product over 10 or just once if one item in the whole cart is over 10?..

Comment #17

If one of the item in the shopping cart is over 10 dollars then show it, else dont show at all. (any of them over 10) it also shoul dappear only once. I mean even if 2 products have weight over 10. it shoul dbe up only once..

Thanks ryan, I dont have words to thank u..

This post has been edited by.

211655.

: 18 May 2004, 19:29..

Comment #18

Then use this:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While ($i < $count) {.

If ($cartProducts[$count]['weight'] > 10) {.

 $heavy = true;.

}.

$i++;.

}.

If ($heavy == true) {.

  //your IF code  .

}.

Try it with ONE product in the cart under 10 and then with ONE product in the cart over 10, does it do it both times or only the second?..

Comment #19

It does not show the module if weight is less than 10lbs and still doesnt show anythingif weight is over 10lbs. given both times I had one product each as you said..

Thanks..

Comment #20

Does it show the module when it's not inside the if statement?.

Maybe it's the module.

This post has been edited by.

Ryanf.

: 18 May 2004, 19:56..

Comment #21

Yep then it shows all the time. thats what I needed if statement for...

Comment #22

Try this, does it print out IT WORKS when you have an item over 10:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While ($i < $count) {.

If ($cartProducts[$count]['weight'] > 10) {.

$heavy = true;.

}.

$i++;.

}.

If ($heavy == true) {.

Echo 'IT WORKS';.

}.

If not, try it with only one = in the second if statement.

If ($heavy = true).

Try it again with two different purchases of under and over 10.

This post has been edited by.

Ryanf.

: 18 May 2004, 20:03..

Comment #23

No it didnt print "it works".

I tried with single = and same way as last time. but interesting this is that my changing that:.

"if ($cartProducts[$count]['weight'] > 10) {".

Like making > to > changes the output. I mean either displays or not display the module..

Using == for if statement:.

If I set to < then it shows module in both cases..

If I set it to > then it doesnt show shows module in both cases.

Thanks..

Comment #24

You sure the weights are right?.

Check the weights of the products or add a.

Echo $cartProducts[$count]['weight'];.

Before the first if, right after the while and see what comes up..

This post has been edited by.

Ryanf.

: 18 May 2004, 20:44..

Comment #25

Hey ryan!.

It shows nothing. not even a text. if you see th code above for the hwole file, I m in head section of html, does it matter?.

Thanks.

Ps weights are in and correct.

One more thing. this is checkout shipping page. you think we dont need to call those variables for carts as they might not be in ..i dont know...plz help me out..

This post has been edited by.

211655.

: 18 May 2004, 20:57..

Comment #26

If you see th code above for the hwole file, I m in head section of html, does it matter?.

Huh?.

Put just this in page somewhere:.

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

Echo $cartProducts[0]['weight'];.

Does anything print out?.

Check your weights of the products from the admin to make sure they are set...

Comment #27

Yep finally it printed out. it printed out the weight of the first product in the cart. if there are two of them, then still printed the first one's weight..

I tried both ways printed the exact weight. I guess now just need to find out the higest among all of them...

Comment #28

Ryan..

Thank you very much. You were the best help..

This is what I did and worked for me..

$cartProducts = $cart->get_products();.

$count = $cart->count_contents();.

$heavy = false;.

$i = 0;.

While ($i < $count) {.

If (($cartProducts[0]['weight'] > 10 ) | ($cartProducts[1]['weight'] > 10 )  | ($cartProducts[2]['weight'] > 10 ) | ($cartProducts[3]['weight'] > 10 ) | ($cartProducts[4]['weight'] > 10 ) | ($cartProducts[5]['weight'] > 10 )  | ($cartProducts[6]['weight'] > 10 ) | ($cartProducts[7]['weight'] > 10 ) | ($cartProducts[8]['weight'] > 10 ) | ($cartProducts[9]['weight'] > 10 ) | ($cartProducts[10]['weight'] > 10 ) | ($cartProducts[11]['weight'] > 10 ) | ($cartProducts[12]['weight'] > 10 ) | ($cartProducts[13]['weight'] > 10 ) | ($cartProducts[14]['weight'] > 10 ) | ($cartProducts[15]['weight'] > 10 ) | ($cartProducts[16]['weight'] > 10 ) | ($cartProducts[17]['weight'] > 10 ) | ($cartProducts[18]['weight'] > 10 ) | ($cartProducts[19]['weight'] > 10 ) | ($cartProducts[20]['weight'] > 10 ) ) {.

$heavy = true;.

}.

$i++;.

}.

If ($heavy == true) {.

// if stement..

Comment #29

And what will happen if someone buys more than 20 products? Will it still work?.

Just asking out of curiosity!!..

Comment #30

I know, it's just a sample I wrote up there..

Thanks for pointing out..

This post has been edited by.

211655.

: 18 May 2004, 23:01..

Comment #31

Hey dan, all you need to do is put $count back into the array call,.

So instead of [0] you would have [$count].

Then you don't need all that junk in there.

The [0] was for testing purposes only, sorry bout that.

This post has been edited by.

Ryanf.

: 19 May 2004, 01:09..

Comment #32

GEEZ!!! I just noticed that it's not $count it's $i !!!!! Ugg, what a dummy!.

That was our problem the whole time..

Comment #33

Will this work for this:.

I am using table shipping method. I want all orders over $500 to say Call for shipping quote..

I tried this in the shipping table, but it only shows $0..

25:17.00,99:24.00,199:33.00,299:41.00,499:46.00,10000:call..

Comment #34

Noops..

I am using same thing. I will pm you the code today. you have to add that in 4-5 files where products are listed. pm me too and remind me then..

Thanks...

Comment #35

Guys. One last thing I can go live for one of my store (hope so).

I m using this contribution ans it works fine.

Http://forums.oscommerce.com/index.php?sho...2&hl;=gift++wrap.

Its giftwrap one. you can add this module from admin and do configure it from admin just like shipping or payment. now my problems is that I want a case for that..

I want it this way that.

If the weight of any one of the product is over (say 100lbs) then show the module, else do not show and do not take values to next pages either..

I guess I need some simple if statement, but guys I just born for php. I really need some help. I can pm, post code if needed..

I see the radio boxes for.

Gift wrap.

Or.

No gift wrap.

On checkout_shipping page the first time. I guess if we add an if statement up there, it wont show and take the values to rest. plz help....

Plz tell me code as I dont know which variable is for what..

Thanks in advance..

Now code for my checkout_shipping.php.

<?php.

/*.

 $Id: checkout_shipping.php,v 1.16 2003/06/09 23:03:53 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 [URL=http://www.oscommerce.com]http://www.oscommerce.com[/URL].

 Copyright 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.

   $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 giftwrap module.

 require(DIR_WS_CLASSES'gift.php');.

 $giftwrap_modules = new gift;.

// process the selected giftwrap method.

 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {.

   if (!tep_session_is_registered('giftwrap_info')) tep_session_register('giftwrap_info');.

   if (tep_count_giftwrap_modules() > 0) {.

     if ( (isset($HTTP_POST_VARS['giftwrap'])) && (strpos($HTTP_POST_VARS['giftwrap'], '_')) ) {.

       $giftwrap_info = $HTTP_POST_VARS['giftwrap'];.

       list($module, $method) = explode('_', $giftwrap_info);.

       if (is_object($$module)) {.

         $quote1 = $giftwrap_modules->quote1($method, $module);.

         if (isset($quote1['error'])) {.

           tep_session_unregister('giftwrap');.

         } else {.

           if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {.

             $giftwrap_info = array('id' => $giftwrap_info,.

                                    'title' => $quote1[0]['module']' ('$quote1[0]['methods'][0]['title']')',.

                                    'cost' => $quote1[0]['methods'][0]['cost']);.

           }.

         }.

       } else {.

         tep_session_unregister('giftwrap_info');.

       }.

     }.

   } else {.

     $giftwrap_info = false;.

   }    .

 }.

// get all available giftwrap quotes.

 $quotes1 = $giftwrap_modules->quote1();.

// add gift message.

 if ($HTTP_GET_VARS['action'] == 'update') {.

   if (tep_not_null($HTTP_POST_VARS['giftMessage']) && tep_session_is_registered('giftwrap_info')) {.

     $giftMessage = tep_db_prepare_input($HTTP_POST_VARS['giftMessage']);.

     if (tep_session_is_registered('customer_id')) {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '"$customer_id"' and orders_id = '"$order_id"'");.

     } else {.

       tep_db_query("update "TABLE_ORDERS" set giftMessage = '"tep_db_input($giftMessage)"' where customers_id = '0' and orders_id = '"$order_id"'");.

     }.

     tep_session_unregister('giftwrap_info');.

   }.

 }.

// end gift card.

// 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']' ('$quote[0]['methods'][0]['title']')'),.

                               '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 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 HTML 4.01 Transitional//EN">.

<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 //>.

   <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_giftwrap_modules() > 0) {.

?>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">.

         <tr>.

           <td class="main"><b><?php echo TABLE_HEADING_GIFTWRAP_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.

   $quotes1_size = sizeof($quotes1);.

   if ($quotes1_size > 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_GIFTWRAP_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.

   } else {.

?>.

             <tr>.

               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

               <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_GIFTWRAP_INFORMATION; ?></td>.

               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

             </tr>.

<?php.

   }.

   $radio_buttons = 0;.

   for ($i=0; $i<$quotes1_size; $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">.

<?php.

     if (isset($quotes1[$i]['error'])) {.

?>.

                 <tr>.

                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                   <td class="main" colspan="3"><?php echo $quotes1[$i]['error']; ?></td>.

                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                 </tr>.

<?php.

     } else {.

       $size = sizeof($quotes1[$i]['methods']);.

       for ($j=0, $n2=$size; $j<$n2; $j++) {.

// set the radio button to be checked if it is the method chosen.

         $checked = (($quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) ? true : false);.

         if ( ($quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {.

           echo '                  <tr>'"\n";.

         } else {.

           echo '                  <tr>'"\n";.

         }.

?>.

                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

                 <td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>.

<?php.

         if ( ($quotes1_size > 1) || ($n2 > 1) ) {.

?>.

                 <td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>.

                 <td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id']'_'$quotes1[$i]['methods'][$j]['id'], $checked); ?></td>.

<?php.

         } else {.

?>.

                 <td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost'])tep_draw_hidden_field('giftwrap', $quotes1[$i]['id']'_'$quotes1[$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>.

<?php.

 }.

?>.

<?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>&nbsp;<?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>&nbsp;<?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>'"\n";.

           } else {.

             echo '                  <tr>'"\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>.

<! 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'); ?>.

This post has been edited by.

211655.

: 15 May 2004, 09:10..

Comment #36

One thing to stress:.

I need that if statement this way that.

If any one of the chosen product has a weight over 100 lbs then show that module else dont..

I am not talking abt combine weight. if any one of them has that, then there is a charge for gift wrapping. sounds wierd but not my requirements:P..

Comment #37


This question was taken from a support group/message board and re-posted here so others can learn from it.