Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free Shipping plus other Ship methods + UPS


Recommended Posts

Frankly, the contribution is a great idea: Free Shipping, but allows other, expedited methods to be selected by the customer. However, it seems to be geared for USPS and not UPS as far as I can figure.

 

Installation:

 

Installed asage1's August 2, and then August 5 contribution from http://www.oscommerce.com/community/contri...h,free+shipping. It is a single checkout-shipping.php file to be put into /catalog/. osC version 2 MS2. Working with STS_Templates...

 

Free Shipping is on and set to $149.00

Shipping is set to UPS, only.

Payment module is Authorize.net (Consolidated for AIM)

 

Problem:

 

On checkout_shipping.php, UPS shows and works. clicking on the radio buttons under UPS brings the visitor to the next step, checkout_payment.php.

 

Free shipping also shows, however, clicking on that radio button brings the user back to shipping without error.

 

I'm not sure what is happening to send it back. Is it a validation in checkout_shipping, checkout_payment?

 

The expected http submission expected has been changed from 'free_free' in:

 

  if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }

   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
     if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
       $shipping = $HTTP_POST_VARS['shipping'];

       list($module, $method) = explode('_', $shipping);
       if ( is_object($$module) || ($shipping == 'free_free') ) {
         if ($shipping == 'free_free') {
           $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
           $quote[0]['methods'][0]['cost'] = '0';
         } else {
           $quote = $shipping_modules->quote($method, $module);
         }
         if (isset($quote['error'])) {
           tep_session_unregister('shipping');
         } else {
           if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
             $shipping = array('id' => $shipping,
                               'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                               'cost' => $quote[0]['methods'][0]['cost']);

             tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
           }
         }
       } else {
         tep_session_unregister('shipping');
       }
     }
   } else {
     $shipping = false;
               
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }    
 }

 

To 'usps_free' in asage's version:

 

// process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {

   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }

   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');


   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
     if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
       $shipping = $HTTP_POST_VARS['shipping'];


       list($module, $method) = explode('_', $shipping);
       if ( is_object($$module) || ($shipping == 'usps_free') ) {
         if ($shipping == 'usps_free') {
           $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
           $quote[0]['methods'][0]['cost'] = '0';
         } else {
           $quote = $shipping_modules->quote($method, $module);
         }
         if (isset($quote['error'])) {
           tep_session_unregister('shipping');
         } else {
           if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
             $shipping = array('id' => $shipping,
                               'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                               'cost' => $quote[0]['methods'][0]['cost']);
             tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
           }
         }
       } else {
         tep_session_unregister('shipping');
       }
     }
   } else {
     $shipping = false;
               
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }    
 }

 

But, I can't figure out where that is constructed. In the html page, itself, the source code shows the lines:

 

 <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 5)">
                   <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
                   <td class="main" width="75%">Free (UPS Ground) shipping for orders over $149.00</td>
                   <td class="main">$0.00</td>
                   <td class="main" align="right"><input type="radio" name="shipping" value="_free" CHECKED></td>
                   <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>

 

As opposed to the UPS lines above, which show 'ups' before whatever the shipping type is. e.g.:

 

<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 4)">
                   <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
                   <td class="main" width="75%">Ground</td>
                   <td class="main">$7.62</td>
                   <td class="main" align="right"><input type="radio" name="shipping" value="ups_GND"></td>
                   <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
                 </tr>

 

I'm stuck and cannot figure this out. I'd love some help, or insight as this is one of the very last things holding the process up. You can see the page in action by going to http://cutratebatteries.com/catalog and checking out with $149.00 in products (it's in test mode, so authorize won't charge you if you manage to go that far) ;)

 

Thank you very much.

Link to comment
Share on other sites

  • 1 month later...

Tabula - I have this same issue and have searching around for an answer for a couple of days. Would you please let me know via PM or another post if you find an answer to this. Its holding me up also.

 

Thanks. (I'll do the same for you)

 

Rick

Link to comment
Share on other sites

There's still no response on this issues and my attempt at a hack actually doesn't work, as it causes the alternative shipping to be equal to $0.00 even after selecting a different shipping method.

 

Did you ever solve this?

 

Tabula - I have this same issue and have searching around for an answer for a couple of days.  Would you please let me know via PM or another post if you find an answer to this.  Its holding me up also.

 

Thanks.  (I'll do the same for you)

 

Rick

Link to comment
Share on other sites

There's still no response on this issues and my attempt at a hack actually doesn't work, as it causes the alternative shipping to be equal to $0.00 even after selecting a different shipping method.

 

Did you ever solve this?

 

 

Thanks for keeping me up to date. I have not gotten it to work either. So until Someone gives us a solution I have uninstalled it. Lets keep communicating on this.

 

Thanks

Link to comment
Share on other sites

  • 3 weeks later...
Hello!

Any new about this problem? :blink:

 

Nope - No one else seems to be interested. But for me the mod just did not work so I uninstalled it. When I find someone who has it working then I'll put it back. To bad too, its a good contribution idea. I would like for it to be available to my site but I refuse to put stuff in that doesn't work right. If I can't figure out how to fix it, it goes.

 

Understand, that I appreciate all the hard work that folks do to make these contributions available, and I also know that there are many mods that in some ways conflict with each other, and I feel as a participant and user of these mods I must first understand that there is no obligation on anyone's part to make my site work....that responsibility is mine. So when problems happen, and they will, I try to do all of my due dilligence before I start jumping on the forum and expecting a knight in shinning armor to come to my rescue. I just appreciate that there are people out there that have good ideas and are willing to share them. If their ideas and code work for me, then great, if not, then oh well!

 

Sorry for being on my soap box, but I spend lots of time paging through comments in these forums from people who have an expectation of someone else fixing their problems and they have not spent the due diligence on their own to justify asking the forum for help.

 

You and I have a problem with this mod, and I would sure like to fix it and of course it is good to have another helping to locate the solution, and I know there is one, but until then, I pulled it.

 

I am still waiting as you are, and if someone reads this that knows why out code doesn't work, I hope they will offer help. But my expectations are not high with regard to this. I had hoped that the author of the mod would have dropped by and offered an idea but I guess he has moved on too. Again, it is not my expectation that he/she has to fix my problem.

 

Anyway stay in touch and I will too. If I get a solution I will certainly respond here or PM you.

 

Sorry - Its been a long day and I'm ready to hit it for the night. Hope your site does well!

 

Rick

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...