Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

classes/cart.php TB vs PS 1.6 code - can I replace?

Featured Replies

I'm still trying to get the issue at the end of this post fixed. For that, I'd like to replace the code in classes/cart.php TB with the code in PS 1.6. Can anyone see estimate whether it's safe to do so? 

PS 1.6 code via https://github.com/PrestaShop/PrestaShop-1.6/blob/master/classes/Cart.php

TB code via https://github.com/thirtybees/thirtybees/blob/1.1.x/classes/Cart.php

 

Edited by 30knees

Solved by datakick

  • Author

Update: Replacing cart.php fixes this bug ... I just don't know whether there might be any other issues that pop up. I think it would be better to pinpoint the problem in cart.php and do a targeted fix.

 

  • Solution
On 12/13/2020 at 9:10 AM, 30knees said:

Update: Replacing cart.php fixes this bug ... I just don't know whether there might be any other issues that pop up. I think it would be better to pinpoint the problem in cart.php and do a targeted fix.

 

Please don't do that, this is one of the most important part of the code. It's like replacing car engine because your 'Check engine' light is on.

  • Author

Thank you for the (fun) reply. 🙂 I’m having trouble finding someone who would take the paid time to properly transpose the proper element from the PS cart.php to the tb cart.php. It’s an important element for me - more than just a ‘check engine light’. 😅

Essentially he wants a constant carrier price with tax included, while the tax rate changes according to the kind of products in the cart.

To reproduce this, one needs products with distinct tax rate (e.g. German VAT with 7% and 19%) and one of each tax rate in the cart. Also, set the carrier to "no taxes". Third, install module AEUC and enable 'Proportionate tax for shipping and wrapping' there. The latter after setting the carrier to no taxes, because this AEUC setting happens to remove the tax selector on the carrier configuration page. This switch in AEUC sets configuration 'PS_ATCP_SHIPWRAP', which changes behavior in quite a number of places in core code.

Current behavior is, carrier price is taken as without taxes, average tax rates of both products get applied on top. Which increases shipping costs seen by the customer. If one increases the number of products with the lower tax rate in the cart, shipping costs get reduced (less increased), due to the lower average tax rate. Increasing the number of products with the higher tax rate accordingly raises shipping costs.

What @30knees expects is to adjust shipping costs without tax according to the calculated average tax rate. This way the customer would see a constant price, while the price recorded in core changes. Certainly possible in theory, but to my understanding all price calculations in core are based on a fixed price without tax, so one would have to overhaul half of core to allow price calculations in the opposite direction.

Perhaps you have some luck and find some magic place to implement this without a dozen overrides 🙂

  • Author

Thank you, @Traumflug. But what is the behavior shown on PS 1.6 cart.php if not what I’m looking for? I’d be happy for an explanation instead of a dismissal. 🙂

  • 3 weeks later...
  • Author

An update 

Reverting to PS 1.6 cart.php leads to errors elsewhere, eg a wrong shipping price is displayed during the checkout. So one would need to audit the whole code and it's not clear how much effort that would take. 

Unfortunately, this means that invoices with products that have mixed tax rates will remain non-compliant in Germany. Or you have compliant invoices but you can't tell the customer the gross shipping price in advance because the shipping price is calculated based on the net price and the 'proportional taxes' depend on the exact mix of tax rates resulting from the products in the shopping cart.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.