wheeloftime Posted April 1, 2005 Share Posted April 1, 2005 Estimated Shipping Costs This contribution will add an infobox to your osCommerce shop which shows the estimated shipping costs to the customer. It will show as soon as the customer adds a product to his shopping cart and (re)calculate the estimated shipping costs. As it is based on the checkout shipping page the calculated shipping costs will be accurate and not really an estimate. At this stage only country based shipping costs information can be shown ! Alternatively you can show the estimated shipping cost module in your mainpage instead as a left, or right, column infobox. The module will disable itself once the customer reaches the checkout shipping page. Contribution Link Quote Link to comment Share on other sites More sharing options...
Dennisra Posted April 2, 2005 Share Posted April 2, 2005 To the author: Thanks for the contribution. Is the estimated shipping cost computed on weight? It is possible to compute the shipping cost on a slding scale or would that require a lot of new code? For Example Shipping $2.00 up to $50.00 of sales then $4.00 up to $100.00 etc. Thanks again. Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted April 2, 2005 Author Share Posted April 2, 2005 To the author: Thanks for the contribution. Is the estimated shipping cost computed on weight? It is possible to compute the shipping cost on a slding scale or would that require a lot of new code? For Example Shipping $2.00 up to $50.00 of sales then $4.00 up to $100.00 etc. Thanks again. <{POST_SNAPBACK}> I think you misunderstood the purpose of this contribution. It is not a shipping module by itself but more like a realtime shipping cost calculator based on country input and working outside the scope of the checkout pages so a customer can already get an insight about what shipping costs to expect when adding products to his cart. Your example should be easily setup with ie. the table or zones shipping module and this contrib will then show your shipping cost upfront to the customer while he is still shopping. Regards, Howard Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 8, 2005 Share Posted May 8, 2005 Hello wheeloftime Thank you for a great contribution. It is just what I am looking for. This way customer can get an estimate of the shipping cost even before they register for an account at my shop. I do have a bug to report though. I am offering free shipping for orders above certain amount. Therefore, when a customer qualifies for the free shipping they will get an error. It looks like this on the frontend. Warning: tep_get_estimated_shipping_quotes(includes/languages//modules/order_total/ot_shipping.php): failed to open stream: No such file or directory in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 Warning: tep_get_estimated_shipping_quotes(includes/languages//modules/order_total/ot_shipping.php): failed to open stream: No such file or directory in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 Warning: tep_get_estimated_shipping_quotes(): Failed opening 'includes/languages//modules/order_total/ot_shipping.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 BTW, the abovementioned codes are from my test shop. The free shipping is defined in the osCommerce Administration under Modules -> Order Total -> Shipping. Do you have any suggestions as to how this can be fixed? All help is greatly appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 8, 2005 Author Share Posted May 8, 2005 Hello wheeloftime Thank you for a great contribution. It is just what I am looking for. This way customer can get an estimate of the shipping cost even before they register for an account at my shop. I do have a bug to report though. I am offering free shipping for orders above certain amount. Therefore, when a customer qualifies for the free shipping they will get an error. It looks like this on the frontend. Warning: tep_get_estimated_shipping_quotes(includes/languages//modules/order_total/ot_shipping.php): failed to open stream: No such file or directory in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 Warning: tep_get_estimated_shipping_quotes(includes/languages//modules/order_total/ot_shipping.php): failed to open stream: No such file or directory in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 Warning: tep_get_estimated_shipping_quotes(): Failed opening 'includes/languages//modules/order_total/ot_shipping.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/sandbox/includes/functions/estimated_shipping_functions.php on line 61 BTW, the abovementioned codes are from my test shop. The free shipping is defined in the osCommerce Administration under Modules -> Order Total -> Shipping. Do you have any suggestions as to how this can be fixed? All help is greatly appreciated. Thanks <{POST_SNAPBACK}> Hello rezdwan, Good to hear this contribution is also useful for you ! What I can say right now is that somehow your language variable is not picked up correctly and therefore this: includes/languages//modules/order_total/ot_shipping.php is broken. Between the '//' should have been 'english', 'dutch' or whatever languages you use. What you can try is the following: edit the file includes/functions/estimated_shipping_functions.php by adding the variable $language to the globals of the function tep_get_estimated_shipping_quotes. So this: function tep_get_estimated_shipping_quotes($country, $getvar, $customer_country) { global $HTTP_POST_VARS, $country, $cart, $currencies, $country_to_ship_to, $country_name, $order, $total_weight, $total_count; should become: function tep_get_estimated_shipping_quotes($country, $getvar, $customer_country) { global $HTTP_POST_VARS, $language, $country, $cart, $currencies, $country_to_ship_to, $country_name, $order, $total_weight, $total_count; I have never been able to test the free shipping part of the code because I use a seperate free shipping module but I am pretty sure this will do the trick. If you would be so kind to try this for me and tell if that worked I will update this in the next release. Regards, Howard Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 8, 2005 Share Posted May 8, 2005 Hello rezdwan, Good to hear this contribution is also useful for you ! What I can say right now is that somehow your language variable is not picked up correctly and therefore this: includes/languages//modules/order_total/ot_shipping.php is broken. Between the '//' should have been 'english', 'dutch' or whatever languages you use. What you can try is the following: edit the file includes/functions/estimated_shipping_functions.php by adding the variable $language to the globals of the function tep_get_estimated_shipping_quotes. So this: function tep_get_estimated_shipping_quotes($country, $getvar, $customer_country) { global $HTTP_POST_VARS, $country, $cart, $currencies, $country_to_ship_to, $country_name, $order, $total_weight, $total_count; should become: function tep_get_estimated_shipping_quotes($country, $getvar, $customer_country) { global $HTTP_POST_VARS, $language, $country, $cart, $currencies, $country_to_ship_to, $country_name, $order, $total_weight, $total_count; I have never been able to test the free shipping part of the code because I use a seperate free shipping module but I am pretty sure this will do the trick. If you would be so kind to try this for me and tell if that worked I will update this in the next release. Regards, Howard <{POST_SNAPBACK}> Hello wheeloftime I have followed your instructions and it works great! It shows the estimated shipping cost and also the free shipping cost for orders above the certain amount. Thank you for the help and also for the very prompt reply! Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 8, 2005 Author Share Posted May 8, 2005 Hello wheeloftime I have followed your instructions and it works great! It shows the estimated shipping cost and also the free shipping cost for orders above the certain amount. Thank you for the help and also for the very prompt reply! Thanks <{POST_SNAPBACK}> No problem, thanks for trying it out and and I will make an update for this asap ! Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 15, 2005 Share Posted May 15, 2005 No problem, thanks for trying it out and and I will make an update for this asap ! <{POST_SNAPBACK}> Hello wheeloftime I have successfully used this contribution. I have added the information on the right column under the shopping cart box. It works fine but the text of the various shipping charges are too long and looks unsightly on my site. I was thinking of adding this estimated shipping cost information in the shopping cart page (ie in the file shopping_cart.php) just under the sub-total. I have followed step 6 and option b of your instruction except that the codes are in shopping_cart.php instead of index.php. It works fine and customer will see the estimated shipping cost of the default destination. But when I try to select another country, nothing happens and it will still display the default shipping destination. Did I left something out or would certain modification need to be made to the codes so that it works in shopping_cart.php? Or is this the limitation of this contribution? All help is greatly appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 15, 2005 Author Share Posted May 15, 2005 Hello wheeloftime I have successfully used this contribution. I have added the information on the right column under the shopping cart box. It works fine but the text of the various shipping charges are too long and looks unsightly on my site. I was thinking of adding this estimated shipping cost information in the shopping cart page (ie in the file shopping_cart.php) just under the sub-total. I have followed step 6 and option b of your instruction except that the codes are in shopping_cart.php instead of index.php. It works fine and customer will see the estimated shipping cost of the default destination. But when I try to select another country, nothing happens and it will still display the default shipping destination. Did I left something out or would certain modification need to be made to the codes so that it works in shopping_cart.php? Or is this the limitation of this contribution? All help is greatly appreciated. Thanks <{POST_SNAPBACK}> No, you did it correctly and it was something I tried also when developing this. The problem is that the shopping cart page already uses a form and as the estimated shipping module also does you get a form inside a form with the result the last one, estimated shipping, will not work. I probably should have mentioned this in the readme so it would be clear that on the index page it works allright but not on the shopping cart page where I would have liked to put it myself also. Hope this clarifies it, I have not been able to find a solution for this. Howard Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 16, 2005 Share Posted May 16, 2005 No, you did it correctly and it was something I tried also when developing this. The problem is that the shopping cart page already uses a form and as the estimated shipping module also does you get a form inside a form with the result the last one, estimated shipping, will not work. I probably should have mentioned this in the readme so it would be clear that on the index page it works allright but not on the shopping cart page where I would have liked to put it myself also.Hope this clarifies it, I have not been able to find a solution for this. Howard <{POST_SNAPBACK}> Hello Howard Thank you for clearing things up. Let's hope we'll be able to find a solution for this as I felt that the contribution is very useful. Anyone out there who's able to help, please do not hesitate. Thanks Quote Link to comment Share on other sites More sharing options...
duranike Posted May 17, 2005 Share Posted May 17, 2005 No, you did it correctly and it was something I tried also when developing this. The problem is that the shopping cart page already uses a form and as the estimated shipping module also does you get a form inside a form with the result the last one, estimated shipping, will not work. I probably should have mentioned this in the readme so it would be clear that on the index page it works allright but not on the shopping cart page where I would have liked to put it myself also.Hope this clarifies it, I have not been able to find a solution for this. Howard <{POST_SNAPBACK}> any way for it to work with regions based shipping? in particualr the contribution 'MultiGeoZone MultiTable Shipping - version 1.100' ? thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 17, 2005 Author Share Posted May 17, 2005 any way for it to work with regions based shipping? in particualr the contribution 'MultiGeoZone MultiTable Shipping - version 1.100' ? thanks <{POST_SNAPBACK}> I don't know that contribution but what I read of it now it might just work fine with Estimated Shipping. You'll have to try to see if it gets picked up correctly. Quote Link to comment Share on other sites More sharing options...
duranike Posted May 17, 2005 Share Posted May 17, 2005 im not a really good php coder. Can u point me in the right direction? Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 17, 2005 Author Share Posted May 17, 2005 im not a really good php coder. Can u point me in the right direction? <{POST_SNAPBACK}> You have to install the Estimated Shipping contrib and just try it out. If the shipping contrib you mentioned shows correct during checkout you should see the same output through Estimated Shipping on beforehand. If it doesn't it means there is not enough information available to be able to use Estimated Shipping for that shipping module. As the shipping module you mentioned is based on country information it might work. Quote Link to comment Share on other sites More sharing options...
duranike Posted May 17, 2005 Share Posted May 17, 2005 im getting this error "Fatal error: Cannot redeclare class shipping in /**********l/catalog/includes/classes/shipping.php on line 13 and here is line 13 class shipping { var $modules; Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 17, 2005 Author Share Posted May 17, 2005 im getting this error "Fatal error: Cannot redeclare class shipping in /**********l/catalog/includes/classes/shipping.php on line 13 and here is line 13 class shipping { var $modules; <{POST_SNAPBACK}> How did you install Estimated Shipping ? Only install it as a left or right column infobox or inside your main page. Do not put it on other pages or you might get conflicts. Quote Link to comment Share on other sites More sharing options...
duranike Posted May 17, 2005 Share Posted May 17, 2005 ok figured it out a little. its up but on this page http://landroller.com/store/shopping_cart.php it doent work on the other pages its find like www.landroller.com/store can i just disable it on that page becuase i dont need it becuase i have ship in cart? Quote Link to comment Share on other sites More sharing options...
duranike Posted May 17, 2005 Share Posted May 17, 2005 also can i make it match my other boxes with a shadow? im using drop shadows 1.0 contribution Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 17, 2005 Author Share Posted May 17, 2005 also can i make it match my other boxes with a shadow? im using drop shadows 1.0 contribution <{POST_SNAPBACK}> I have implemented it as a seperate infobox class so you should be able to do whatever change you like to the Estimated Shipping Infobox seperate from the others. As for your previous question: yes, that should be possible. If you look at the catalog/includes/modules/estimated_shipping.php you see the following condition: if ($cart->count_contents() > 0 && (substr(basename($PHP_SELF), 0, 8) != 'checkout')) { You can add another conditional there to check if you are on the shopping_cart.php page to not show it there also. if ($cart->count_contents() > 0 && (substr(basename($PHP_SELF), 0, 8) != 'checkout') || substr(basename($PHP_SELF), 0, 8) != 'shopping')) { Haven't checked this so you could get an error on too many or less opening/closing quotes. Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 18, 2005 Share Posted May 18, 2005 No, you did it correctly and it was something I tried also when developing this. The problem is that the shopping cart page already uses a form and as the estimated shipping module also does you get a form inside a form with the result the last one, estimated shipping, will not work. I probably should have mentioned this in the readme so it would be clear that on the index page it works allright but not on the shopping cart page where I would have liked to put it myself also.Hope this clarifies it, I have not been able to find a solution for this. Howard <{POST_SNAPBACK}> Hello Howard I managed to get your contribution working in catalog/shopping_cart.php like I wanted. I thought you might like to know. Here's how I did it. All the install instructions are the same as you have provided. For those who wishes to add the code to shopping_cart.php, they will have to do the following. Open and find the following line in shopping_cart.php (line 229). </table></form></td> Replace with the following. </form> <tr> <td><br><?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?></td> </tr></table></td> Basically all are the same except that I have moved the </form> tag to be before the </table> tag. I hope changing this does not affect the overall functionality of osCommerce. Howard, if it is not too much to ask, please check the abovementioned and give me your advise. Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 18, 2005 Author Share Posted May 18, 2005 Hello Howard I managed to get your contribution working in catalog/shopping_cart.php like I wanted. I thought you might like to know. Here's how I did it. All the install instructions are the same as you have provided. For those who wishes to add the code to shopping_cart.php, they will have to do the following. Open and find the following line in shopping_cart.php (line 229). ? ?</table></form></td> Replace with the following. </form> ?<tr> ? ?<td><br><?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?></td> ?</tr></table></td> Basically all are the same except that I have moved the </form> tag to be before the </table> tag. I hope changing this does not affect the overall functionality of osCommerce. Howard, if it is not too much to ask, please check the abovementioned and give me your advise. Thanks <{POST_SNAPBACK}> Rezdwan, Yep, that would work but you will have to disable the Estimated Shipping infobox to prevent a redeclare error or make an extra conditional within the catalog/includes/modules/estimated_shipping.php for the shopping_cart.php page. Good work :thumbsup: Grtz. Howard Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 18, 2005 Share Posted May 18, 2005 Rezdwan, Yep, that would work but you will have to disable the Estimated Shipping infobox to prevent a redeclare error or make an extra conditional within the catalog/includes/modules/estimated_shipping.php for the shopping_cart.php page. Good work :thumbsup: Grtz. Howard <{POST_SNAPBACK}> Hello Howard Thank you for reviewing the changes that I have made. I am not too sure what you meant by disabling the Estimated Shipping infobox or make an extra conditional within the catalog/includes/modules/estimated_shipping.php. Could you please elaborate? Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 18, 2005 Author Share Posted May 18, 2005 Hello Howard Thank you for reviewing the changes that I have made. I am not too sure what you meant by disabling the Estimated Shipping infobox or make an extra conditional within the catalog/includes/modules/estimated_shipping.php. Could you please elaborate? Thanks <{POST_SNAPBACK}> If you have the Estimated Shipping infobox activated in your left or right column and put it on the shopping cart page also you will get an error on the shopping cart page. One way to prevent this is to not use the left/right column infobox variant or add another conditional statement to the catalog/includes/modules/estimated_shipping.php like substr(basename($PHP_SELF), 0, 8) != 'shopping' That way the infobox will not show when you are on the shopping cart page hence you prevent the error to be born. When you use the infobox variant it is a bit 'double' to use the module also on the shopping cart page as the information is already there in the right or left column. Personally I would say it is one way or another, not on both the shopping cart page and as an left/right column infobox. Quote Link to comment Share on other sites More sharing options...
rezdwan Posted May 18, 2005 Share Posted May 18, 2005 If you have the Estimated Shipping infobox activated in your left or right column and put it on the shopping cart page also you will get an error on the shopping cart page. One way to prevent this is to not use the left/right column infobox variant or add another conditional statement to the catalog/includes/modules/estimated_shipping.php like substr(basename($PHP_SELF), 0, 8) != 'shopping' That way the infobox will not show when you are on the shopping cart page hence you prevent the error to be born. When you use the infobox variant it is a bit 'double' to use the module also on the shopping cart page as the information is already there in the right or left column. Personally I would say it is one way or another, not on both the shopping cart page and as an left/right column infobox. <{POST_SNAPBACK}> Hello Howard I got what you mean now. I did not add the contribution to the left or right column. It only appears on the shopping_cart.php page. It is working fine. Now my customers can see the shipping cost even before they sign up for an account. Hopefully this translate to more completed orders and less dummy customers (users that just sign up so they can see the shipping cost). Thank you for all the help. Thanks Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted May 18, 2005 Author Share Posted May 18, 2005 Hello Howard I got what you mean now. I did not add the contribution to the left or right column. It only appears on the shopping_cart.php page. It is working fine. Now my customers can see the shipping cost even before they sign up for an account. Hopefully this translate to more completed orders and less dummy customers (users that just sign up so they can see the shipping cost). Thank you for all the help. Thanks <{POST_SNAPBACK}> Exactly my idea and why I made this contrib ! I hope it will help you as it does me ! Grtz. Howard Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.