Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price ranges on Carriers are not managed properly when mode B2B enabled and prices without taxes #29556

Open
2 tasks done
OliverCG opened this issue Sep 6, 2022 · 4 comments
Labels
1.7.7.8 Affects versions B2B Bug Type: Bug Carriers Label: Which BO under menu is concerned FO Category: Front Office Needs Specs Status: issue needs to be specified Shopping carts FO All the issues related to the Front Office Shopping Cart Waiting for PM Status: action required, waiting for product feedback

Comments

@OliverCG
Copy link
Contributor

OliverCG commented Sep 6, 2022

Prerequisites

Describe the bug and add screenshots

Hi,

I think I've found an issue where the price ranges when editing an existing carrier is not managed properly. Right now, I enabled the following settings:

  • B2B Mode enabled under Preferences -> Customer settings.
  • When editing customer group(s), set to show prices without taxes all over the shop.

Now, that all the shop is managing everything without taxes, I mean, product prices, even shipping costs, go to Carriers and edit one of them.

If you go to the second tab (Destinations and shipping costs), set the price by range depending on the order total and set more than one range like these:

Captura de Pantalla 2022-09-06 a las 17 01 45

In Spain, the shipping costs also have their taxes, so I've indicated to include VAT in the end too.

In the different columns, I want to indicate that the different shipping costs are 8€, 15€, etc. which is working fine but not the price ranges their selves. What I want to indicate is price range VAT excl. so, for example:

  • Orders between 0 and 100€ (order total without taxes nor shipping costs) -> 4€ for Madrid.
  • Order with value higher than 100€ (again, order total without taxes nor shipping costs) -> free shipping.

If I go to the FrontOffice now and starting to add some products, I can see that only if the order with taxes is higher than 100€, I get free shipping which is totally wrong or not what I expected. In the end, it's not clear that the price ranges are taxes includes or, at least, I don't find where to confirm it except for the results after making a test from the FrontOffice.

Example of an order to Madrid with order total with taxes higher than 100€ where you can see the free shipping.
Captura de Pantalla 2022-09-06 a las 17 15 06

NOTE: Some English translations of menus or element may be different since my PrestaShop is configured in Spanish and I'm translating them on the fly.

Expected behavior

I expected to indicate price ranges taxes excludes, as I indicated with the B2B mode and also in the customer group.

Steps to reproduce

  1. Set B2B mode enabled in Preferences -> Customer settings.
  2. Set "Show prices" without taxes on the customer groups, so your customers always see the prices without taxes.
  3. Introduce a new carrier (or configure a current one), set prices by order total, and insert one of various ranges in the second tab.
  4. Once you've finished with the carrier, make a test through the FrontOffice, and you'll see that the ranges are calculated by using the order total with taxes.
  5. For that, the prices ranges must be introduced taxes included.

PrestaShop version(s) where the bug happened

1.7.7.4

PHP version(s) where the bug happened

7.3.33

If your bug is related to a module, specify its name and its version

No response

@OliverCG OliverCG added Bug Type: Bug New New issue not yet processed by QA labels Sep 6, 2022
@florine2623
Copy link
Contributor

Hello @OliverCG ,

I have reproduced your case. I'm wondering if this is the expected behavior.
I'll ping the product team to have more info on it.

Please stay tuned!
Thanks!

@florine2623
Copy link
Contributor

@PrestaShop/product-team ,
When the prices are displayed tax excl. on the whole shop for a customer group, is it the expected behavior to calculate the shipping cost on the final price (tax incl.) or on the actual price (tax excl.)?

Example :
I have a carrier configured like this:
Cart < 100€ -> shipping cost 4€
Cart > 100€ -> shipping cost FREE
Screenshot 2022-09-07 at 18 31 19

In my cart, the actual price of my products is < 100€, my shipping cost should be 4€, but it is FREE.
Only the total price, tax incl. is > 100€.
Screenshot 2022-09-07 at 18 32 49

Can you confirm the behavior please ?
Thanks!

@florine2623 florine2623 added FO Category: Front Office Carriers Label: Which BO under menu is concerned Shopping carts FO All the issues related to the Front Office Shopping Cart B2B 1.7.7.8 Affects versions NMI Status: issue needs more information and removed New New issue not yet processed by QA labels Sep 7, 2022
@OliverCG
Copy link
Contributor Author

OliverCG commented Sep 7, 2022

Hi @florine2623,

Sure, I'll stay tuned and eager to help with this issue. As you could reproduce it and in my opinion, it's not intuitive, specially for B2B e-commerce where the taxes are not so important. I understand that the shipping costs are tax excl. since I can select the tax through the dropdown list so, if it's the normal behavior, why don't let us select if the price ranges should be introduced with or without tax too from this same carrier settings page?

In fact, it could be even more confusing. For example, I manage a B2B PrestaShop where my customer needs to apply different VAT rates between 4 - 21%. If the price ranges are introduced tax incl., the customer may be paying products between 82,64 (VAT 21%) and 96,15 (VAT 4%) which is more than €12 of profit difference.

Let's see what the product team has to say! :)
Thank you.

@AureRita AureRita added the Waiting for PM Status: action required, waiting for product feedback label Sep 9, 2022
@hibatallahAouadni hibatallahAouadni added Needs Specs Status: issue needs to be specified and removed NMI Status: issue needs more information labels Sep 12, 2022
@OliverCG
Copy link
Contributor Author

OliverCG commented Sep 20, 2022

Hi,

After investigating this issue, I think I've found where the bug is. We can see the following code on lines 3578 and 3579 of the file Cart.php for PrestaShop 1.7.7.4:

// Order total in default currency without fees
        $order_total = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list, $id_carrier, false, $keepOrderPrices);

As we can see, the $order_total variable is always tax includes since the function getOrderTotal is called with the first parameter set as true. I'm not sure how to solve it, but a fix could be to use the var $use_tax instead of that parameter, so the getOrderTotal function is called with or without tax depending on how the parent function was called. In fact, that comment is not very clear. In the end, I would change it to something like:

// Order total in default currency without shipping fees
        $order_total = $this->getOrderTotal($use_tax, Cart::BOTH_WITHOUT_SHIPPING, $product_list, $id_carrier, false, $keepOrderPrices);

Hope it helps to continue with the issue.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.7.8 Affects versions B2B Bug Type: Bug Carriers Label: Which BO under menu is concerned FO Category: Front Office Needs Specs Status: issue needs to be specified Shopping carts FO All the issues related to the Front Office Shopping Cart Waiting for PM Status: action required, waiting for product feedback
Projects
None yet
Development

No branches or pull requests

4 participants