Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[Contribution] Ship In Cart


615 replies to this topic

#421 katiediddesign

  • Community Member
  • 59 posts
  • Real Name:KatieDid Design

Posted 18 March 2005, 19:37

Squiggie, on Mar 18 2005, 06:54 PM, said:

>WHERE in the world is this in Admin

In admin > configuration > "click" shopping cart. then you will see the options for this. I was confused for a bit to.

good luck

<{POST_SNAPBACK}>



??? Still confused... in my versin of Admin, there isn't any "shopping cart" to click on! I even did a browser "Search" on the page... not there! It must be renamed something else in my version... where is this link? Is it in the context menu on the left that shows up when you are in "Configuration" or is it in the main section of the page?

#422 TCwho

  • Community Member
  • 732 posts
  • Real Name:Danny

Posted 20 March 2005, 14:30

Squiggie, on Mar 16 2005, 05:12 PM, said:

Hi All,

I had installed:

4 Jul 2004 - Ship In Cart v2.00
7 Jul 2004 - Fix for v2.0 and all other versions

Obviously this will now only work if the customer is logged in. I would like it to work when the customer does NOT have an account.

Can anyone tell me what I need to change to get it to work without having an account?

<{POST_SNAPBACK}>



read my post from previous page...
Do NOT Apply:
7 Jul 2004 - Fix for v2.0 and all other versions Author: Acheron

Then it will show shipping for Guest as well

#423 TCwho

  • Community Member
  • 732 posts
  • Real Name:Danny

Posted 20 March 2005, 14:31

katiediddesign, on Mar 18 2005, 02:37 PM, said:

??? Still confused... in my versin of Admin, there isn't any "shopping cart" to click on!  I even did a browser "Search" on the page... not there!  It must be renamed something else in my version... where is this link?  Is it in the context menu on the left that shows up when you are in "Configuration" or is it in the main section of the page?

<{POST_SNAPBACK}>



From Administration>>Click on 'Configuration'>>Click on 'Shopping Cart'

#424 katiediddesign

  • Community Member
  • 59 posts
  • Real Name:KatieDid Design

Posted 20 March 2005, 21:15

TCwho, on Mar 20 2005, 02:31 PM, said:

From Administration>>Click on 'Configuration'>>Click on 'Shopping Cart'

<{POST_SNAPBACK}>



Like I said, there isn't any "Shopping Cart" to click on in mine!!! Not on the menu that appears underneath the word "Configuration" and not in the main section either! I even did a browser search with Ctrl-F and it can't find it!

These are the links on the left after I click on "Configuration":
My Store
Minimum Values
Maximum Values
Images
Customer Details
Shipping/Packaging
Product Listing
Stock
Logging
Cache
E-Mail Options
Download
GZip Compression
Sessions

And this is what's in the middle after I click on Configuration:
Store Name R'n'Ksports.com
Store Owner Steven Peters Retail
E-Mail Address root@localhost
E-Mail From osCommerce <root@localhost>
Country United States
Zone Florida
Expected Sort Order desc
Expected Sort Field date_expected
Switch To Default Language Currency false
Send Extra Order Emails To
Use Search-Engine Safe URLs (still in development) false
Display Cart After Adding Product true
Allow Guest To Tell A Friend true
Default Search Operator and
Store Address and Phone Store Name Address Country Phone
Show Category Counts false
Tax Decimal Places 2
Display Prices with Tax false

Do you see any "Shopping Cart" there?

#425 TCwho

  • Community Member
  • 732 posts
  • Real Name:Danny

Posted 21 March 2005, 07:06

then you need to go back and check what you have done..... my first guess would be you forgot to add the shopping cart link...

#426 katiediddesign

  • Community Member
  • 59 posts
  • Real Name:KatieDid Design

Posted 21 March 2005, 13:34

Well... I'll update anyone who might be following this thread.

First... I came to the conclusion that this shopping cart link must be added by a version of Ship in Cart that I don't have. I'm running a mix of 1.7 & 1.83.

Second... I guess it doesn't matter because I solved my problem! There are too many pages on this thread, or I would have found it earlier... but back on one of the pages in this thread, someone posted that my issue (which someone else had) had already been covered (which I couldn't find), but thankfully, they posted the fix as well! Basically, the error I was getting was being caused by my mulitple test accounts... my browser was confusing the session ids. The fix is to add this line of code to logoff.php, so that my browser only uses one at a time:
  // added to fix ship in cart oscsid problem...
 tep_session_unregister('cart_address_id');

So... my Ship in Cart (which is really Shipping Estimate Out of Cart for me, since I've got it on a new page)... is working just about perfect! USPS quotes aren't being pulled for me yet, but they aren't working at all, and I just tried installing it last night, so I'm assuming that once I figure out what's wrong with my installation, it will work both during checkout and in my Shipping Estimate.

In case anyone is wondering... no, it doesn't seem possible to make the shipping estimate a pop-up. (I couldn't get it to work in the pop-up, even with the identical code I've got working now.) ... but it is possible to make it a different screen. The steps that I followed, to the best of my knowledge are here, for anyone they may help. Please note that I still know very little PHP and probably can't help anyone out, if this doesn't work for them. I'm just posting it for whomever it does help. If anyone wants to see mine in action, here's a link to a current test product:
Paintball gun
Just put it in your cart, and you'll see the link appear. Click on it and you'll see.

1) Get a working version of Ship in Cart, and it's shipping_estimator.php box. I'm using a mix of 1.7 & 1.83. I was having a problem with 1.7 not working for guests, and 1.83's "update" button not working... and I probably didn't "mix" them right... I just finally got it to work so I'm leaving it be.

2) Follow the Knowledge Base's instructions for creating a new page... I called it shipping_estimate.php. Here's the link:
Adding a New Page

3) In your new page, find:
<?php echo TEXT_INFORMATION; ?>
And insert the shipping_estimator code immediately after:
<?php echo TEXT_INFORMATION; ?>
<?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?>

This inserts the shipping_estimator into your new page. Modify the components of it as needed... I took out the totals, and I also took out the select links, so mine just gives a quote. It took some code searching to find and take out those table cells, but I managed it.

4) Open up the shipping_estimator.php and find this code:
$ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_ ... )

(I think that the default is FILENAME_SHOPPING_CART)

Now change that to the filename of your new page... the same that you chose in your #2 steps for creating a new page... in my example, FILENAME_SHIPPING_ESTIMATE.

5) Open up includes/boxes/shopping_cart.php and look for this bit of code near the bottom:
                                 'text' => $currencies->format($cart->show_total()));
  }

Now replace it with this:
                                 'text' => 'Sub-Total:&nbsp;&nbsp;' . $currencies->format($cart->show_total()) );

// adding links for Estimate Shipping, View/Edit Cart, & Checkout

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

    $info_box_contents[] = array('align' => 'right',
                                 'text' => '<img src="../c/images/left_arrow.gif" width="12" height="12" border="0"><a href="' . tep_href_link(FILENAME_SHIPPING_ESTIMATE, '', 'NONSSL') . '">' . BOX_SHIPPING_ESTIMATE . '</a>'

                                           . '<br><img src="../c/images/left_arrow.gif" width="12" height="12" border="0"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . HEADER_TITLE_CART_CONTENTS . '</a>'

                                           . '<br><img src="../c/images/left_arrow.gif" width="12" height="12" border="0"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'NONSSL') . '">' . HEADER_TITLE_CHECKOUT . '</a>'
                                                );
  }

This adds another line under the Subtotal, and then adds my three links, Estimate Shipping, View/Edit Cart, & Checkout along with my little arrow gif. Feel free to download it and use it if you want... if not, take it out of the code. The image is here if you want to download it and upload it to your images directory:
my little arrow All three only appear when there are items in the shopping cart. If you only want the Estimate Shipping link, then just delete the code for the other two... they're divided up into their three sections. above.

6 - Open up logoff.php and add this code... I added it near the top with the other defines:
  // added to fix ship in cart oscsid problem...
 tep_session_unregister('cart_address_id');


Hope this helps someone!

#427 PropioWeb

  • Community Member
  • 307 posts
  • Real Name:Doh!!!
  • Location:Holyoke, MA USA

Posted 03 May 2005, 19:10

For some odd reason I cannot get any version of this contribution to work. In any way shape or form. I'm running MS2.2 with BTS1.7. I'm not sure but I think it might have something to do with the Basic Template Structre contribution. But what I can't figure out is why that would be a problem, but it's my only theory.

Has anybody else goteen this to work together with BTS?
Samuel Mateo, Jr.
osC 2.2 MS2
Installed Mods:
WYSIWYG HTMLArea 1.7 | Basic Template System 1.0 | osC-Affiliate | OSC-SupportTicket
Featured Products 1.3 | LoginBox 5.2 | LatestNews 1.1.3 | Extras for IE

#428 osjunkie

  • Community Member
  • 226 posts
  • Real Name:Brad Thompson
  • Location:Winnipeg, Canada

Posted 20 May 2005, 21:09

Tax not calculating for non-registered users

When you do an estimate the tax isn't being calculated for a non-registered user.

Registered users work no problem.

Anyone know how to fix this?

Running MS2 with the MS2 shipping estimate.

<?php
/*
  $Id: shipping_estimator.php,v 2.00 2004/07/01 15:16:07 eml Exp $

  v2.00 by Acheron
  (see Install.txt for partial version history)

  Copyright (c) 2004

  Released under the GNU General Public License
*/
?>
<!-- shipping_estimator //-->
<script language="JavaScript">
  function shipincart_submit(sid){
    if(sid){
      document.estimator.sid.value=sid;
    }
    document.estimator.submit();
    return false;
  }
</script>
              <table align="center"><tr valign="top"><td>

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

  require(DIR_WS_LANGUAGES . $language . '/modules/' . FILENAME_SHIPPING_ESTIMATOR);

  // 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');
      // set shipping to null ! multipickup changes address to store address...
      $shipping='';
      // 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'],
//add state zone_id
                                 'zone_id' => $HTTP_POST_VARS['state'],
                                 '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');
//add state zone_id
        $cart_zone = $HTTP_POST_VARS['zone_id'];
        tep_session_register('cart_zone');
        $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');
        $country_info = tep_get_countries(STORE_COUNTRY,true);
        tep_session_register('cart_zip_code');
        $order->delivery = array(//'postcode' => '',
                                 '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 calculate free shipping
      $order->info = array('total' => $cart->show_total(), // TAX ????
                           'currency' => $currency,
                           'currency_value'=> $currencies->currencies[$currency]['value']);
    }
// 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();
    $order->info['subtotal'] = $cart->total;

// set selections for displaying
    $selected_country = $order->delivery['country']['id'];
    $selected_address = $sendto;
  //}
// eo shipping cost

  // 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;
  }
  // begin shipping cost
  if(!$free_shipping && $cart->get_content_type() !== 'virtual'){
    if (tep_not_null($HTTP_POST_VARS['sid'])){
      list($module, $method) = explode('_', $HTTP_POST_VARS['sid']);
      $cart_sid = $HTTP_POST_VARS['sid'];
      tep_session_register('cart_sid');
    }elseif (tep_session_is_registered('cart_sid')){
      list($module, $method) = explode('_', $cart_sid);
    }else{
      $module="";
      $method="";
    }
    if (tep_not_null($module)){
      $selected_quote = $shipping_modules->quote($method, $module);
      if($selected_quote[0]['error'] || !tep_not_null($selected_quote[0]['methods'][0]['cost'])){
        $selected_shipping = $shipping_modules->cheapest();
        $order->info['shipping_method'] = $selected_shipping['title'];
        $order->info['shipping_cost'] = $selected_shipping['cost'];
        $order->info['total']+= $selected_shipping['cost'];
      }else{
        $order->info['shipping_method'] = $selected_quote[0]['module'].' ('.$selected_quote[0]['methods'][0]['title'].')';
        $order->info['shipping_cost'] = $selected_quote[0]['methods'][0]['cost'];
        $order->info['total']+= $selected_quote[0]['methods'][0]['cost'];
        $selected_shipping['title'] = $order->info['shipping_method'];
        $selected_shipping['cost'] = $order->info['shipping_cost'];
        $selected_shipping['id'] = $selected_quote[0]['id'].'_'.$selected_quote[0]['methods'][0]['id'];
      }
    }else{
      $selected_shipping = $shipping_modules->cheapest();
      $order->info['shipping_method'] = $selected_shipping['title'];
      $order->info['shipping_cost'] = $selected_shipping['cost'];
      $order->info['total']+= $selected_shipping['cost'];
    }
  }
// virtual products use free shipping
  if($cart->get_content_type() == 'virtual') {
    $order->info['shipping_method'] = CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS;
    $order->info['shipping_cost'] = 0;
  }
  if($free_shipping) {
    $order->info['shipping_method'] = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
    $order->info['shipping_cost'] = 0;
  }
  $shipping=$selected_shipping;
// end of shipping cost
// end free shipping based on order total

  $info_box_contents = array();
  $info_box_contents[] = array('text' => CART_SHIPPING_OPTIONS);
  new infoBoxHeading($info_box_contents, false, false);

  $ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
  $ShipTxt.=tep_draw_hidden_field('sid', $selected_shipping['id']);
  $ShipTxt.='<table>';
  if(sizeof($quotes)) {
    if (tep_session_is_registered('customer_id')) {
      // logged in

  if (CARTSHIP_SHOWWT == 'true') {
    $showweight = '&nbsp;(' . $total_weight . '&nbsp;' . CARTSHIP_WTUNIT . ')';
  } else {
    $showweight = '';
  }

        if(CARTSHIP_SHOWIC == 'true'){
      $ShipTxt.='<tr><td class="main">' . ($total_count == 1 ? ' <b>Item:</b></td><td colspan="2" class="main">' : ' <b>Items:</b></td><td colspan="2" class="main">') . $total_count . $showweight . '</td></tr>';
       }
      $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 . "'");
      // only display addresses if more than 1
      if (tep_db_num_rows($addresses_query) > 1){
        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>' .
                  CART_SHIPPING_METHOD_ADDRESS .'&nbsp;'. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit(\'\');"').'</td></tr>';
      }
      $ShipTxt.='<tr valign="top"><td class="main"><b>' . CART_SHIPPING_METHOD_TO .'</b>&nbsp;</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(CART_SHIPPING_OPTIONS_LOGIN);

        if(CARTSHIP_SHOWIC == 'true'){
      $ShipTxt.='<tr><td class="main">' . ($total_count == 1 ? ' <b>Item:</b></td><td colspan="2" class="main">' : ' <b>Items:</b></td><td colspan="2" class="main">') . $total_count . $showweight . '</td></tr>';
       }

      if($cart->get_content_type() != 'virtual'){

        if(CARTSHIP_SHOWCDD == 'true'){
        $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
                  ENTRY_COUNTRY .'&nbsp;'. tep_get_country_list('country_id', $selected_country,'style="width=200"');
        }

//add state zone_id
        $state_array[] = array('id' => '', 'text' => 'Please Select');
        $state_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '$selected_country' order by zone_country_id DESC, zone_name");
        while ($state_values = tep_db_fetch_array($state_query)) {
          $state_array[] = array('id' => $state_values['zone_id'],
                                 'text' => $state_values['zone_name']);
        }

        if(CARTSHIP_SHOWSDD == 'true'){
         $ShipTxt.=' &nbsp;' .ENTRY_STATE .'&nbsp;'. tep_draw_pull_down_menu('state',$state_array);
        }

        if(CARTSHIP_SHOWZDD == 'true'){
          $ShipTxt.='&nbsp;'.ENTRY_POST_CODE .'&nbsp;'. tep_draw_input_field('zip_code', $selected_zip, 'size="5"');
        }
//        $ShipTxt.='&nbsp;<a href="_" onclick="return shipincart_submit(\'\');">'.CART_SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';

        if(CARTSHIP_SHOWUB == 'true'){
$ShipTxt.='&nbsp;<td><a href="_" onclick="return shipincart_submit(\'\');">'. tep_image_button('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART) . ' </a></td></td></tr>';
        }
        }
    }
    if($cart->get_content_type() == 'virtual'){
      // virtual product-download
      //$ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
      $ShipTxt.='<tr><td class="main" colspan="3">&nbsp;</td></tr><tr><td class="main" colspan="3"><i>' . CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS . '</i></td></tr>';
    }elseif ($free_shipping==1) {
      // order $total is free
      //$ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
      $ShipTxt.='<tr><td class="main" colspan="3">&nbsp;</td></tr><tr><td class="main" colspan="3"><i>' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</i></td><td>&nbsp;</td></tr>';
    }else{
      // shipping display
      $ShipTxt.='<tr><td colspan="3" class="main">&nbsp;</td></tr><tr><td class="main"><b>' . CART_SHIPPING_CARRIER_TEXT . '</b></td><td class="main" align="left"><b>' . CART_SHIPPING_METHOD_TEXT . '</b></td><td class="main" align="right"><b>' . CART_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'].'&nbsp;&nbsp;&nbsp;</td>';
          if($quotes[$i]['error']){
            $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
            $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
          }else{
            if($selected_shipping['id'] == $thisquoteid){
              $ShipTxt.='<td class="main"><a title="Select this method" href="_"  onclick="return shipincart_submit(\''.$thisquoteid.'\');"><b>'.$quotes[$i]['module'].'&nbsp;';
              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</b></a>&nbsp;&nbsp;&nbsp;</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"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'.$quotes[$i]['module'].'&nbsp;';
              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</a>&nbsp;&nbsp;&nbsp;</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'].'&nbsp;&nbsp;&nbsp;</td>';
            if($quotes[$i]['error']){
              $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
              $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
            }else{
              if($selected_shipping['id'] == $thisquoteid){
                $ShipTxt.='<td class="main"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');"><b>'.$quotes[$i]['module'].'&nbsp;';
                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</b></a>&nbsp;&nbsp;&nbsp;</td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td><td class="main">'.tep_image(DIR_WS_ICONS . 'selected.gif', 'Selected').'</td></tr>';
              }else{
                $ShipTxt.='<td class="main"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'.$quotes[$i]['module'].'&nbsp;';
                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</a>&nbsp;&nbsp;&nbsp;</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td><td class="main">&nbsp;</td></tr>';
              }
            }
          }
        }
      }
    }
  }
  $ShipTxt.= '</table></form>';

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

  if (CARTSHIP_SHOWOT == 'true'){
    // BOF get taxes if not logged in
    if (!tep_session_is_registered('customer_id')){
      $products = $cart->get_products();
      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
        $products_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $order->delivery['country_id'],$order->delivery['zone_id']);
        $products_tax_description = tep_get_tax_description($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']);
        if (DISPLAY_PRICE_WITH_TAX == 'true') {
         //Modified by Strider 42 to correct the tax calculation when a customer is not logged in
         // $tax_val = ($products[$i]['final_price']-(($products[$i]['final_price']*100)/(100+$products_tax)))*$products[$i]['quantity'];
          $tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity'];
        } else {
          $tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity'];
        }
        $order->info['tax'] += $tax_val;
        $order->info['tax_groups']["$products_tax_description"] += $tax_val;
        // Modified by Strider 42 to correct the order total figure when shop displays prices with tax
        if (DISPLAY_PRICE_WITH_TAX == 'true') {
           $order->info['total'];
        } else {
        $order->info['total']+=$tax_val;
               }
      }
    }
    // EOF get taxes if not logged in (seems like less code than in order class)
    require(DIR_WS_CLASSES . 'order_total.php');
    $order_total_modules = new order_total;
    //echo '</td><td align="right">';
    // order total code
    $order_total_modules->process();

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

    new infoBoxHeading($info_box_contents, false, false);
    $otTxt='<table align="right">';
    $otTxt.=$order_total_modules->output().'</table>';

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

    new infoBox($info_box_contents);
  }
} // Use only when cart_contents > 0
?>
             </td></tr></table>

After this is fixed it should be posted on the contribution download site.

#429 AverageJoe

  • Community Member
  • 129 posts
  • Real Name:Just your average guy

Posted 28 June 2005, 02:09

Hi all,
Installed this mod and it works great. Just two questions:

1. The "Delivery Methods" title is aligned right even though I have it set aligned left in the php file. Is there any way to get the methods title aligned to the left of the infobox?

2. I've tried using just the UPS module, and just the USPS module, and both seem to take VERY long (10-20 seconds) to load (happens on the shipping page when someone checks out too). Is there any way for the shipping estimate to not contact the shipper's website until the person inputs their zip code and hits update? Right now, even when someone firsts adds something to their cart, the shipping estimator will contact either UPS or USPS, but not display anything since it doesn't send a zip code. If I change my shipping methods to something static (zones for instance), everything is very fast.

Any help would be greatly appreciated. Thanks :)

#430 AverageJoe

  • Community Member
  • 129 posts
  • Real Name:Just your average guy

Posted 28 June 2005, 02:41

Ah, figured out the answer to #1 above. Would really appreciate any help for #2 above. Thanks.

#431 mids1999

  • Community Member
  • 51 posts
  • Real Name:Michael

Posted 05 July 2005, 23:00

I am having a problem with some of my larger items where the item is being split into two boxes even though the item is impossible to split. This is only happening where the totals are displayed.

This is also causing the shipping estimate in the total to appear as double. For example rate on top is 10 the rate on the bottom is shown as 20.

When customer gets to checkout confirmation the proper rate is cxomming up.

This only happens with my UPS module.
I am using UPS XML with dimensions and insurance enabled.

Any help would be greatly appriciated.

#432 MJones

  • Community Member
  • 17 posts
  • Real Name:Monty Jones

Posted 06 July 2005, 17:35

I still can't get it to work! I set it to display the country, zip code and the update button. when I put in a zip code and hit the button, it goes to http://mystore.com/_ and that's it. If I remove the button option and just hit the return key, it reloads the shopping cart and shows no shipping options and the zip code is not passed to the <input> field (it is empty).

This feature is key, because people don't want to have to create an account just to see shipping rates for a product. Are there any other contributions that could replace this one???

#433 MJones

  • Community Member
  • 17 posts
  • Real Name:Monty Jones

Posted 07 July 2005, 02:44

OK, I settled for the visitor having an account set-up in order for them to see the shipping estimate(s). I also had a fellow programmer (willross) add the estimate box with the "...you must log in, etc." inside it and added a link to 'login.php' so it looks nicer. Thanks willross!!!

#434 Enzo_UK

  • Community Member
  • 177 posts
  • Real Name:Andrew Ensom
  • Gender:Male

Posted 07 July 2005, 21:33

I desperately want to install this contribution, but thought I better check what configuration_id's are allready in use, and its allready using 221-226 for the zone based shipping rates I have set up.

What can I do about this?

If I run the SQL that comes with the contribution will it just write over the existing configuration_id's or will it assign new ones?

I am not really all that hot with using phpMyAdmin, I can just about get by, and run SQL on there, but thats about it.

Any help is greatly appreciated.

#435 MJones

  • Community Member
  • 17 posts
  • Real Name:Monty Jones

Posted 07 July 2005, 22:10

Go into the sql file and change the numbers. As far as the overwrite, if you use phpMyAdmin it will give you a warning first.

#436 kitchenniche

  • Community Member
  • 431 posts
  • Real Name:Sandra
  • Location:Kelowna, Beautiful British Columbia, Canada

Posted 09 July 2005, 18:36

Hi,

The shipping options are not listed on my page while using this contribution.
If you want to check it, here's My Site

Does someone have the same problem or does someone have a solution for that???

Any little help is greatly appreciated!

Thanks in advance

Sandra
HIM - Dark Light - Out on 26/09/05

#437 kitchenniche

  • Community Member
  • 431 posts
  • Real Name:Sandra
  • Location:Kelowna, Beautiful British Columbia, Canada

Posted 09 July 2005, 19:41

kitchenniche, on Jul 9 2005, 10:36 AM, said:

Hi,

The shipping options are not listed on my page while using this contribution.
If you want to check it, here's My Site

Does someone have the same problem or does someone have a solution for that???

Any little help is greatly appreciated!

Thanks in advance

Sandra

<{POST_SNAPBACK}>


I forgot something:

If i am logged in, it works perfectly.
HIM - Dark Light - Out on 26/09/05

#438 kitchenniche

  • Community Member
  • 431 posts
  • Real Name:Sandra
  • Location:Kelowna, Beautiful British Columbia, Canada

Posted 10 July 2005, 15:11

Not working yet... :(
HIM - Dark Light - Out on 26/09/05

#439 shaunklink

  • Community Member
  • 180 posts
  • Real Name:Shaun Rowe
  • Location:Chicago

Posted 15 July 2005, 21:07

whew, lots of threads here!

Anyways I couldn't find the answer to these questions.

First when the user is not logged in and goes to the shopping cart for the first time the ship in cart estimator is not using the store's home location as the default base price. I would like it to do this while also putting in the stores zip code into the zip code field.

Second, does anyone have any good tips on formatting the way this thing looks? There are so many table calls! it's real hard to remove a <TD> tag or reduce the width of the box. Plus it looks different across platforms/browsers (mac/pc/IE/safari/netscape/etc).

BTW I'm using STS. Everything seems to work ok other then this problem.

Thanks!

#440 Enzo_UK

  • Community Member
  • 177 posts
  • Real Name:Andrew Ensom
  • Gender:Male

Posted 28 July 2005, 21:48

I have installed this contrib, and is working, but get this at the bottom of all the pages after somthing has been added to the cart.....

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /vhost/vhost2/p/o/r/urlremoved.co.uk/www/includes/functions/sessions.php on line 197

Anyone got any ideas?

Is it anything to do with the fact I am saving sessions to file, rather than to the DB?

I have this contrib running on another site with no problems at all.