Page 1 of 1

Checkout Shipping Address issue

Posted: Fri Mar 17, 2023 12:20 pm
by radhavallabh
Hi dear;
I am facing a weird issue.
Using 1.0.8.20 and PHP 8.0

On checkout_shipping.php I click to add a new delivery address-
Then on checkout_shipping_address.php I fill in the new delivery address-
On clicking submit it redirects to checkout_shipping.php-
but then it does not update the new address there still shows the registered address.

I checked address book the address I feed on the checkout_shipping_address.php do get updated there. But do not automatically reflect on checkout_shipping.php

I get this warning on checkout_shipping_address.php -
Warning: Undefined array key "sendto" in /xx/xx/xx/includes/system/versioned/1.0.7.10/cart_order_builder.php on line 68

Can you please guide me where the issue is...
Really need to fix this...

Thank you in advance;
Very Warm Regds./
radhavallabh

Re: Checkout Shipping Address issue

Posted: Sat Mar 18, 2023 10:50 am
by ecartz
radhavallabh wrote: Fri Mar 17, 2023 12:20 pm Warning: Undefined array key "sendto" in /xx/xx/xx/includes/system/versioned/1.0.7.10/cart_order_builder.php on line 68
On checkout shipping, you should be running this database hook: https://github.com/CE-PhoenixCart/Phoen ... .sql#L1150

The net result of that is that the sendto should get set on the session. By the time that you get to checkout_shipping_address, it should simply be set. Then you should be updating it on the form submission: https://github.com/CE-PhoenixCart/Phoen ... ss.php#L32

Re: Checkout Shipping Address issue

Posted: Sat Mar 18, 2023 12:51 pm
by radhavallabh
ecartz wrote: Sat Mar 18, 2023 10:50 am
radhavallabh wrote: Fri Mar 17, 2023 12:20 pm Warning: Undefined array key "sendto" in /xx/xx/xx/includes/system/versioned/1.0.7.10/cart_order_builder.php on line 68
On checkout shipping, you should be running this database hook: https://github.com/CE-PhoenixCart/Phoen ... .sql#L1150

The net result of that is that the sendto should get set on the session. By the time that you get to checkout_shipping_address, it should simply be set. Then you should be updating it on the form submission: https://github.com/CE-PhoenixCart/Phoen ... ss.php#L32
Thank you dear;
I verified both these are in place...
But still my address does not update on the checkout_shipping page, It even does not update if I select a previously feeded address too....

Please can you help me understand the issue dear...
Thank you in advance;
Very Warm Regds./
radhavallabh

Re: Checkout Shipping Address issue

Posted: Sat Mar 18, 2023 2:06 pm
by ecartz
What exactly don't you understand that you want me to explain?

I don't know why it isn't working on your site. It works on my test site, which is running 1.0.8.21. As far as I know, it is working on other people's sites. You're the only one reporting a problem. This suggests that there is something different about your site that is preventing it from working. I don't know what that is.

If this were a common problem, perhaps I could say more. There have been other problems that occur sometimes and we can advise as to what caused them in previous cases. But in this case, the problem seems to be unique to you. I can only tell you how things are supposed to work; how they work on my test site; and potentially what configuration issues may have caused problems previously.

For troubleshooting, the question is if the various pieces of code are running. You could add debugging code, e.g.

Code: Select all

echo 'Made it to ' . __LINE__ . ' of ' . __FILE__ . '.<br />' . PHP_EOL;
to checkout_shipping_address.php

Is the form valid? Is there an error somewhere?

Beyond that, the only real advice I have is to get a developer to do that debugging and find where the code is not setting the sendto. You could also try installing an absolutely vanilla copy of 1.0.8.21 and seeing if that works. That would at least eliminate add-on/customization as being the cause.

Re: Checkout Shipping Address issue

Posted: Sat Mar 18, 2023 2:30 pm
by radhavallabh
Thank you dear it does make it to line 65 of the file on adding that code; So the form is loading fine with no errors..
I still get this error
Attaching Xdebug screenshot
Screenshot 2023-03-18 195938.png

Code: Select all

Warning: Undefined array key "sendto" in /home/faitwftu/public_html/includes/system/versioned/1.0.7.10/cart_order_builder.php on line 68
Thank you again;
Warm Regds./
radhavallabh

Re: Checkout Shipping Address issue

Posted: Sat Mar 18, 2023 4:24 pm
by ecartz
radhavallabh wrote: Sat Mar 18, 2023 2:30 pm Thank you dear it does make it to line 65 of the file on adding that code; So the form is loading fine with no errors..
Well, we already knew that it was loading. Because you could see it. The question is if you are making it to line 32, which is inside two if statements. That tells you if the form is being processed on submission. Or line 41 if you are selecting an existing address.

Also, lines 62 and 67 in https://github.com/CE-PhoenixCart/Phoen ... ut.php#L62

You also might check if you are losing the session. But if that were it, I would expect you to get requests to log in.

Re: Checkout Shipping Address issue

Posted: Sun Mar 19, 2023 7:22 am
by radhavallabh
ecartz wrote: Sat Mar 18, 2023 4:24 pm
radhavallabh wrote: Sat Mar 18, 2023 2:30 pm Thank you dear it does make it to line 65 of the file on adding that code; So the form is loading fine with no errors..
Well, we already knew that it was loading. Because you could see it. The question is if you are making it to line 32, which is inside two if statements. That tells you if the form is being processed on submission. Or line 41 if you are selecting an existing address.

Also, lines 62 and 67 in https://github.com/CE-PhoenixCart/Phoen ... ut.php#L62

You also might check if you are losing the session. But if that were it, I would expect you to get requests to log in.
I checked again and the checkout_shipping_address parsed well at each point. Which made me think to look somewhere else.
Sorry for the trouble dear;
Finally fixed it, It was a CDN related issue-cache was saving the copy, had to change some settings for fixing it.

Thank you again
Very Warm Regds./
radhavallabh