I'm having some difficulty getting a custom form to work. I have set up the capability to designate a product a gift for someone else. Currently, I have instructed the customer to change the shipping address to the name and address of the gift recipient. Some have complained that the approach is confusing (maybe my wording is unclear) and the customer can't order products that are not gifts in the same order. So I am setting up a form that comes up when the "gift" is added to the cart. I have made a file for use in extra_cart_actions that detects the gift and brings up a form. Since I want name, address, email address, telephone etc. the code for the form is a modified version of create_account.php and the related template files.

The file in extra_cart_actions is correctly loading the equivalent of create_account.php. On the first pass through that file, some variables are set. Then the template should be drawn based on the equivalent of tpl_create_account_default.php. But the processing flow never gets to that file. The weird thing about this is that it worked properly all the way through, including displaying the form, processing the entered data and completing adding the gift to cart exactly once. After going into some unrelated code to send the gathered data in an email, and coming back and purchasing the gift again, the form never comes up. Instead, the product is added to the cart as usual and no data on the recipient is generated.

After debugging, I found that the equivalent of tpl_create_ account_default.php was never entered. So how does code execution go from create_account.php to tpl_create_account_default on the first pass when the form should be drawn? I'm stuck.

Zen cart version 155f, php version 7.1.x

TIA for any help.

Dave