Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NO SHIPPING FOR DOWNLOADS


jonnyfilmboy

Recommended Posts

Posted

I've been looking forever for a way to get rid of the shipping costs for a download. Am I to believe that the original creators of OSC overlooked this?

 

Well, in any case, how do you do this? I downloaded and perfectly installed the Free_Shipping_Payment_v1 contribution, but like most of these contributions, it didn't work for me. I am running OSC 2.2 CVS.

 

Please help! This is really fricking annoying! And I am clearly not the only one asking about this...

Posted

I got my free shipping to work by using the table rate shipping as an option, and setting .10:0.00,5:18.50 and so on. With the download file I have the weight as .01 and if all the customer checks out withare downloads with a combined weight under .10 pound, a shipping fee doesn't even show up.

 

I am sure there is some other way, but this way worked for me.

 

Reminded me of the missionaries and canabals my instructor kept telling us about.....

Posted

This is an OK workaround. I went into the checkout_shipping.php and changed the shipping wording to exolain what to do if they are only downloading, and then I went into table.php in modules and changed the words "Table Rate" and "Best Way" to "Download Only" and "(no shipping)" respectively. I think this will make sense to customers. It still isn't as cool as just skipping the shipping screen if it is a download, but at least this works and doesn't screw up my whole catalog the way a lot of the contributions do.

 

Thank you.

Posted

I'm also looking to remove shipping all together... We're an ISP and sell web hosting, we want to use oscommerce to sell hosting and at the same time be able to demo the cart for customers. I can figure out how to remove the shipping & returns from the navigation but would like to completely eliminate the shipping checkout processes and display.

 

Any help on this would be excellent, I'm sure many people would like this maybe someone can do this as a contribution. As with my experience with carts this is an often desired result.

 

Regards

Posted

An interesting thing I just found,

 

all the Checkout buttons on my site point to checkout_payment.php, but if a payment method has not been selected yet, it appears to be redirected to checkout_shipping.php. Perhaps there is something in the code of checkout_payment.php that checks to see if shipping has been selected, and if so, perhaps it can be easily remarked out.

 

Just an idea.

Posted

I finally succeeded in getting the rid of that shipping part in the check out process. What I did:

 

Like jonnyfilmboy said, you've to change several links from checkout_shipping to checkout_payment. I did that in the shopping_cart page as well in the header page.

 

Next i changed the checkout_confirmation code. Because it checks first wheter a shipping module has been chosen.

 

the code i deleted :

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page

if (!tep_session_is_registered('shipping')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

 

This may also depends on your current shipping configuration. I turned everything off in the admin.

 

Next you have to change your checkout_bar, get rid og that shipping link and changes the referring image files.

 

Last but not least change the order confirmation e-mail. (I've not done that yet)

 

I hope it works for you to as it does for me.

 

WARNING: I did not check wheter this change cause security vulnaribilities or not.

Maybe someone can help us on that point.

 

 

Mark

Posted

The standard osCommerce package provides for "no shipping" on downloadable products.

 

Assuming you have set the product up as a valid download, oscommerce sets this product as a "virtual" product and will SKIP the shipping charges at checkout time. Of course if your customer orders other non-download products in the same cart then of course shipping will apply for those products.

 

HTH

Tom

Posted

OceanRanch, How? It doesn't seem to work for a ton of people out here! I have valid downloads and the program always goes straight to the shipping when I checkout, even when it is the only thing in the basket.

 

So if you know, how do you properly set up downloads to go straight to payment options? I have weight set to 0, the download works properly when all checked out (I can download it after checkout), I have downloads enabled. How does OsC know to set this as a "virtual product"???? Is it something I have to type in somewhere?

 

Believe me, I am not the only person out her having problems with this.

Posted

Hi Jon,

 

I downloaded and perfectly installed the Free_Shipping_Payment_v1 contribution, but like most of these contributions, it didn't work for me. I am running OSC 2.2 CVS.

 

The standard OSC 2.2 MS2 production release without contributions is working for many sites. Maybe the contribution you have installed on top of the "development" CVS version is causing problems?

 

I looked at the code in checkout_shipping.php just as you did and can't see anything off the top that would cause shipping page to come up if product is "virtual".

 

The redirect is pointing to an SSL link so I assume you have to have SSL enabled?

 

Also, there is a check for customer's default shipping address, maybe that isn't set and could be an issue here?

 

Also, I wonder if you have to have at least 1 shipping option enabled?

 

I've verified that the standard osCommerce DOES bypass shipping when all the stars line up properly. Unfortunately, something in your configuration or code is preventing the bypass from occurring.

 

Sorry, I don't have an answer for you. If it was on my site I'd sprinkle some debug errorlog statements into the checkout_shipping.php to see why its not taking the tep_redirect route to the payment screen.

 

Tom

Posted

Thanks for the reply but I deleted the contribution when it didn't work and I couldnt get any support from it in the forums. So now I am just running a pure CVS version with no contribs.

 

I do have a default mailing address enabled (thought that should not matter for a DL), and I do have at least 1 option for shipping (I have two).

 

I don't have SSL enabled yet. Perhaps that is part of the problem. I wish this worked though. Perhaps it just doesn't work on CVS. But I can't change over to MS2 because lunarpages.com, my host, controls what I can and can't use on my site. Ug.

 

Anyway, the workaround described earlier has been working for me. It is a little convoluted, but suits my needs and won't be too much of a hassle for users to figure out.

  • 3 weeks later...
Posted

After following WIKI documentation for downloads, setting weight to "0", download attributes, and searching through the forums, it still didn't work for me. I also wanted to streamline the checkout process, since the majority of my customers would be creating a new account, I don't need addresses, shipping, or payment since all transactions would be handled through PayPal.

 

Instead of clicking:

CHECKOUT>>LOGIN>>CREATE NEW ACCOUNT>>NEW ACCOUNT SUCCESS>>SHIPPING>>PAYMENT>>CONFIRMATION>>PAYPAL

 

I wanted customers to only have to click:

CHECKOUT>>CREATE NEW ACCOUNT>>CONFIRMATION>>PAYPAL

 

I changed the links at the bottom of shoppingcart.php and header.php to redirect checkout to checkout_confirmation.php instead of checkout_shipping.php

 

I made United States the default country in create_account.php (per WIKI) and commented out all references to address.

 

Then I changed checkout_confirmation.php to include default definitions for shipping and payment:

 

//3.8.2004 added definitions to skip shipping and payment screens
   $sendto = false;
   $billto = $customer_default_address_id;

 

and I made a new layout for the screen that removed the option to edit shipping/payment and only displayed the customer's name and email, and removed the checkout status bar at the bottom:

 

<?php
/*
 $Id: checkout_confirmation.php,v 1.139 2003/06/11 17:34:53 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// if the customer is not logged on, redirect them to the login page
// 3.8.2004 changed redirection to create account instead of login
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CREATE_ACCOUNT));
   tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, '', '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));
 }


// avoid hack attempts during the checkout procedure by checking the internal cartID
 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
   if ($cart->cartID != $cartID) {
     tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
   }
 }

//3.8.2004 removed for virtual products
// if no shipping method has been selected, redirect the customer to the shipping method selection page
//  if (!tep_session_is_registered('shipping')) {
//    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
//  }

//3.7.2004 removed and defined to PayPal on next comment
//  if (!tep_session_is_registered('payment')) tep_session_register('payment');
//  if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];

//  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']);
//  }

// load the selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
//3.7.2004 changed to define PayPal as only payment method
//  $payment_modules = new payment($payment);
   $payment_modules = new payment(paypal);

//3.8.2004 added definitions to skip shipping and payment screens
   $sendto = false;
   $billto = $customer_default_address_id;

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

 $payment_modules->update_status();

 if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
 }

 if (is_array($payment_modules->modules)) {
   $payment_modules->pre_confirmation_check();
 }

// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

// Stock Check
 $any_out_of_stock = false;
 if (STOCK_CHECK == 'true') {
   for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
     if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
       $any_out_of_stock = true;
     }
   }
   // Out of Stock
   if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {
     tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
   }
 }

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

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2);
?>
<!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">
</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"><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_confirmation.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="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
<?php
 if ($sendto != false) {
?>
           <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
             </tr>
<?php
   if ($order->info['shipping_method']) {
?>
             <tr>
               <td class="main"><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo $order->info['shipping_method']; ?></td>
             </tr>
<?php
   }
?>
           </table></td>
<?php
 }
?>
           <td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (sizeof($order->info['tax_groups']) > 1) {
?>
                 <tr>
                   <td class="main" colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
                   <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
                   <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
                 </tr>
<?php
 } else {
?>
                 <tr>
                   <td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
                 </tr>
<?php
 }

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
   echo '          <tr>' . "\n" .
        '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
        '            <td class="main" valign="top">' . $order->products[$i]['name'];

   if (STOCK_CHECK == 'true') {
     echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
   }

   if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
     }
   }

   echo '</td>' . "\n";

   if (sizeof($order->info['tax_groups']) > 1) echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";

   echo '            <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
        '          </tr>' . "\n";
 }
?>
               </table></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>

     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><B>Contact Information</B></td>
             </tr>
             <tr>
               <td class="main"><B>Name:</B> <?php echo $order->customer['firstname']; ?> <?php echo $order->customer['lastname']; ?> <b>Email Address:</B> <?php echo $order->customer['email_address']; ?></td>
             </tr>
             <tr>
               <td class="main"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b>'; ?></td>
             </tr>
             <tr>
               <td class="main"><B><?php echo $order->info['payment_method']; ?></B>:  <I>Payment will be processed by PayPal.  Upon successful completion of payment, you will receive an email providing you with a direct link for download. To view the status of your purchase at any time, click on "My Account".</i>
               </td>
             </tr>
           </table></td>
           </tr>
           <tr class="infoBoxContents">
           <td valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2">
<?php
 if (MODULE_ORDER_TOTAL_INSTALLED) {
   $order_total_modules->process();
   echo $order_total_modules->output();
 }
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 if (is_array($payment_modules->modules)) {
   if ($confirmation = $payment_modules->confirmation()) {
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></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" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
             </tr>
<?php
     for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
?>
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
             </tr>
<?php
     }
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
   }
 }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if (tep_not_null($order->info['comments'])) {
?>
     <tr>
       <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></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 class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td>
             </tr>
           </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="0">
         <tr>
           <td align="right" class="main">
<?php
 if (isset($$payment->form_action_url)) {
   $form_action_url = $$payment->form_action_url;
 } else {
   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
 }

 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

 if (is_array($payment_modules->modules)) {
   echo $payment_modules->process_button();
 }

 echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
?>
           </td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

   </table></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'); ?>

 

 

So far, it's working. There were some other changes I made at first based on other forum threads that didn't work, but I can't remember each step anymore. I know I'll need to update other files still, but I think I might be on the right track. Any additional suggestions/advice would be appreciated.

Posted

The only suggestion I would make would be to follow this route:

 

CHECKOUT>>LOGIN>>CREATE NEW ACCOUNT>>NEW ACCOUNT SUCCESS>>CONFIRMATION>>PAYPAL

 

because people often times will go through the checkout process and then stop before finishing, just to see what is involved. They want to see what info they have to give, etc. If you give them that confirmation of WHAT exactly they are purchasing, and some info that they will now be brought to the PayPal area, they will not get freaked out or confused if suddenly they are in the PayPal area. Know what I mean? People purchasing from a company that they don't know will need to be reassured.

 

Alternatively, I would lay out the whole checkout procedure for people in a "Checkout" page in the Information infobox. I added some additional pages to that part of my store and I think it is helpful (if people actually read that stuff).

 

Good luck with your store!

  • 1 year later...
Posted
I've been looking forever for a way to get rid of the shipping costs for a download.  Am I to believe that the original creators of OSC overlooked this?

...

 

More than a year has passed since last post in this thread, so perhaps someone can describe a solution for a newbie with little knowledge of PHP.

 

I want downloads to have no shipping cost, and shippables to have a flat $6 rate, because of how UPS and USPS rate tables break, plus my willingness to absorb cost increments past a minimum total value of order.

 

This is the closest thread I have found so far in forum searches.

 

I tried having 2 copies of flat.php, namely flatdl.php and flatsh.php, but got a fatal error

"Cannot redeclare class flat in /...../catalog/includes/modules/shipping/flatdl.php on line 13".

Changing FLAT to FLATDL or FLATSH inside the *.php did not help.

 

Any direct or trick/workaround solution would be greatly appreciated.

Posted

Zero weight and the fact that it is a "virtual" (i.e. download is setup), shipping costs should be skipped.

 

Tom

Archived

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

×
×
  • Create New...