Describe the bug
Following the merge of https://github.com/PrestaShop/PrestaShop/pull/16207, here is the list of the remaining bugs on this page :
➡️ PR https://github.com/PrestaShop/PrestaShop/pull/17179
➡️ fixed by https://github.com/PrestaShop/PrestaShop/pull/17465 ✅
➡️ we failed to reproduce it


Please note that there might still be some bugs out there...
Additional information
PrestaShop version: 1.7.7.x
PHP version: N/A
For the record: "gift products" display is actually a totally different listing display
so this bug is actually a not-implemented feature that we did not know about 😛
So it'll take some time to do

Voucher gifts product fix #17179
I changed the status to "In Progress" because the PR linked will only fix one bug, not the second one.
@Robin-Fischer-PS not able to replicate the bug with the latest 1.7.7.x branch: When adding a "Free Shipping" voucher on an order (NOT created by checking the "Free Shipping" on the page), and then, checking the "Free Shipping" option on the order, the Shipping price is deducted twice.
@matks done some research on bug 'file name is not displayed in migrated when adding file for a custom product'.
<div class="custom-file">
<input type="file" class="custom-file-input" id="file1">
<label class="custom-file-label" for="file1">Choose file...</label>
</div>
and the migrated page (cart.html.twig):
<script id="js-product-custom-file-template" type="text/template">
<div class="row mt-3">
<div class="col">
{{ requiredFieldMarkTemplate }}
<label for="" class="js-product-custom-input-label"></label>
<div class="custom-file">
<input name="" type="file" class="custom-file-input">
<label class="custom-file-label">
{{ 'Choose file(s)'|trans({}, 'Admin.Actions') }}
</label>
</div>
</div>
</div>
</script>
@tdavidsonas88
- I was confused that in our migrated pages we have this bug but on prestashop-ui-kit it works correctly: (scroll to the bottom of the section to try)
Warning: https://cdn.rawgit.com/PrestaShop/prestashop-ui-kit/master/index.html#forms might not be up-to-date
It looks like we better ask for help the UI Kit Manager @NeOMakinG
@tdavidsonas88 Here is a screenrecord for reproducing this bug :
When adding a "Free Shipping" voucher on an order (NOT created by checking the "Free Shipping" on the page), and then, checking the "Free Shipping" option on the order, the Shipping price is deducted twice.
https://drive.google.com/file/d/1sXSULMDGfz1TMAAqY0noKBKomAXnT41W/view?usp=sharing
On the record, the shipping price is deduced two times, giving a total price of 5.88€ instead of 14.28€ (the price without shipping).
This bug is also here in Legacy 177 but was not present in Legacy 176.
Thank you @Robin-Fischer-PS, I take this issue now.
The easiest suggestion to solve this bug is to disable Free Shipping (Yes/No) toggle button if the user already added the discount voucher with free shipping. If you have a better offer please let me know.
I like this solution (simple and efficient), but we need PM confirmation. @MatShir ?
Edit:
I recommended disabling the input and putting it as uneditable, I find it better rather hide the fields.
Like in the screenshot below:

@tdavidsonas88 Do you think you will be able to do it easily? So if I deleted a cart rule with free shipping in a new order, it will enable the toggle and vice versa.
@tdavidsonas88 Do you think you will be able to do it easily? So if I deleted a cart with free shipping in a new order, it will enable the toggle and vice versa.
@MatShir Plan to submit solution PR today. There is some complexity because it is javascript code. For deleting cart for already created order case is one I have not thought about initially so let me try it out
@matks In the middle of implementing the disable solution found out it is not that simple and many .js files need to be changed. Not even started to implement vice versa solution for not to allow the voucher with free shipping added if free shipping is already enabled. Now it seems to me that throwing exception from the backend could be easier - just would need some creative ideas how to handle exception and show a nice message to the user. I think this solution is more beautiful for the user to interact but not the simplest to develop
Looks like was able to finish one part of the solution today: for disabling the toggle. However would like to do more testing tomorrow and also finish the part with not allowing to add "Free Shipping" if there is cart rule with the free shipping already. Plan to provide PR tomorrow.
Looks like was able to finish one part of the solution today: for disabling the toggle. However would like to do more testing tomorrow and also finish the part with not allowing to add "Free Shipping" if there is cart rule with the free shipping already. Plan to provide PR tomorrow.
I'm actually worried it took 1 day, in my mind it's not supposed to be too hard 😅 . Can you push a draft PR with your code so we can check it ?
Looks like was able to finish one part of the solution today: for disabling the toggle. However would like to do more testing tomorrow and also finish the part with not allowing to add "Free Shipping" if there is cart rule with the free shipping already. Plan to provide PR tomorrow.
I'm actually worried it took 1 day, in my mind it's not supposed to be too hard . Can you push a draft PR with your code so we can check it ?
@matks Already created a normal PR, finished this morning. It took a bit more 1 hour less than one day. Your guidance helped me a lot :slightly_smiling_face:
So if I deleted a cart with free shipping in a new order, it will enable the toggle and vice versa.
@MatShir Well if you delete the cart then it is not possible to create new order from the deleted cart. And if you create the order with the cart then it is not allowed to delete the cart. Maybe I don't understand something?
Hi @tdavidsonas88, sorry I meant the cart rule
It seems latest issue has been moved to https://github.com/PrestaShop/PrestaShop/issues/17875
@Robin-Fischer-PS @MatShir can I close this issue now ?
So it seems the last bug in this issue is the counterpart of https://github.com/PrestaShop/PrestaShop/issues/17875 but in BO 😄
FYI @matks , we also need https://github.com/PrestaShop/PrestaShop/pull/17179 to finish this issue :)
As discussed here we await for the specs for the behavior of the "free gift" cart rule in order to avoid additionnal back-and-forths with QA
I thought this issue was meant to fix the last bug that was supposed to be fixed by Tadas.
IMO, the "free gift cart rule" behaviours are to be managed in this issue : https://github.com/PrestaShop/PrestaShop/issues/18119.
I'm currently updating the issue with the specs.
After discussing with @matks, we've decided we can close this issue as most of the work has been done. There are 2 bugs left related to this issue, issues have been added to the 1.7.7 kanban:
FYI @Robin-Fischer-PS