kongondo Posted August 6 Share Posted August 6 (edited) Padloper 010 Padloper 010 (aka Padloper 2 version 010) is ready for download. Requirements PHP>= 8.2.0 ProcessWire>=3.0.200 Maintenance Padloper 010 is mainly a maintenance release: Fixes money rounding bugs found in Padloper 009 (and earlier). Adds the Money for PHP Library to handle monetary values in an easy and powerful way. Fixes money math issues when prices include tax. For the sake of internal maintenance, reorganises files and directory structure. Money Matters Specifically regarding 'prices include tax', and I will be adding this to the docs, it is important that you display your prices in the frontend in a way that doesn't confuse consumers. This is not unique to Padloper but a general e-commerce issue. This means making careful decisions around displaying unit vs total prices as well as whether to include notes about potential rounding pence/cents issues in your shop's policy documents. Due to rounding issues (pence, cents, etc) when it comes to money, especially if quantity is more than 1, the math might look off. I.e., (item * quantity) + tax IS NOT NECESSARILY EQUAL TO (item + tax) * quantity. See this article for a thorough discussion. Breaking Changes There are a few unavoidable breaking changes due to code rationalisation. API Some API had to be changed for maintenance and usage simplicity reasons. This affects checkout, cart and discounts. For instance: <?php namespace ProcessWire; # OLD API $checkout = $padloper->checkout; $response = $checkout->render($options); # NEW API // $response = $padloper->render($options);// this will be deprecated in a future release $response = $padloper->renderCheckout($options); ########## # OLD API $cartRender = $padloper->cartRender; $content = $cartRender->editCart(); # NEW API $content = $padloper->editCart(); ########## # OLD API $cartRender = $padloper->cartRender; $content = $cartRender->viewCart(); # NEW API $content = $padloper->viewCart(); HOOKS Backend hooks rename: // OLD NAMING FORMAT PadloperProcessRenderXXX e.g. PadloperProcessRenderOrders // NEW NAMING FORMAT PadloperAdminRenderXXX e.g. PadloperAdminRenderOrders Other hooks rename: // OLD NAMING FORMAT PadloperXXX::methodName e.g. PadloperUtilities::getProductWeight, PadloperCart::getProductPrice // NEW NAMING FORMAT Padloper::methodName e.g. Padloper::getProductWeight, Padloper::getProductPrice Upgrading Replace all files (not overwrite!). This is because some files have been deprecated, renamed or moved. Safest way to upgrade is to get rid of all existing Padloper files and folders under /site/modules/Padloper/ and then copy over the new 010 files and folders then do a module refresh. New Features The two new features are: $padloper->money(); More information will be added to docs. Bank Name as a property (bankAccountName) in the return value of $padloper->getShopBankDetails();. See request in this topic. Next Steps As mentioned in Padloper 009 topic, the focus now will be the documentation. Any questions or issues, please let me know. Thanks. Edited August 30 by kongondo 2 Link to comment Share on other sites More sharing options...
kongondo Posted August 22 Author Share Posted August 22 Hi, I have updated the download to fix: File naming error (on Linux systems). Missing methods editCart() and viewCart(). Thanks. Link to comment Share on other sites More sharing options...
Pete Posted September 8 Share Posted September 8 @kongondo I am still on 008 (well as you know somewhere between 8 and 9 😅) - should I go through 009 to get to 010? I'm thinking probably yes - if it enables me to better understand all the changes with the amount of custom tweaks I have on my site and make sure they all get re-applied. 1 Link to comment Share on other sites More sharing options...
kongondo Posted September 10 Author Share Posted September 10 Hi @Pete, On 9/8/2024 at 4:19 PM, Pete said: should I go through 009 to get to 010? Defo! And carefully! 😀. On 9/8/2024 at 4:19 PM, Pete said: enables me to better understand all the changes with the amount of custom tweaks I have on my site and make sure they all get re-applied. Yes. But we need to come up with a way to have your custom tweaks applied without touching Padloper itself. Are you able to capture these in one document? Even a git diff would do, but an annotated document is better, i.e. did this here, because...etc. Thanks! 1 Link to comment Share on other sites More sharing options...
Pete Posted September 10 Share Posted September 10 I think for mine what I'll need to do is a diff between the last unaltered source code I have and my code to play "spot the difference" then I can write it in a doc and send it to you. Some were improvements that might be beneficial to all, others were workarounds for very specific things... and others still were files written for you but only for my project so sounds like a bit of a nightmare to update without losing anything (hence why I've been putting it off if I'm honest). I'll need to get it done this month at any rate so I'll let you know. At least when I have the doc I'll also know what to check for on each update. 1 Link to comment Share on other sites More sharing options...
Spinbox Posted September 10 Share Posted September 10 Great stuff! I had some problems when having FormBuilderProcessorStripe installed. It couldn't find the module's file. I just removed the module completly so can't give any more insights. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now