Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping in cart


sembrouille

Recommended Posts

  • 2 weeks later...

Hi

 

Very good contribution, I use it :).

 

1) /catalog/includes/fdp_panier.php

 

FIND (at the end of file) :

 

<!-- soustotal fdp total -->

<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 ($erreur_shipping != '') { echo $erreur_shipping; } 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()) + tep_add_tax((float)$calcul_fdp_scart, $tax_fdp)); ?></p>

 

<!-- fin soustotal fdp total -->

<!-- //############ Fin Frais de port dans le panier by Brouillard s'embrouille ############-->

 

 

REPLACE :

 

<!-- soustotal fdp total -->

<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 ($erreur_shipping != '') { echo $erreur_shipping; } elseif ($default_quotes_array != '') { echo ucfirst($titre_shipping); echo ' : ' . $currencies->format(((float)$calcul_fdp_scart + tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp))) . 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>

 

<!-- fin soustotal fdp total -->

<!-- //############ Fin Frais de port dans le panier by Brouillard s'embrouille ############-->

Link to comment
Share on other sites

Hi

 

it is a very good contribution, and many thanks for your help.

 

The change adds tax to the shipping .

what is was looking for was somehing like this

 

Product cost (ex tax)

Shipping cost (ex tax)

Subtotal (ex tax)

Tax

Total including tax.

 

What i have right now is

 

 

Product cost (ex tax)

Shipping cost (with tax)

Subtotal (ex tax)

Total (ex tax).

 

 

i am missing total tax and final total to include tax.

Link to comment
Share on other sites

"tax/VAT is not being added to the total. Also it doesnt display vat in the shopping cart."

 

You want to show the tax : (the rate of the tax) with the price or the description (20% tax) ?

 

Note: there are two taxes (product tax and shipping tax)

 

Link to comment
Share on other sites

hi

 

i made the changes above...but it adds tax to shipping..

 

i want to show the total tax with discription as it shows in checkout _confirmation.. The total tax is (product tax and shipping tax). final total will then include sum of all..

 

for example like this

 

product :£29.99

 

Sub-Total:£29.99

 

Flat Rate (Best Way):£5.00

 

Vat 20%:£7.00

 

Total:£41.99

Link to comment
Share on other sites

like that ? :

 

<!-- soustotal fdp total -->

<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 ($erreur_shipping != '') { echo $erreur_shipping; } elseif ($default_quotes_array != '') { echo ucfirst($titre_shipping); echo ' : ' . $currencies->format(((float)$calcul_fdp_scart + tep_calculate_tax((float)$calcul_fdp_scart, 0))) . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></p>

 

<p align="right" class="prixTotauxPanier"><?php echo TITLE_SHIPPING_INCLUDE_TAX . ' : (' . $tax_fdp . '%) ' . $currencies->format((tep_calculate_tax((float)$calcul_fdp_scart, $tax_fdp)));?></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>

 

<!-- fin soustotal fdp total -->

<!-- //############ Fin Frais de port dans le panier by Brouillard s'embrouille ############-->

 

Link to comment
Share on other sites

hi mate

 

many thanks for helping me here.I think there is still a small issue..

 

With your last change i am getting this (after changing order of few lines)

 

Sub-Total:£29.99

Flat Rate (Best Way) : £5.00

 

TITLE_SHIPPING_INCLUDE_TAX : (20%) £1.00

Total:£35.99

 

I should be getting

 

 

Sub-Total:£29.99

Flat Rate (Best Way):£5.00

TITLE_SHIPPING_INCLUDE_TAX : (20%) :£7.00

Total:£41.99

 

TITLE_SHIPPING_INCLUDE_TAX must include (tax of shiiping +tax of product)

 

Total must be (subtotal+shipping+tax)

Edited by nafri
Link to comment
Share on other sites

  • 4 weeks later...

Very useful contribution, I just have one small problem.

 

The text that displays how much more money you need to spend for free shipping always has £0.00 at the end.

I wanted to remove it but no luck, would really appreciate if someone can help me to remove the £0.00.

 

Thanks

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

Hi,

 

 

 

Box Shopping:

in /includes/functions/general.php

 

Find:

 

$text_fdp_sboxe = '<span class=msgfdpgratuit>' . sprintf(TEXT_REST_FREE_SHIPPING, $currencies->format($fdp_reste_sboxe)) . ' ' . $currencies->format(0) .'</span>';

 

 

Replace:

 

$text_fdp_sboxe = '<span class=msgfdpgratuit>' . sprintf(TEXT_REST_FREE_SHIPPING, $currencies->format($fdp_reste_sboxe)) .'</span>';

 

 

For the text:

 

in /includes/languages/english.php

 

You can change the text in:

define('TEXT_REST_FREE_SHIPPING', 'The text that you like ...');

 

************************************************** ***********************

 

Shopping cart:

 

in /includes/fdp_panier.php

 

Find:

$text_fdp_scart = sprintf(TEXT_REST_FREE_SHIPPING, $currencies->format($fdp_gratuit_scart)) . ' ' . $currencies->format(0);

 

 

Replace :

 

$text_fdp_scart = sprintf(TEXT_REST_FREE_SHIPPING, $currencies->format($fdp_gratuit_scart));

 

 

For the text:

 

in /includes/languages/english.php/shopping_cart.php

 

You can change the text in:

define('TEXT_REST_FREE_SHIPPING', 'The text that you like ...');

 

Link to comment
Share on other sites

I had a problem with this addon, in that shipping costs were being added to virtual products. I dont know if you were aware of this bug or not.

 

I amended the code in the shopping_cart.php file so that it looked like

 

<?php

if ($cart->show_weight()== 0) {

echo '<p align="right"><strong>' . SUB_TITLE_SUB_TOTAL . $currencies->format($cart->show_total()) . '</strong></p>';

} else {

include(DIR_WS_INCLUDES . 'fdp_panier.php');

}

?>

 

This made this addon work for me.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

hi!

thank you very much for your great contribution!

I've a little problem that I can't understand how to resolve.

 

The total cost it's regulary calculated, but it show a wrong shipping cost, actually it always show a cost of 21€....

 

for example, with real shipping cost of 10 euros, it show me:

 

shipping cost: € 21

sub-total: € 100

total: € 110

 

do you have any idea? where I'm wrong?

thank you very much

Riccardo

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
  • 1 month later...

Are there any pre-requisites for using this contrib?

 

For example, when users select their country and mode of transport, where does it get the costs from?

 

Do I firstly have to set up shipping zone rates to specifiy this?

 

Sorry if this is a silly question, I'm very new to all this.

Link to comment
Share on other sites

Thanks, yes that did help, I think I have it all working now.

 

Does anybody know how to change the dropdown menu to show a specific country as the default?

 

I have managed to achieve this for the other dropdown menus on my site by editing the includes/functions/html_output.php

From this:

 

function tep_get_country_list($name, $selected = '', $parameters = '') {

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

 

To this:

 

function tep_get_country_list($name, $selected = '222', $parameters = '') {

$countries_array = array(array('id' => '222', 'text' => 'United Kingdom'));

 

But it didn't affect this one?

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...

I have this installed and love it.

 

Is there any way to get the shipping costs to show in the dropdown, rather than when the page refreshes after selecting a shipping method.

 

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

Edited by Bob Terveuren
Link to comment
Share on other sites

  • 1 month later...

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...