csavern Posted October 12, 2005 Posted October 12, 2005 I looked around int he setting but cant find no where it will let me change it or maybe i just dont know how to but when some one places a order it comes up with how much it will cost but when they go to the next step it is not added to the total just the total of product
wheeloftime Posted October 12, 2005 Posted October 12, 2005 I looked around int he setting but cant find no where it will let me change it or maybe i just dont know how to but when some one places a order it comes up with how much it will cost but when they go to the next step it is not added to the total just the total of product So at checkout you do get a valid shipping quote which however doesn't appear anymore on your final checkout screen ?! It might be something simple as you have not setup your admin->modules->total order modules correctly. The minimum you normally should have there is the sub-total module with sort order 1, the shipping module with sort order 2 and the total module with sort order 3. If you have tax on the products but not on the shipping you will have sort order 1 = sub-total module sort order 2 = tax module sort order 3 = shipping module sort order 4 = total module Check if you have setup these correctly.
csavern Posted October 12, 2005 Author Posted October 12, 2005 Tried and still same thing it shows shipping on the shipping page but it dont charge for shipping
wheeloftime Posted October 12, 2005 Posted October 12, 2005 Tried and still same thing it shows shipping on the shipping page but it dont charge for shipping Can you describe what is happening !? Assuming: 1) Product in basket going to checkout 2) checkout shipping gives x options with correct values 3) checkout payment gives options, all okay 4) checkout confirmation gives oversight of product, the sub-total but nada no shipping quote with price. The total = sub-total
csavern Posted October 12, 2005 Author Posted October 12, 2005 thats correct when it goes to the total page the shipping is not there but when you are at the shipping page it shows shipping say @ $9.00 then it takes you to total and the shipping aint there
wheeloftime Posted October 12, 2005 Posted October 12, 2005 thats correct when it goes to the total page the shipping is not there but when you are at the shipping page it shows shipping say @ $9.00 then it takes you to total and the shipping aint there Strange ?! You sure you have setup your order total modules correctly ? And there is a payment selection screen in between ?
csavern Posted October 12, 2005 Author Posted October 12, 2005 Strange ?! You sure you have setup your order total modules correctly ? And there is a payment selection screen in between ? yes sir sure is i only offer paypal at the moment and i use a drop shipper so i am using flat rate on shipping becasue ups when i add it there are to many shipping options like over night and i cant do the over night so i put it flat rate and let me let you in on what i got i bought this site off ebay it aint worked right so far the site works but there are a lot of little problems like the banner manager not working so i delelted the footer.php and downloaded oscommerce and replaced just the footer not i got banner but it is at the top of page now the shipping aint working so i dont know i think i got a bunch of problems the MAIN PROBLEM is going to be me i have never dont a web site i have been doing this one know for about 4 days first time every to be doing a web site learning as i go
♥Monika in Germany Posted October 12, 2005 Posted October 12, 2005 check if you have this in checkout_confirmation.php, this is where shipping is called // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); then check this part of the checkout_shipping.php line by line ... this is where shipping is registered in the globals // 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 == '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')); } } :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
csavern Posted October 12, 2005 Author Posted October 12, 2005 here is what mine looks like process the selected shipping method if(isset($_POST['action']) && ($_POST['action'] == 'process')){ if(!tep_session_is_registered('comments')) tep_session_register('comments'); if(tep_not_null($_POST['comments'])) $comments = tep_db_prepare_input($_POST['comments']); if(!tep_session_is_registered('shipping')) tep_session_register('shipping'); if((tep_count_shipping_modules() > 0) || ($free_shipping == true)){ if((isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_'))){ $shipping = $_POST['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'));
wheeloftime Posted October 12, 2005 Posted October 12, 2005 here is what mine looks like process the selected shipping method if(isset($_POST['action']) && ($_POST['action'] == 'process')){ if(!tep_session_is_registered('comments')) tep_session_register('comments'); if(tep_not_null($_POST['comments'])) $comments = tep_db_prepare_input($_POST['comments']); if(!tep_session_is_registered('shipping')) tep_session_register('shipping'); if((tep_count_shipping_modules() > 0) || ($free_shipping == true)){ if((isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_'))){ $shipping = $_POST['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')); Looks the same ?! Maybe a problem with sessions overall ? If correctly setup one would at least expect the shipping title whether there be a value or not.
♥Monika in Germany Posted October 12, 2005 Posted October 12, 2005 time to post a link! :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
csavern Posted October 12, 2005 Author Posted October 12, 2005 well rather not but i can if you dont mind it is a adult toy site
♥Monika in Germany Posted October 12, 2005 Posted October 12, 2005 well rather not but i can if you dont mind it is a adult toy site well I'm not shy ... have a client right now with an adult toy site :-) PM me the link if you prefer that! :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
Pottypotsworth Posted October 14, 2005 Posted October 14, 2005 Hey all, I have the exact same problem on two OS commerce sites that i run. Basically i have hacked away at the shipping costs (to offer free shipping with other shipping modules) and discounted shipping on the amount of products you use. Let me explain exactly what happens (with screenies) User comes to checkout_shipping.php all shipping prices are correct. User continues through to checkout confirmation and in the top left corner under shipping the correct shipping method is shown... ($order->shipping_method). However, on the same page in the bottom right, the shipping cost is always set as ?0.00 so it isnt picking up the correct cost of the shipping method. I tried to fix it as i thought i could just use $order->shipping_cost to echo out the cost of the shipping, but i am not quite sure how to get it into that section because the page builds it from... <!-- checkout_confirmation.php line 267--> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> Unless you know exactly how OScommerce works it is hard to track how it handles all the shipping modules etc. I have attached screenies to show you what i mean. So can anyone tell me why it does recognise the shipping method but doesnt show the correct cost in the order_total section? Thanx
wheeloftime Posted October 14, 2005 Posted October 14, 2005 Hey all, I have the exact same problem on two OS commerce sites that i run. Basically i have hacked away at the shipping costs (to offer free shipping with other shipping modules) and discounted shipping on the amount of products you use. Let me explain exactly what happens (with screenies) User comes to checkout_shipping.php all shipping prices are correct. User continues through to checkout confirmation and in the top left corner under shipping the correct shipping method is shown... ($order->shipping_method). However, on the same page in the bottom right, the shipping cost is always set as ?0.00 so it isnt picking up the correct cost of the shipping method. I tried to fix it as i thought i could just use $order->shipping_cost to echo out the cost of the shipping, but i am not quite sure how to get it into that section because the page builds it from... <!-- checkout_confirmation.php line 267--> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> Unless you know exactly how OScommerce works it is hard to track how it handles all the shipping modules etc. I have attached screenies to show you what i mean. So can anyone tell me why it does recognise the shipping method but doesnt show the correct cost in the order_total section? Thanx Try a quick check and uninstall or deactivate the free shipping from your shipping modules.
csavern Posted October 14, 2005 Author Posted October 14, 2005 Try a quick check and uninstall or deactivate the free shipping from your shipping modules. i have the free shipping is deactavated
wheeloftime Posted October 14, 2005 Posted October 14, 2005 i have the free shipping is deactavated Well, I just did a check with the default osC free shipping option and there is definitely something wrong with it when you select another shipping option. At the checkout confirmation the shipping is indeed reset to zero as your pictures show. I use the freeamount contrib for my free shipping purposes which has more options and works as expected but I'll have a look at the osC shipping total module to see why it neglects the other shipping options when free shipment applies.
Pottypotsworth Posted October 14, 2005 Posted October 14, 2005 When free shipping is off the cost shows up correctly. Its like the free shipping is overridding the individual modules! Edit: Yeah there is deffo something wrong with where it grabs the price from, on my other site i dont have free shipping but implemented a discount scheme for the ammount of products you have. It also doesnt show the correct prices on the order total section. I'll go through it too but i still dont understand how that part is built... any ideas? [moan]Its stupid that the method comes up fine n the other section isnt fine[/moan]
wheeloftime Posted October 14, 2005 Posted October 14, 2005 I can't test if fully as with default osC and free shipping all other options are supressed and my checkout shipping has been altered too much to have it working with the default osC free shipping through the shipping total module. Anyhow, you should try this: in your (catalog)/includes/modules/order_total/ot_shipping.php search for if (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; } if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; } } and change it to if ($GLOBALS['shipping']['id'] == 'free_free') { if (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; } if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; } } } The problem is that if you have free shipping activated it is always choosen in the order total shipping module independant of what you have choosen within the checkout shipping. Now there is first a check if the free shipping has been choosen and if not skip the whole thing which alters the choosen shipping method. The one thing I couldn't test is if it will pick up free shipping when it is choosen. You check that out please.
Pottypotsworth Posted October 14, 2005 Posted October 14, 2005 ^ Nice work, will try it out in about an hour n let you know the results. Cheers mate Chewie
Pottypotsworth Posted October 14, 2005 Posted October 14, 2005 Thanx for all your help, the above solution works perfectly. Well done, thanx again. Chewie
wheeloftime Posted October 14, 2005 Posted October 14, 2005 Thanx for all your help, the above solution works perfectly. Well done, thanx again. Chewie Thanks for the follow up Chewie, glad to hear it worked !
♥Gyakutsuki Posted January 12, 2006 Posted January 12, 2006 Hello, Thank you for this contribution. I need your help to solve a problem. Indeed, when you realize an order yousee all shipping module. But there is a problem . A client can choose a bad module and ask after the free shipping. The solution is to have one module when the free shipping condition is true. I developped a little code in classes / shipping.php. I am not not far to solve the problem but i am blocked ! Do you have a solution ? There the code classes/shipping.php <?php/* $Id: shipping.php,v 1.11 2006/01/12 16:03:09 loic Exp $ osCommerce, Open Sourceforge E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ class shipping { var $modules; // class constructor function shipping($module = '') { global $language, $PHP_SELF; if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) { $this->modules = explode(';', MODULE_SHIPPING_INSTALLED); $include_modules = array(); if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) { $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); } else { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); //echo $class; $include_modules[] = array('class' => $class, 'file' => $value); } } // ################## Added MOdification freeamount ######################### global $total_weight, $order; $zone_to_geo_zone_query2 = tep_db_query("select zone_id, geo_zone_id, zone_country_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '". MODULE_SHIPPING_FREEAMOUNT_ZONE . "' "); $zone_to_geo_zone2 = tep_db_fetch_array($zone_to_geo_zone_query2); echo '<br>'.$order->delivery['country']['id'].'Id Pays de livraison - <br>'; echo '<br>'.$order->delivery['country']['id'] .'- n? pays s?lectionn? $selected_country prise dans $order->delivery[country][id]<br>'; $delivery_ok = 0; while ($zone_to_geo_zone2 = tep_db_fetch_array($zone_to_geo_zone_query2)) { // je regarde et s?lectionne toutes les zones identiques $devilery = $order->delivery['country']['id']; echo '<br>'. $zone_to_geo_zone2[zone_country_id] .'-N? zone zone_country_id- requete sql - Ne prend pas la premi?re requ?te le n?73<br>'; if ($zone_to_geo_zone2[zone_country_id] = $devilery) { $delivery_ok = 1; } } if (($order->info['total'] >= MODULE_SHIPPING_FREEAMOUNT_AMOUNT) && (MODULE_SHIPPING_FREEAMOUNT_DISPLAY == 'True') && (MODULE_SHIPPING_FREEAMOUNT_STATUS == 'True') && (MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX > $total_weight) && ($delivery_ok == '1')) { //gestion apparition du module Comment faire apparaitre un seul module // for ($i=0, $n=sizeof($include_modules); $i<1; $i++) { include(DIR_WS_LANGUAGES . $language . '/modules/shipping/freeamount.php'); include(DIR_WS_MODULES . 'shipping/freeamount.php'); // Comment refaire cette ligne avec un seul module ???? $classfree = 'freeamount'; // $GLOBALS[$include_modules[$classfree]] = new $include_modules[$classfree]; } else { // ################## End Added MOdification freeamount ######################### for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) { include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']); include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']); $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']; } } // ################## Added MOdification free shipping ######################## } // ################## End added MOdification free shipping ######################### } function quote($method = '', $module = '') { global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes; $quotes_array = array(); if (is_array($this->modules)) { $shipping_quoted = ''; $shipping_num_boxes = 1; $shipping_weight = $total_weight; if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) { $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT; } else { $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100); } if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT); $shipping_weight = $shipping_weight/$shipping_num_boxes; } $include_quotes = array(); reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if (tep_not_null($module)) { if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) { $include_quotes[] = $class; } } elseif ($GLOBALS[$class]->enabled) { $include_quotes[] = $class; } } $size = sizeof($include_quotes); for ($i=0; $i<$size; $i++) { $quotes = $GLOBALS[$include_quotes[$i]]->quote($method); if (is_array($quotes)) $quotes_array[] = $quotes; } } return $quotes_array; } function cheapest() { if (is_array($this->modules)) { $rates = array(); reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $quotes = $GLOBALS[$class]->quotes; for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) { if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) { $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'], 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')', 'cost' => $quotes['methods'][$i]['cost']); } } } } $cheapest = false; for ($i=0, $n=sizeof($rates); $i<$n; $i++) { if (is_array($cheapest)) { if ($rates[$i]['cost'] < $cheapest['cost']) { $cheapest = $rates[$i]; } } else { $cheapest = $rates[$i]; } } return $cheapest; } } } ?> Regards ----------------------------------------- Loïc Contact me by skype for business Contact me @gyakutsuki for an answer on the forum
wheeloftime Posted January 12, 2006 Posted January 12, 2006 Hello,Thank you for this contribution. I need your help to solve a problem. Indeed, when you realize an order yousee all shipping module. But there is a problem . A client can choose a bad module and ask after the free shipping. The solution is to have one module when the free shipping condition is true. I developped a little code in classes / shipping.php. I am not not far to solve the problem but i am blocked ! Do you have a solution ? There the code classes/shipping.php I am not sure if I understand what you are after ?! The idea was/is to show mulitple shipping options despite the fact the customer is also entitled to free shipping. If you do not want to see the rest you can use the stock osC free shipping method which you find in your order total shipping module.
♥Gyakutsuki Posted January 12, 2006 Posted January 12, 2006 I am not sure if I understand what you are after ?! The idea was/is to show mulitple shipping options despite the fact the customer is also entitled to free shipping. If you do not want to see the rest you can use the stock osC free shipping method which you find in your order total shipping module. Sorry for my english : The problem is simple but the code is hard If you have an amount in free shipping and a specific zone (example), the idea is to show only freeamount module and insert a message, "Free shipping" for example. But if the freeamount condition is not respected, you see all others modules. After, i don't think to have problem to continue the order because the shipping will be = 0 $ or the shipping will be a price. That a first idea The second idea is no change but when the free shipping is selected, the default module become free shipping. It's impossible to select in this moment the shipping module default when you have several shipping module. Regards ----------------------------------------- Loïc Contact me by skype for business Contact me @gyakutsuki for an answer on the forum
Recommended Posts
Archived
This topic is now archived and is closed to further replies.