Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bad Link


MysticBlues

Recommended Posts

I get sent to a blank page when I try to recalculate shipping costs. The properties of the recalculate shipping link shows the following path: http://www.mysticbluesgifts.com/_ (there is an underscore after the last slash)

This link is obviously wrong... but I need to know 1. what the correct path should be and 2. where to fix the link. Thanks!

Link to comment
Share on other sites

If you only get this type of link in this particular instance, then it is most likely a typo. You will need to look at the code for whatever page you are on prior to the failure and proceed from there. Sorry I can't offer more help but there isn't much information to go on.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

If you only get this type of link in this particular instance, then it is most likely a typo.  You will need to look at the code for whatever page you are on prior to the failure and proceed from there.  Sorry I can't offer more help but there isn't much information to go on.

 

Jack

 

 

If you go to my website and add something to your cart, your cart will display your shipping charges. If you add another item the shipping charges will also change, so the shipping module itself is calculating correctly. However, if you change your zip code or location etc in your cart and click the link next to where you enter your zip code that says Recalculate it will take you to a Page Not Found. Since by looking at the link itself I can tell it's bad, the page it needs should exist. I just don't know what the correct link should be. I have tried looking at other people's site and searching the archives for answers to no avail. I am clueless here and need help bad! Thanks!

Link to comment
Share on other sites

Here is the code from \includes\modules\shipping_estimator.php. I think the problem must be in here somewhere. If someone could please look at this to see if they can find an error I would appreciate it. Thanks!

 

<?php
/*
 $Id: ship in cart,v 1.6 2003/03/30 13:21:58 ednique Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 Edwin Bekaert ([email protected])

 Customized by: Linda McGrath [email protected]
 * This now handles Free Shipping for orders over $total as defined in the Admin
 * This now shows Free Shipping on Virtual products
 * Everything is contained in an infobox for easier placement.

 Released under the GNU General Public License

 http://www.oscommerce.com/forums/viewtopic.php?t=38411

 http://www.oscommerce.com/community/contributions,1094
*/
?>
<!-- shipping_estimator //-->
         <tr>
           <td align="<?php echo (strstr($PHP_SELF,'shipping_estimator.php') ? 'right' : 'center'); ?>">
             <table><tr><td>

<?php
// Only do when something is in the cart
if ($cart->count_contents() > 0) {

// Could be placed in english.php
// shopping cart quotes
 define('SHIPPING_OPTIONS', 'Shipping Options:');
 if (strstr($PHP_SELF,'shopping_cart.php')) {
   define('SHIPPING_OPTIONS_LOGIN', 'Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>, to display your personal shipping costs.');
 } else {
   define('SHIPPING_OPTIONS_LOGIN', 'Please Log In, to display your personal shipping costs.');
 }
 define('SHIPPING_METHOD_TEXT','Shipping Methods:');
 define('SHIPPING_METHOD_RATES','Rates:');
 define('SHIPPING_METHOD_TO','Ship to: ');
 define('SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>');
 define('SHIPPING_METHOD_FREE_TEXT','Free Shipping');
 define('SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
 define('SHIPPING_METHOD_RECALCULATE','Recalculate');
 define('SHIPPING_METHOD_ZIP_REQUIRED','true');
 define('SHIPPING_METHOD_ADDRESS','Address:');

 // shipping cost
 require('includes/classes/http_client.php'); // shipping in basket

 if($cart->get_content_type() !== 'virtual') {
   if (tep_session_is_registered('customer_id')) {
     // user is logged in
     if (isset($HTTP_POST_VARS['address_id'])){
       // user changed address
       $sendto = $HTTP_POST_VARS['address_id'];
     }elseif (tep_session_is_registered('cart_address_id')){
       // user once changed address
       $sendto = $cart_address_id;
     }else{
       // first timer
       $sendto = $customer_default_address_id;
     }
     // set session now
     $cart_address_id = $sendto;
     tep_session_register('cart_address_id');
     // include the order class (uses the sendto !)
     require(DIR_WS_CLASSES . 'order.php');
     $order = new order;
   }else{
     // user not logged in !
     if (isset($HTTP_POST_VARS['country_id'])){
       // country is selected
       $country_info = tep_get_countries($HTTP_POST_VARS['country_id'],true);
       $order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'],
                                'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
                                'country_id' => $HTTP_POST_VARS['country_id'],
                                'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
       $cart_country_id = $HTTP_POST_VARS['country_id'];
       tep_session_register('cart_country_id');
       $cart_zip_code = $HTTP_POST_VARS['zip_code'];
       tep_session_register('cart_zip_code');
     }elseif (tep_session_is_registered('cart_country_id')){
       // session is available
       $country_info = tep_get_countries($cart_country_id,true);
       $order->delivery = array('postcode' => $cart_zip_code,
                                'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
                                'country_id' => $cart_country_id,
                                'format_id' => tep_get_address_format_id($cart_country_id));
     } else {
       // first timer
       $cart_country_id = STORE_COUNTRY;
       tep_session_register('cart_country_id');
// WebMakers.com Added: changes
// changed from STORE_ORIGIN_ZIP to SHIPPING_ORIGIN_ZIP
       $cart_zip_code = SHIPPING_ORIGIN_ZIP;
       $country_info = tep_get_countries(STORE_COUNTRY,true);
       tep_session_register('cart_zip_code');
       $order->delivery = array('postcode' => SHIPPING_ORIGIN_ZIP,
                                'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
                                'country_id' => STORE_COUNTRY,
                                'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
     }
     // set the cost to be able to calvculate free shipping
     $order->info = array('total' => $cart->show_total()); // TAX ????
   }
   // weight and count needed for shipping !
   $total_weight = $cart->show_weight();
   $total_count = $cart->count_contents();
   require(DIR_WS_CLASSES . 'shipping.php');
   $shipping_modules = new shipping;
   $quotes = $shipping_modules->quote();
   $cheapest = $shipping_modules->cheapest();
   // set selections for displaying
   $selected_country = $order->delivery['country']['id'];
   $selected_zip = $order->delivery['postcode'];
   $selected_address = $sendto;
 }
   // eo shipping cost

 $info_box_contents = array();
 $info_box_contents[] = array('text' => SHIPPING_OPTIONS);

 new infoBoxHeading($info_box_contents, false, false);

// check free shipping based on order $total
 if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
   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;
     default:
       $pass = false; 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;
 }
// end free shipping based on order total
//  $ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
 $ShipTxt= tep_draw_form('estimator', tep_href_link(basename($PHP_SELF), '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
 $ShipTxt.='<table>';
 if(sizeof($quotes)) {
   if (tep_session_is_registered('customer_id')) {
     // logged in
     $addresses_query = tep_db_query("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
     while ($addresses = tep_db_fetch_array($addresses_query)) {
       $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' '));
     }
 



     $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
               SHIPPING_METHOD_ADDRESS .' '. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="document.estimator.submit();return false;"').'</td></tr>';
     $ShipTxt.='<tr valign="top"><td class="main">' . SHIPPING_METHOD_TO .'</td><td colspan="2" class="main">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td></tr>';
   } else {
     // not logged in
     $ShipTxt.=tep_output_warning(SHIPPING_OPTIONS_LOGIN);
     
     $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
               ENTRY_COUNTRY .' '. tep_get_country_list('country_id', $selected_country,'style="width=200;"');
     if(SHIPPING_METHOD_ZIP_REQUIRED == "true"){
       $ShipTxt.=' '.ENTRY_POST_CODE .' '. tep_draw_input_field('zip_code', $selected_zip, 'size="10"');
     }
     $ShipTxt.=' <a href="_" onclick="document.estimator.submit();return false;">' . SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';
   }
   if ($free_shipping==1) {
     // order $total is free
     $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
     $ShipTxt.='<tr><td> </td><td class="main">' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</td><td> </td></tr>';
   }else{
     // shipping display
     $ShipTxt.='<tr><td></td><td class="main" align="left"><b>' . SHIPPING_METHOD_TEXT . '</b></td><td class="main" align="center"><b>' . SHIPPING_METHOD_RATES . '</b></td></tr>';
     $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
     for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
       if(sizeof($quotes[$i]['methods'])==1){
         // simple shipping method
         $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
         $ShipTxt.= '<tr class="'.$extra.'">';
         $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].' </td>';
         if($quotes[$i]['error']){
           $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].' ';
           $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
         }else{
           if($cheapest['id'] == $thisquoteid){
             $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].' ';
             $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'<b></td></tr>';
           }else{
             $ShipTxt.='<td class="main">'.$quotes[$i]['module'].' ';
             $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</td></tr>';
           }
         }
       } else {
         // shipping method with sub methods (multipickup)
         for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
           $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
           $ShipTxt.= '<tr class="'.$extra.'">';
           $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].' </td>';
           if($quotes[$i]['error']){
             $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].' ';
             $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
           }else{
             if($cheapest['id'] == $thisquoteid){
               $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].' ';
               $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td></tr>';
             }else{
               $ShipTxt.='<td class="main">'.$quotes[$i]['module'].' ';
               $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td></tr>';
             }
           }
         }
       }
     }
   }
 } else {
   // virtual product/download
   $ShipTxt.='<tr><td class="main">' . SHIPPING_METHOD_FREE_TEXT . ' ' . SHIPPING_METHOD_ALL_DOWNLOADS . '</td></tr>';
 }

 $ShipTxt.= '</table></form>';

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $ShipTxt);

 new infoBox($info_box_contents);
} // Only do when something is in the cart
?>
             </td></tr></table>
           </td>
         </tr>
<!-- shipping_estimator_eof //-->

Link to comment
Share on other sites

Look at around line 174:

 

$ShipTxt.=' <a href="_" onclick="document.estimator.submit();return false;">' . SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';

 

This could be what is causing the issue.

 

Good luck,

 

Bob G.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

  • 1 month later...
Emmett you are a GENIUS!!!! Problem fixed!!!! Thank you so MUCH!!!!

From another thread I found this. Emmett's soluton takes away the error but does not make the estimator work. In catalog/shopping_cart.php move the call to the shipping estimator as described below

 

So I deleted the around line 229 </table> just before the </form> and then under this :

QUOTE

<?php

}

?>

  </form>

</td>

(remember I removed </table>)

 

I added this

QUOTE

  <tr>

    <td><br><?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?></td>

  </tr></table>

 

And it now works! lovely stuff!

Link to comment
Share on other sites

From another thread I found this. Emmett's soluton takes away the error but does not make the estimator work.  In  catalog/shopping_cart.php move the call to the shipping estimator as described below

 

 

I understand what you are meaning but I don't see the exact spot to fix it as you are describing :(

 

Below is my whole code again ... including the changes I made based on Emmet's suggestion.

 

Would you be so kind as to show me exactly where... Thanks!

 

 

<?php
/*
 $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

 Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
 Linda McGrath - [email protected]
*/

 require("includes/application_top.php");

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));

// BOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
// Validate Cart for checkout
 $valid_to_checkout= true;
 $cart->get_products(true);
 if (!$valid_to_checkout) {
//    $messageStack->add_session('header', 'Please update your order ...', 'error');
//    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }
// EOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller

?>
<!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">
<?php
// WebMakers.com Added: Shoppe Enhancement Controller
 include(DIR_WS_INCLUDES . 'info_win.php');
// WebMakers.com Added: Shoppe Enhancement Controller
?>
</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('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
         <td colspan="2" class="main">
         </td>
       </tr>
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.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>
<?php
 if ($cart->count_contents() > 0) {
?>

     <tr>
       <td>
<?php
   $info_box_contents = array();
   $info_box_contents[0][] = array('align' => 'center',
                                   'params' => 'class="productListing-heading"',
                                   'text' => TABLE_HEADING_REMOVE);

   $info_box_contents[0][] = array('params' => 'class="productListing-heading"',
                                   'text' => TABLE_HEADING_PRODUCTS);

   $info_box_contents[0][] = array('align' => 'center',
                                   'params' => 'class="productListing-heading"',
                                   'text' => TABLE_HEADING_QUANTITY);

   $info_box_contents[0][] = array('align' => 'right',
                                   'params' => 'class="productListing-heading"',
                                   'text' => TABLE_HEADING_TOTAL);

   $discounts_available = 'false';

   $any_out_of_stock = 0;
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// Push all attributes information in an array
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
       while (list($option, $value) = each($products[$i]['attributes'])) {
// dogu 2003-02-28 hidden fields are used later
//          echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
// WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
         if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
           $options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
         } else {
           $options_order_by= ' order by popt.products_options_name';
         }
         $new_fields=', pa.attributes_price_onetime, pa.attributes_display_only, pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix, popt.products_options_sort_order, pa.attributes_qty_prices_onetime, pa.attributes_discounted, pa.attributes_price_factor, pa.attributes_price_factor_offset';
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix" . $new_fields .
                                     " from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     where pa.products_id = '" . $products[$i]['id'] . "'
                                      and pa.options_id = '" . $option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . $value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . $languages_id . "'
                                      and poval.language_id = '" . $languages_id . "'" . $options_order_by);
         $attributes_values = tep_db_fetch_array($attributes);

// dogu 2003-02-28 BEGIN determine if attribute is a text attribute and assign to $attr_value temporarily
         if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
           echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']',  $products[$i]['attributes_values'][$option]);
           $attr_value = $products[$i]['attributes_values'][$option];
         } else {
           echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
           $attr_value = $attributes_values['products_options_values_name'];
         }
// dogu 2003-02-28 END determine if attribute is a text attribute

         $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
         $products[$i][$option]['options_values_id'] = $value;
// dogu 2003-02-28 assign $attr_value
//          $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
         $products[$i][$option]['products_options_values_name'] = $attr_value;

// WebMakers.com Added: Attribute is free?
//          $products[$i][$option]['options_values_price'] = ($attributes_values['product_attribute_is_free'] =='1' ? 0 : $attributes_values['options_values_price']);
         $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
         $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
// WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
         $products[$i][$option]['attributes_price_onetime'] = ($attributes_values['product_is_free'] =='1' ? 0 : $attributes_values['attributes_price_onetime']);
         $products[$i][$option]['attributes_display_only'] = $attributes_values['attributes_display_only'];
         $products[$i][$option]['product_attribute_is_free'] = $attributes_values['product_attribute_is_free'];
         $products[$i][$option]['products_attributes_weight'] = $attributes_values['products_attributes_weight'];
         $products[$i][$option]['products_attributes_weight_prefix'] = $attributes_values['products_attributes_weight_prefix'];

         $products[$i][$option]['attributes_qty_prices_onetime'] = $attributes_values['attributes_qty_prices_onetime'];
         $products[$i][$option]['attributes_discounted'] = $attributes_values['attributes_discounted'];

         $products[$i][$option]['attributes_price_factor'] = $attributes_values['attributes_price_factor'];
         $products[$i][$option]['attributes_price_factor_offset'] = $attributes_values['attributes_price_factor_offset'];
       }
     }
   }

   for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// BOF: WebMakers.com Added: Shoppe Enhancement Controller
// All error messages at top of product

     $the_error_msg='';
     include(DIR_WS_INCLUDES . 'verify_shopping_cart.php');

// EOF: WebMakers.com Added: Shoppe Enhancement Controller

     if (($i/2) == floor($i/2)) {
       $info_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
       $info_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($info_box_contents) - 1;



//+++AUCTIONBLOX.COM
if (isset($products[$i]['is_auction_item']))
{
 $info_box_contents[$cur_row][] = array('align' => 'center',
     'params' => 'class="productListing-data" valign="top"',
 'text' => ' ');
}
else
{
 $info_box_contents[$cur_row][] = array('align' => 'center',
 'params' => 'class="productListing-data" valign="top"',
 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
}

$products_name = '';
if (isset($products[$i]['is_auction_item']))
{  
 $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
 '  <tr>' .
 '    <td class="productListing-data" align="center"><a target="_blank" href="' . $products[$i]['item_url'] . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], (SMALL_IMAGE_WIDTH * (((100 - IMAGE_SHOPPING_CART_PERCENTAGE)/100))) , (SMALL_IMAGE_HEIGHT * (((100 - IMAGE_SHOPPING_CART_PERCENTAGE)/100))))  . '</a></td>' .
 '    <td class="productListing-data" valign="top"><a target="_blank" href="' . $products[$i]['item_url']. '"><b>' . $products[$i]['name'] . '</b></a>';
}
else
{
 $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
             '  <tr>' .
             '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], (SMALL_IMAGE_WIDTH * (((100 - IMAGE_SHOPPING_CART_PERCENTAGE)/100))) , (SMALL_IMAGE_HEIGHT * (((100 - IMAGE_SHOPPING_CART_PERCENTAGE)/100))))  . '</a></td>' .
             '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
  
}

if (!isset($products[$i]['is_auction_item']))
{
 if (STOCK_CHECK == 'true'){
	 $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
	 if (tep_not_null($stock_check)){
   $any_out_of_stock = 1;
   $products_name .= $stock_check;
	 }
 }
 }
 //+++AUCTIONBLOX.COM





// WebMakers.com Added: Shoppe Enhancement Controller
     $show_attributes_error='';
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
       reset($products[$i]['attributes']);
       while (list($option, $value) = each($products[$i]['attributes'])) {

///////////////////////
//if ($hold_i) {
if ($products[$i][$option]['attributes_display_only']=='1' and !$show_attributes_error) {
 $show_errors=true;
 $show_attributes_error = tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . ATTRIBUTES_INVALID_OPTIONS_TEXT . ' ' . tep_image(DIR_WS_ICONS . 'icon_status_red.gif');

// make inactive links on Help
 if (strstr($PHP_SELF, 'shopping_cart_help')) {
   $show_attributes_error .= '<b><br>' . ATTRIBUTES_ERROR_TO_FIX . '</b> ' . ATTRIBUTE_ERROR_CLICK_HERE . '<br>' . ATTRIBUTE_ERROR_DIRECTIONS;

 } else {
   $show_attributes_error .= '<b><br>' . ATTRIBUTES_ERROR_TO_FIX . '</b> ' . '<a class="ShoppingCartError" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'NONSSL') . '">' . ATTRIBUTE_ERROR_CLICK_HERE . '</a> ' . '<br>' . ATTRIBUTE_ERROR_DIRECTIONS;
 }
}
////////////////////////////////

// check for one time charges
// discounts applied to attributes_price_onetime charges
         if ($products[$i][$option]['attributes_discounted']=='1') {
           $new_attributes_price_onetime= tep_get_markdown( ($products[$i][$option]['attributes_price_onetime']), $discounted_perc);
           $total_one_time_charges += tep_get_markdown( ($products[$i][$option]['attributes_price_onetime']), $discounted_perc);
           $is_taxed += round( ((tep_get_markdown( ($products[$i][$option]['attributes_price_onetime']), $discounted_perc) * tep_get_tax_rate($products[$i]['tax_class_id'], 1) )/100) ,TAX_DECIMAL_PLACES);
         } else {
           $new_attributes_price_onetime= ( ($products[$i][$option]['attributes_price_onetime']));
           $total_one_time_charges += ( ($products[$i][$option]['attributes_price_onetime']) );
           $is_taxed += round( (( ( ($products[$i][$option]['attributes_price_onetime']) ) * tep_get_tax_rate($products[$i]['tax_class_id'], 1) )/100), TAX_DECIMAL_PLACES);
         }

// check if attributes_qty_prices_onetime exists
// no discount applied to attributes_qty_prices_onetime charges
         $new_attributes_qty_prices_onetime= tep_get_attributes_qty_prices_onetime($products[$i][$option]['attributes_qty_prices_onetime'], $products[$i]['quantity']);
         $total_one_time_charges += tep_get_attributes_qty_prices_onetime($products[$i][$option]['attributes_qty_prices_onetime'],$products[$i]['quantity']);
         $is_taxed += round( (( ( tep_get_attributes_qty_prices_onetime($products[$i][$option]['attributes_qty_prices_onetime'],$products[$i]['quantity']) ) * tep_get_tax_rate($products[$i]['tax_class_id'], 1) )/100), TAX_DECIMAL_PLACES);
         if ( ($products[$i][$option]['product_attribute_is_free']) or ($products[$i][$option]['products_options_name']) or ($new_attributes_price_onetime) or ($new_attributes_qty_prices_onetime)) {
           if ($products[$i][$option]['attributes_display_only']=='1') {
             $products_name .=  '<br>' . '<span class="ShoppingCartAttributesError"> - ' . tep_image(DIR_WS_ICONS . 'icon_status_red.gif') . ' ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . ( $new_attributes_price_onetime != 0 ? '<br>' . ATTRIBUTES_UNITS_ONETIME_TEXT . ' ' . $currencies->display_price($new_attributes_price_onetime, tep_get_tax_rate($products[$i]['tax_class_id']), 1) : '') . ($products[$i][$option]['product_attribute_is_free']=='1' ? ' - FREE' : '') . '</span>';
           } else {
             $products_name .=  '<br><span class="ShoppingCartAttributes"> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . ( $new_attributes_price_onetime != 0 ? '<br>' . ATTRIBUTES_UNITS_ONETIME_TEXT . ' ' . $currencies->display_price($new_attributes_price_onetime, tep_get_tax_rate($products[$i]['tax_class_id']), 1) : '') . ($products[$i][$option]['product_attribute_is_free']=='1' ? ' - FREE' : '') . '</span>';
             if ($new_attributes_qty_prices_onetime !=0) {
               $products_name .=  '<br><span class="ShoppingCartAttributes">    - ' . ATTRIBUTES_QTY_PRICE_ONETIME_TEXT . ' ' . $currencies->display_price($new_attributes_qty_prices_onetime, tep_get_tax_rate($products[$i]['tax_class_id']), 1) . '</span>';
             }
           }
         } // free, option_name or onetime
       }
     } // attributes

// WebMakers.com Added: Display errors
if ($show_errors) {
     if (($i/2) == floor($i/2)) {
//        $info_box_contents[] = array('params' => 'class="productListing-even"');
     $info_box_contents[] = array('align' => 'left',
                                              'params' => 'class="productListing-data" valign="top"',
                                              'text' =>
                                              '<tr class="productListing-even"><td colspan="4" class= "infoBoxNotice" align="left"><table border="0" width="100%" cellspacing="1" cellpadding="1"><tr class="productListing-even"><td class="infoBoxNoticeContents">' .
                                              $the_error_msg . ($the_error_msg ? ($show_attributes_error ? '<br>' : '') : '') .
                                              $show_attributes_error .
                                              '</td></tr></table></td></tr>' .
                                              '<tr class="productListing-even" height="3"><td colspan="4" class="productListing-even"> </td></tr>'
                                              );

     } else {
//        $info_box_contents[] = array('params' => 'class="productListing-odd"');
     $info_box_contents[] = array('align' => 'left',
                                              'params' => 'class="productListing-data" valign="top"',
                                              'text' =>
                                              '<tr class="productListing-odd"><td colspan="4" class= "infoBoxNotice" align="left"><table border="0" width="100%" cellspacing="1" cellpadding="1"><tr class="productListing-odd"><td class="infoBoxNoticeContents">' .
                                              $the_error_msg . ($the_error_msg ? ($show_attributes_error ? '<br>' : '') : '') .
                                              $show_attributes_error .
                                              '</td></tr></table></td></tr>' .
                                              '<tr class="productListing-odd height="3"><td colspan="4" class="productListing-odd"> </td></tr>'
                                              );
     }
}

     $products_name .= '    </td>' .
                       '  </tr>' .
                       '</table>';

     $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
                                            'text' => $products_name);



//+++AUCTIONBLOX.COM
     if (isset($products[$i]['is_auction_item']))
     {  
        $info_box_contents[$cur_row][] = array('align' => 'center',
                                               'params' => 'class="productListing-data" valign="top"',
                                               'text' => $products[$i]['quantity']);
     }
     else
     {
        $info_box_contents[$cur_row][] = array('align' => 'center',
                                               'params' => 'class="productListing-data" valign="top"',
                                               'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
     }        
     //+++AUCTIONBLOX.COM


// WebMakers.com Added: Shoppe Enhancement Controller
// apply discounts
     if ($new_price==0) {
       if (tep_get_products_price_is_free($products[$i]['id'])) {
         $this_products_price = PRODUCTS_PRICE_IS_FREE_TEXT;
       }
     } else {
// free product
       if (tep_get_products_price_is_free($products[$i]['id'])) {
         $this_products_price = PRODUCTS_PRICE_IS_FREE_TEXT;
       } else {
// WebMakers.com Added: exclude price
         if ($products[$i]['products_price_excluded']=='1') {
           // do not show price
           $this_products_price = ' ';
         } else {
//            $this_products_price = ($products[$i]['quantity'] > 1 ? PRODUCTS_PRICE_EA_TEXT . ' ' . $currencies->display_price($new_price, tep_get_tax_rate($products[$i]['tax_class_id']), 1) . ' ' : '') . $currencies->display_price($new_price, tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']);
// $new_attributes_price . '<br>d - ' . $this_products_new_price
//            $new_price += $new_attributes_price;
           $this_products_price = $currencies->display_price(($new_price + $new_attributes_price), tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']);
         }
       }
     }

     $info_box_contents[$cur_row][] = array('align' => 'right',
                                            'params' => 'class="productListing-data" valign="top"',
                                            'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');


// BOF: WebMakers.com Added: Shoppe Enhancement Controller
// All error messages below each product

/*
     $the_error_msg='';
     include(DIR_WS_INCLUDES . 'verify_shopping_cart.php');
     $info_box_contents[] = array('align' => 'left',
                                              'params' => 'class="productListing-data" valign="top"',
                                              'text' => $the_error_msg
                                             );
*/
// EOF: WebMakers.com Added: Shoppe Enhancement Controller

   }

   new productListingBox($info_box_contents);

?>
       </td>
     </tr>

<?php
// WebMakers.com Added: Shoppe Enhancement Controller
// Notice of discounts on products
if ($discounts_available=='true') {
?>
     <tr>
       <td class="main" align="right"><?php echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif') . ' ' . SHOW_DISCOUNTS_AVAILABLE; ?></td>
     </tr>
<?php
}
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

<?php
// only show total onetime charges if != 0
if ($total_one_time_charges != 0) {
echo     '            <td colspan="4" class="main" align="right" valign="top">' . "\n" .
        '            <table width="100%">' . "\n";
     echo '              <tr>' . "\n" .
          '                <td align="right" class="main" valign="top"><b>' . ATTRIBUTES_TOTAL_ONETIME_CHARGES . '</b></td>' . "\n" .
          '                <td align="right" class="main" valign="top"><b>' . $currencies->format($total_one_time_charges + $is_taxed) . '</b><br>' . '</td>' . "\n" .
          '              </tr>' . "\n" .
          '            </table></td></tr>' . "\n";
}
?>


     <tr>
       <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
     </tr>
<?php
   if ($any_out_of_stock == 1) {
     if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
     <tr>
       <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
     </tr>
<?php
     } else {
?>
     <tr>
       <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
     </tr>
<?php
     }
   }
?>
     <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 tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?php
   $back = sizeof($navigation->path)-2;
   if (isset($navigation->path[$back])) {
?>
               <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
   }
?>
<?php
// BOF: WebMakers.com Added: Wholesaler - if an error no checkout
if (!$valid_to_checkout) {
?>
           <td align="center" class="main"><a href="<?php echo 'shopping_cart_help.php'; ?>" onclick="NewWindow(this.href,'name','500','500','yes');return false;"><?php echo tep_image(DIR_WS_ICONS . 'stop_checkout.gif','Please Correct Errors Before Checkout'); ?><br>Help</a></td>
<?php
} else {
?>
               <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<?php
}
// EOF: WebMakers.com Added: Wholesaler - if an error no checkout
?>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
// WebMakers.com Added: Shipping Estimator
 if (SHOW_SHIPPING_ESTIMATOR=='true') {
 // always show shipping table
?>
     <tr>
       <td><?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?></td>
     </tr>
<?php
 } else {
// show only button for popup shipping
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td align="right">
         <a href="<?php echo 'shipping_estimator_popup.php'; ?>" onclick="NewWindow(this.href,'name','550','440','yes');return false;"><?php echo tep_image_button('button_shipping_estimator.gif','Shipping Estimator'); ?></a>
       </td>
     </tr>
<?php
 }
// WebMakers.com Added: Shipping Estimator
?>
<?php
 } else {
?>
     <tr>
       <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></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 align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
   </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'); ?>

Link to comment
Share on other sites

Gee I almost thought I was done and had almost forgotten about this tiny little problem... I still need to know exactly where to modify this code as I don't see it where it ought to be lol... plus since this post is so old my site has moved and is now Bluefin Traders so you can see what I mean there. Other site no longer exists. Thanks!

Link to comment
Share on other sites

Gee I almost thought I was done and had almost forgotten about this tiny little problem... I still need to know exactly where to modify this code as I don't see it where it ought to be lol... plus since this post is so old my site has moved and is now Bluefin Traders so you can see what I mean there. Other site no longer exists. Thanks!

 

Toward the bottom around line 460ish on yours look for

Between this

<?php
 }
?>

and this

<!-- body_text_eof //-->

add this

    </form></td>
   <tr>
    <td><br><?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?></td>
  </tr></table>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...