Giftwrapping

no check box - Giftwrapping

no check box

by Omar_one » Mon Apr 19, 2021 8:04 pm

Hello @Kofod95,
Thank you for updating this add-on. I can't choose gift wrapping option in checkout_shipping.php its uncheckable and there is no check box as the old one
wrapgift.JPG
CE Phoenix v1.0.8.1

Thank you in advance
Omar
Omar_one
VIP Member
VIP Member
Posts: 483
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: no check box

by Kofod95 » Mon Apr 19, 2021 8:35 pm

Thank you for reporting, Omar_one. I will take a look as quickly as I can, and see what stupid mistake I have made.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 611
Joined: Sat Feb 06, 2021 7:38 pm
Contact:

Re: no check box

by Kofod95 » Tue Apr 20, 2021 5:07 am

I see.
Accidentially, I marked this as compatible with 1.0.8.1. The checkbox and forms in general was changed there, if I remember correctly, so I'll upload a new revision suited for that. ETA: Tomorrow.
Sorry for the inconvenience!

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 611
Joined: Sat Feb 06, 2021 7:38 pm
Contact:

Re: no check box

by Kofod95 » Wed Apr 21, 2021 9:00 am

I was sort of right, but not really. All it needed to function was a class added to the checkbox, as it else defaults to form-control, which is not visible in this case. I updated the tep_draw_checkbox_field to a tep_draw_selection_field now I was at it. This is tested on a fresh install of 1.0.8.1, and have the benefit of a class added to the checkbox-field, so you get the CSS-power to style it - I should have done that in the first place...

Just to mention it - I might make the width adjustable from Admin, as well as a few other small improvements next time it needs to be updated for a new version of Phoenix. Feedback is very much welcome!

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 611
Joined: Sat Feb 06, 2021 7:38 pm
Contact:

Re: no check box

by Omar_one » Wed Apr 21, 2021 5:14 pm

Thank you Daniel,
the checkbox show now.. the the cost not shown in checkout_confirmation.php or on the order after it's done.
and there is this issue
in the admin the cost not shown it show 0
wrapgift1.JPG
Attachments
wrapgift2.JPG
Omar_one
VIP Member
VIP Member
Posts: 483
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: no check box

by Kofod95 » Thu Apr 22, 2021 8:58 am

Thanks again. Sorry to have been to quick, now corrected so it shows up.
The Admin-problem I cannot recreate - Does it help you to remove and reinstall? Sorry to be so basic, but it works for me, and I cannot see why it should not work on your end as well. I'll await your response before uploading a new revision, to make sure I haven't missed anything.
giftwrap_cost.png
giftwrap_cost.png (7.85 KiB) Viewed 84 times
To correct the first error change line 29 in templates/override/includes/hooks/shop/checkout_shipping/giftwrap.php from:

Code: Select all

$gift_wrap = isset($_POST['gift_wrap']) ? true : false;
to:

Code: Select all

$_SESSION[$gift_wrap] = isset($_POST['gift_wrap']) ? true : false;
And line 22 in includes/modules/order_total/ot_giftwrap.php from:

Code: Select all

if ($gift_wrap == 'true') {
to:

Code: Select all

if ($_SESSION[$gift_wrap] == 'true') {
There are a few other things to do, but they will come with the revision.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 611
Joined: Sat Feb 06, 2021 7:38 pm
Contact:

Re: no check box

by Omar_one » Thu Apr 22, 2021 3:44 pm

Well done Daniel, now it shown in checkout_confirmation.php and on the order after it's done.
Kofod95 wrote: The Admin-problem I cannot recreate - Does it help you to remove and reinstall? Sorry to be so basic, but it works for me,l
reinstall it but its not help ,,, but its not that importing as its not make on any issue ,

Thank you
Omar_one
VIP Member
VIP Member
Posts: 483
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: no check box

by Omar_one » Thu Apr 22, 2021 4:03 pm

now I will try to show it on the payment module. I had it working on the old one ,, maybe payment module to update
Omar_one
VIP Member
VIP Member
Posts: 483
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: no check box

by Omar_one » Thu Apr 22, 2021 5:30 pm

BTW I install it on 1.0.8.2 .. working as it should.. just admin issue still ..
Omar_one
VIP Member
VIP Member
Posts: 483
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: no check box

by Kofod95 » Fri Apr 23, 2021 7:55 am

I'm glad it's working, and that you don't mind the issue you have!
Omar_one wrote:now I will try to show it on the payment module. I had it working on the old one ,, maybe payment module to update
You should be able to use the

Code: Select all

if ($_SESSION[$gift_wrap] == 'true'){
 //Echo giftwrap and price
In the payment-module - you can find the variables to show in ot_giftwrap.php, but propably need to add the language in the payment-module language file. Adding a hook-call and building a new hook to show it there might be the best option for updates, as it's only one line in one file instead of multiple lines in module and a new constant in the language file - I'll happily help you, if you need it, but I have seen from other posts you have made, that you know what you are doing (most likely better than I do)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 611
Joined: Sat Feb 06, 2021 7:38 pm
Contact: