Jump to content
sembrouille

Shipping in cart

Recommended Posts

Hi Steve

 

I'm not sure if this is what you mean but.....

 

Around line 109 find //------------------- fin affiche fdp ---------------------------------------------------- , count up two closing curly wurlies and add the line shown - that should get you the dropdown displaying 'Royal Mail (£12.87)' instead of 'Royal Mail'

 

//altering dropdown text
$quotes_array[$i]['text'].= ' ('.$currencies->format( tep_add_tax((float)$calcul_fdp_scart, $tax_fdp)).')';
//end
}
}
//------------------- fin affiche fdp ----------------------------------------------------

 

p.s. first I've seen this one and it's a much nicer add-on than the older ship in cart contribution - well done MrFoggy

 

@@Bob Terveuren

 

I tried the above, but it only put in the costs of the chosen service, not the costs of all the available services. I will look into this more, and compare with an older similar addon and see if I can get it to show the prices of each individual service next to where it lists the services in the dropdown box. At the moment you have to click on the service type to get the price guote, and I think it would be better if the price showed next to the service.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@@14steve14

Hi Steve - it works for the basic stuff like table rates, flat rate etc etc but I think it may be failing on the RM stuff if it's looking for zones??

 

I haven't time to look at it but if you look at the quotes function in the RM module and see what it requires before it will spit out a quote then the answer is in that bit I reckon

Share this post


Link to post
Share on other sites

Hi, Great contribution, thanks!!

 

Please will you let me know how I can include a free shipping module (not necessarily ot_free_shipping) in the drop down list.

 

We offer fee shipping and expedited shipping (at a cost) to our customers. So it is important they can see all shipping options which are available. Otherwise they may not be aware of the free shipping option and bang goes the sale.

 

We have all of the shipping options showing on the Checkout Shipping page and I would like to mirror this in the Shopping Cart drop-down.

 

Regards

 

Simon Hornby

Edited by simonhornby

Share this post


Link to post
Share on other sites

Free Shipping in order total!

 

Sussed! I use Royal Mail 2nd Class Standard v2.2.2 zone rates so I set shipping zone rate at 100000:003 ie to ship up to 100Kg costs 1/3p. 100kg is way more than we actually will ship so all orders should be covered. The amount (0.003) is too small for OSC to round up to 1p so is "charged" to the Customer at £0.00 - ie Free Shipping. But, because it is not actually "free" OSC shows the shipping module in checkout_shipping.

 

If you want to the shipping description to be "Free Shipping" instead of the module name just go into the module and alter the name string - it is really obvious where to do this once the file is open.

 

:D

Edited by simonhornby

Share this post


Link to post
Share on other sites

Hi,

 

Can someone tell me where is my fault, the matter is final result is wrong.

 

<!-- calculamos el iva del envio -->

<p align="right"><?php echo TAX_ON_DELIVERY; echo $currencies->format(tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp)) . tep_draw_separator('pixel_trans.gif', '3%', '5');?></p>

<!-- mostramos el precio de los productos -->

<p align="right"><?php echo ORDER_SUBTOTAL; echo $currencies->format($cart->show_total()) . tep_draw_separator('pixel_trans.gif', '3%', '5'); ?></p>

<!-- fijamos el iva al 10% y lo mostramos en vattotal -->

<p align="right"><?php $vattotal = $currencies->format($cart->show_total()*10/100); ?><?php echo TAX_ON_PRODUCTS . $vattotal . tep_draw_separator('pixel_trans.gif', '3%', '5');?></p>

<!-- sumamos todos los conceptos -->

<p align="right"><strong><?php echo ORDER_TOTAL_APROX; echo $currencies->format(($cart->show_total()) + ((float)$calcul_fdp_scart + tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp)) + (float)$vattotal) ;?></strong></p>

Share this post


Link to post
Share on other sites

Hi all,

 

Many thanks to Monsieur Brouillard for this contribution, it does exactly what I want.

 

I'm trying to make it work with the Canada Post shipping module (which gets an actual quote from the Canada Post server based on the postal code and weight) and out of the box it works nearly perfectly. My first obstacle is that when Canada Post offers several different services at various rates, the drop down menu shows them from most expensive to least expensive and the default choice is the most expensive. Obviously I'd like that to be the other way around: Showing the shipping speeds from least expensive to most expensive with the default being the least expensive.

 

I only use the Canada Post module and Store Pickup shipping modules

 

Any idea how to make that happen?

 

Thanks!

Edited by cinolas

Share this post


Link to post
Share on other sites

I've been digging into this with no success. The actual shipping page does sort the various rates correctly from cheapest to most expensive, and successfully picks the cheapest one as default choice using the cheapest() function in shipping.php

 

It seems to me I should be able to call this function through fdp_panier.php but the exact syntax goes beyond my understanding of php.

 

I'd be happy if at least the cheapest option was preselected, even if the menu is in reverse order.

 

Any help is greatly appreciated, thanks!

 

 

 

Hi all,

 

Many thanks to Monsieur Brouillard for this contribution, it does exactly what I want.

 

I'm trying to make it work with the Canada Post shipping module (which gets an actual quote from the Canada Post server based on the postal code and weight) and out of the box it works nearly perfectly. My first obstacle is that when Canada Post offers several different services at various rates, the drop down menu shows them from most expensive to least expensive and the default choice is the most expensive. Obviously I'd like that to be the other way around: Showing the shipping speeds from least expensive to most expensive with the default being the least expensive.

 

I only use the Canada Post module and Store Pickup shipping modules

 

Any idea how to make that happen?

 

Thanks!

Share this post


Link to post
Share on other sites

The originator of this code is still sometimes on these forums but does not seem to offer support for this any more. Its a shame really because the addon works, but has a few minor glitches that spoil it.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

It's understandable, imagine having to provide free lifetime support for a piece of software you didn't get paid to write :)

 

Anyone else that understands how this contribution works willing to land a hand?

 

My problem can't be that complicated, it's almost the sort of thing I could handle with my very limited knowledge of php. Looking at the code it seems it should actually do what I want out of the box, but it's not happening. Like I said above, the shipping module itself is properly set to sort the various shipping rates correctly and auto-select the cheapest, and all of that happens properly on the shipping page, just not on the cart page.

 

Looking at the code here, line 82 of fdp_panier.php:

 

for ($i = 0; $i < sizeof($quotes); $i++) {
   for ($j = 0; $j < sizeof($quotes[$i]['methods']); $j++) {
 if ( ($quotes[$i]['methods'][$j]['cost'] > 0) && ($order->content_type != 'virtual') ) {
	 $quotes_array[] = array('id' => $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], 'text' => $quotes[$i]['module'].' '.$quotes[$i]['methods'][$j]['id']);
//fixer un choix par defaut
	 $default_quotes_array[] = $quotes[$i];
	  if ( $_GET['shippingselected'] != '' ) {
		  $default_shipping_module = str_replace("'", "", $_GET['shippingselected']);
	  } elseif ( $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == DEFAULT_MODE_DELIVRY_SC ) {
		  $default_shipping_module = DEFAULT_MODE_DELIVRY_SC;
	  }
// envoyé le module selctionné (shippingselected ou DEFAULT_MODE_DELIVRY_SC)
	  if ( ($quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == $default_shipping_module) ) {
		   $calcul_fdp_scart = $quotes[$i]['methods'][$j]['cost'];
		   $tax_fdp = $quotes[$i]['tax'];
		   $titre_shipping = $quotes[$i]['module'].' ('.$quotes[$i]['methods'][$j]['title'].')';
	  } elseif ( ($quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id']) == ($default_quotes_array[0]['id'].'_'.$default_quotes_array[0]['methods'][0]['id']) ) {
		   $calcul_fdp_scart = $quotes[$i]['methods'][$j]['cost'];
		   $tax_fdp = $quotes[$i]['tax'];
		   $titre_shipping = $quotes[$i]['module'].' ('.$quotes[$i]['methods'][$j]['title'].')';
	  }
 }
   }
  }

 

This is where it's cycling through the various modules, and methods offered by each module, to build the drop down menu. It's also choosing the default option and setting the variables later used to calculate the total. Surely there's a way for me to add an IF to the default method selection so that it chooses the one with the lowest cost.

 

It almost looks as though the last elseif simply selects the first option in the menu, method 0. If that's the case, can I somehow specify that it should select the biggest ID of the array instead of 0. Since the methods are sorted from most expensive to least expensive, at least it'll default to the cheapest option.

 

Thanks for the help!

Share this post


Link to post
Share on other sites

Can someone tell me if this item supports zip/postal code lookup for US to US shipping? I am using the USPS and UPS add ons for shipping, my site is 2.3.3

 

Ditto - this is a beautiful thing of a add-on - very nice! .... until I see it's not set up for zip code entry on shopping cart. When logged in it works like a charm, but that's not the purpose.

 

Has anyone tried to ZipCode this up with success?


-Dave

Share this post


Link to post
Share on other sites

This addon is very nice. I've been trying to add the ability for a non-logged in customer to enter a zip code to retrieve quotes without having to create an account. I can fiddle with php but don't have the skills to write it. I could use some help if anyone can assist.

 

Basically in the existing code you can see

 

 $order->delivery = array('postcode' => '',
						 'zone_id' => $default_countrie_zone_id,
						 'country' => Array( 'id' => $default_countrie_id, 'title' => '', 'iso_code_2' => $default_countrie_iso2, 'iso_code_3' => $default_countrie_iso3 ));
}

 

and for testing if you hard code a zip code like

 $order->delivery = array('postcode' => '60015',

 

you get quotes (for that zip) without being logged in. So basically it works with just a Zip code. So how do I write a block where the guest enters a zip code, and have the page refresh with the quotes?

 

Lower in the code I added this, which created the fields ok, but I'm not sure if it's at all correct.

 <p align="right" class="prixTotauxPanier"><?php if ($order->delivery['postcode'] == '') { echo TEXT_ZIPCODE . tep_draw_input_field ('postcode',$postcode, 'MAXLENGTH="20" SIZE="10" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>

 

entire block

<!-- soustotal fdp total -->
<?php
if ( $order->content_type != 'virtual' ) {
?>
 <p align="left" class="msgfdpgratuitPanier"><?php echo $text_fdp_scart; ?></p>
<!--/////////// -->
 <p align="right" class="prixTotauxPanier"><?php if ($order->delivery['postcode'] == '') { echo TEXT_ZIPCODE . tep_draw_input_field ('postcode',$postcode, 'MAXLENGTH="20" SIZE="10" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
<!--/////// -->
 <p align="right" class="prixTotauxPanier"><?php if ($order->customer['country']['id'] == '') { echo TEXT_DELIVRY_STATE . tep_draw_pull_down_menu('countrieselected', $countries_array, $menu_default_countrie, 'width="230" style="width: 230px" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php if (sizeof($quotes_array) > 1) { echo TEXT_DELIVRY_TRANSPORTEUR . tep_draw_pull_down_menu('shippingselected', $quotes_array, $default_shipping_module, 'width="230" style="width: 230px" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php if (isset($erreur_shipping) && !isset($default_quotes_array)) { foreach ($erreur_shipping as $erreur_shipping_index => $erreur_shipping_values) { echo $erreur_shipping_values . '<br />'; } } elseif ($default_quotes_array != '') { echo ucfirst($titre_shipping); echo ' : ' . $currencies->display_price((float)$calcul_fdp_scart, $tax_fdp, 1) . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php echo SUB_TITLE_SUB_TOTAL; echo $currencies->format($cart->show_total()) . tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></p>
 <p align="right" class="prixST"><?php echo SUB_TITLE_TOTAL; echo $currencies->format(($cart->show_total()) + ((float)$calcul_fdp_scart + tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp))) ;?></p>
<?php
} else {
?>
 <p align="right" class="prixST"><?php echo SUB_TITLE_TOTAL . $currencies->format($cart->show_total()); ?></p>
 </tr>
<?php
}
?>

 

At this point is where i'm stuck. How to have the entered zip code saved into the session, and have the script use the zip code to re-execute the script, refresh page and show quotes, Any direction appreciated.

 

Here's the whole script WITHOUT my changes (v1.35 clean)

 

<?php
/*
$Id: fdp_panier.php 22 Mai 2012
by Brouillard s'embrouille (brouillard-sembrouille@laposte.net)
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2012 osCommerce
Released under the GNU General Public License
*/
//################# Frais de port dans le panier by Brouillard s'embrouille ###############
//------------------- affiche fdp ----------------------------------------------------
function get_erreur_shipping($id_erreur) {
for ($i = 0; $i < sizeof($id_erreur); $i++) {
 if (isset($id_erreur[$i]['error'])) $erreur_array[] = $id_erreur[$i]['error'];
}
 return $erreur_array;
}
//menu_deroulant
$countries = tep_get_countries();
for ($i = 0; $i < sizeof($countries); $i++) {
 $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}
//la boutique
 $store_countrie_query = tep_db_query("select ab.entry_zone_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3 from " . TABLE_COUNTRIES . " c," . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where c.countries_id = '" . STORE_COUNTRY . "' group by c.countries_id");
 $store_countrie_values = tep_db_fetch_array($store_countrie_query);
//le choix du client
 $shipping_delivery_query = tep_db_query("select ab.entry_zone_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3 from " . TABLE_COUNTRIES . " c," . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where c.countries_id = '" . (int)tep_db_prepare_input(str_replace("'", "", $_GET['countrieselected'])) . "' group by c.countries_id");
 $shipping_delivery_values = tep_db_fetch_array($shipping_delivery_query);
if ( $shipping_delivery_values['countries_id'] != '' ) {
 $menu_default_countrie = $shipping_delivery_values['countries_id'];
} else {
 $menu_default_countrie = $store_countrie_values['countries_id'];
}
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
if ( $order->delivery['country']['id'] == '' ) {
 if ( $order->customer['country']['iso_code_2'] != '' ) {
	 $default_countrie_zone_id = $order->customer['zone_id'];
	 $default_countrie_id = $order->customer['country']['id'];
	 $default_countrie_iso2 = $order->customer['country']['iso_code_2'];
	 $default_countrie_iso3 = $order->customer['country']['iso_code_3'];
 } elseif ( $shipping_delivery_values['countries_iso_code_2'] != '' ) {
	 $default_countrie_zone_id = $shipping_delivery_values['entry_zone_id'];
	 $default_countrie_id = $shipping_delivery_values['countries_id'];
	 $default_countrie_iso2 = $shipping_delivery_values['countries_iso_code_2'];
	 $default_countrie_iso3 = $shipping_delivery_values['countries_iso_code_3'];
 } else {
	 $default_countrie_zone_id = $store_countrie_values['entry_zone_id'];
	 $default_countrie_id = $store_countrie_values['countries_id'];
	 $default_countrie_iso2 = $store_countrie_values['countries_iso_code_2'];
	 $default_countrie_iso3 = $store_countrie_values['countries_iso_code_3'];
 }
 $order->delivery = array('postcode' => '',
						 'zone_id' => $default_countrie_zone_id,
						 'country' => Array( 'id' => $default_countrie_id, 'title' => '', 'iso_code_2' => $default_countrie_iso2, 'iso_code_3' => $default_countrie_iso3 ));
}
$total_count = $cart->count_contents();
$total_weight = $cart->show_weight();
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping;
$quotes = $shipping_modules->quote();
$erreur_shipping = get_erreur_shipping($quotes);
for ($i = 0; $i < sizeof($quotes); $i++) {
for ($j = 0; $j < sizeof($quotes[$i]['methods']); $j++) {
 if ( ($quotes[$i]['methods'][$j]['cost'] > 0) && ($order->content_type != 'virtual') ) {
	 $quotes_array[] = array('id' => $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], 'text' => $quotes[$i]['module'].' '.$quotes[$i]['methods'][$j]['id']);
//fixer un choix par defaut
	 $default_quotes_array[] = $quotes[$i];
	 if ( $_GET['shippingselected'] != '' ) {
		 $default_shipping_module = str_replace("'", "", $_GET['shippingselected']);
	 } elseif ( $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == DEFAULT_MODE_DELIVRY_SC ) {
		 $default_shipping_module = DEFAULT_MODE_DELIVRY_SC;
	 }
// envoyé le module selctionné (shippingselected ou DEFAULT_MODE_DELIVRY_SC)
	 if ( ($quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'] == $default_shipping_module) ) {
		 $calcul_fdp_scart = $quotes[$i]['methods'][$j]['cost'];
		 $tax_fdp = $quotes[$i]['tax'];
		 $titre_shipping = $quotes[$i]['module'].' ('.$quotes[$i]['methods'][$j]['title'].')';
	 } elseif ( ($quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id']) == ($default_quotes_array[0]['id'].'_'.$default_quotes_array[0]['methods'][0]['id']) ) {
		 $calcul_fdp_scart = $quotes[$i]['methods'][$j]['cost'];
		 $tax_fdp = $quotes[$i]['tax'];
		 $titre_shipping = $quotes[$i]['module'].' ('.$quotes[$i]['methods'][$j]['title'].')';
	 }
 }
}
}
//------------------- fin affiche fdp ----------------------------------------------------
//---------------------- message et calcul free shipping ----------------------------
//client(e) connecté(e)
$customer_sendto_country_query = tep_db_query("select entry_country_id from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$sendto . "'");
$customer_sendto_country_values = tep_db_fetch_array($customer_sendto_country_query);
if ($customer_sendto_country_values['entry_country_id'] != '') {
 $customer_sendto_country_id = $customer_sendto_country_values['entry_country_id'];
} elseif ( $order->customer['country']['id'] != '' ) {
 $customer_sendto_country_id = $order->customer['country']['id'];
} elseif ( $shipping_delivery_values['countries_id'] != '' ) {
 $customer_sendto_country_id = $shipping_delivery_values['countries_id'];
} else {
 $customer_sendto_country_id = STORE_COUNTRY;
}
if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
$shopping_cart_pass = 0;
switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
 case 'national':
 if ($customer_sendto_country_id == STORE_COUNTRY) {
	 $shopping_cart_pass = 1;
 }
 break;
 case 'international':
 if ($customer_sendto_country_id != STORE_COUNTRY) {
	 $shopping_cart_pass = 1;
 }
 break;
 case 'both':
 $shopping_cart_pass = 1;
 break;
}
$fdp_max_scart = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
$fdp_gratuit_scart = ((float)$fdp_max_scart)-((float)$cart->show_total());
if ( ($shopping_cart_pass == 1) && ($cart->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
	 $text_fdp_scart = TEXT_FREE_SHIPPING;
	 $calcul_fdp_scart = 0;
 } elseif ( ($shopping_cart_pass == 1) && ($cart->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
	 $text_fdp_scart = sprintf(TEXT_REST_FREE_SHIPPING, $currencies->format($fdp_gratuit_scart)) . ' ' . $currencies->format(0);
 }
}
// --------------------- fin message et calcul free shipping -------------------
?>
<!-- soustotal fdp total -->
<?php
if ( $order->content_type != 'virtual' ) {
?>
 <p align="left" class="msgfdpgratuitPanier"><?php echo $text_fdp_scart; ?></p>
 <p align="right" class="prixTotauxPanier"><?php if ($order->customer['country']['id'] == '') { echo TEXT_DELIVRY_STATE . tep_draw_pull_down_menu('countrieselected', $countries_array, $menu_default_countrie, 'width="230" style="width: 230px" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php if (sizeof($quotes_array) > 1) { echo TEXT_DELIVRY_TRANSPORTEUR . tep_draw_pull_down_menu('shippingselected', $quotes_array, $default_shipping_module, 'width="230" style="width: 230px" onchange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php if (isset($erreur_shipping) && !isset($default_quotes_array)) { foreach ($erreur_shipping as $erreur_shipping_index => $erreur_shipping_values) { echo $erreur_shipping_values . '<br />'; } } elseif ($default_quotes_array != '') { echo ucfirst($titre_shipping); echo ' : ' . $currencies->display_price((float)$calcul_fdp_scart, $tax_fdp, 1) . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>
 <p align="right" class="prixTotauxPanier"><?php echo SUB_TITLE_SUB_TOTAL; echo $currencies->format($cart->show_total()) . tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></p>
 <p align="right" class="prixST"><?php echo SUB_TITLE_TOTAL; echo $currencies->format(($cart->show_total()) + ((float)$calcul_fdp_scart + tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp))) ;?></p>
<?php
} else {
?>
 <p align="right" class="prixST"><?php echo SUB_TITLE_TOTAL . $currencies->format($cart->show_total()); ?></p>
 </tr>
<?php
}
?>
<!-- fin soustotal fdp total -->
<!-- //############ Fin Frais de port dans le panier by Brouillard s'embrouille ############-->

 

Thank you in advance! This is an awesome sleek add-on for 2.3+ and should be very popular once sorted.

 

Dave

 

shipping methods I am using are fedexwebservices and flatrate


-Dave

Share this post


Link to post
Share on other sites

Tip for cheapest rate:

after

 require(DIR_WS_CLASSES . 'shipping.php');
    $shipping_modules = new shipping;
    $quotes = $shipping_modules->quote();
    $erreur_shipping = get_erreur_shipping($quotes);

add

$cheapest = $shipping_modules->cheapest(); 

Then replace next DEFAULT_MODE_DELIVRY_SC with $cheapest['id']

 

Or something like that I just installed this, unfortunately didn't read this before, as I modified it too much to be able to paste more code.

Share this post


Link to post
Share on other sites

@@nafri Did you find the solution to your issue? I would like to display and calculate the correct tax, also. I can't figure out the formula in the code.

 

@@sembrouille Could you please help us to calculate and display the correct tax? It's a great module besides that minor problem.

Share this post


Link to post
Share on other sites

Hi -

 

as far as I can see the tax code is in there - can you double check that you have a tax rate applied to the shipping module and that the store is set to display prices with tax - in a default store if I have those set and then enlarge the 7% default sales tax to cover all countries and all zones then I get the 7% tax added. If I then restrict it back to (say) just the USA then that works too.

 

Note that it only works on country wide taxes so if, for example, you use the default Florida only 7% tax then you cannot narrow it down that far so if you select USA in the counties dropdown it will not generate a tax value until your into the checkout stream and set shipping address

Share this post


Link to post
Share on other sites

@@Bob Terveuren Thanks. Now I understand better. I'm in the state of Georgia and have the tax set to 7%. The module only calculates the tax based on the shipping. I'm thinking it's suppose to calculate the tax based on the sub-total and shipping. Such as the formula, tax rate * (sub-total + shipping cost) = total price including tax.

 

@@sembrouille Thank you for this module. It helps to accomplish transparency.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×