Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

checkout_success.php form and related modules


Demitry

Recommended Posts

Hi,

I’m finishing up a module for the checkout success page. It’s a short email form designed to get customer feedback on their purchase experience right at the final step in the checkout process. I could store their feedback in the database, but this is bad because it will quickly bloat the database.

There are two issues that I am facing with this modification.

First: While writing this module, I realized that this checkout_succes page contains all of the modules inside a form. I’m a bit confused about this form because It is designed to update any customer changed data inside of it (such as product notifications and/or PWA keep account), but the button included inside this form is the Continue button, which redirects the user to the index.php page.

So, if a customer makes changes on this form and does not click the Continue button, but instead closes the browser tab, then all of their changes are not saved to the database, right?

The point is, many other osC pages apply the Continue button to load the index.php page. Having been on the site, a customer quickly becomes aware of this and may opt to not click that button on the checkout_success page because they are finished shopping and do not want to go to the home page. Additionally, they are likely to believe that their selections on that page are automatically saved upon any changes they make. Why? ..well, because there is no button to save the changes.

Therefore, shouldn’t that Continue button be renamed to Update Changes or Save Changes? And, there should be a message displayed on the index.php page post redirection, to let the customer know that their changes were saved.

 

Second: I am now faced with a challenge where (in order to avoid nested forms), I must add my module. I would need to either add it below this form in a separate module block or include it as a button/link to a modular popup. Any ideas on how to better structure this, where I can include the module with the other checkout_success modules and be able to use the related sort order feature to position it where I want?

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

@kgtee

Thanks KG, I always thought nesting forms was bad coding practice. I'll read through that stackoverflow link and see what I can get out of it.

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

@Demitry

Sorry I was wrong to say forms could have different names and values. Rather, a form can have more than one form submit button. By using different names and values the submit buttons can share some if not all of the form GET or POST values. Each button will then be able to perform onclick functions differently.

Link to comment
Share on other sites

 

Quote

Rather, a form can have more than one form submit button. By using different names and values the submit buttons can share some if not all of the form GET or POST values. Each button will then be able to perform onclick functions differently.

I get the concept, but as far as I know an email has to be structured as a form and if I included it as a module in the checkout_success block, then it will become nested inside of that page's order form.

What I can do is add the module as a request for the customers feed back and when they click on the link (which would be a feedback question), that would open a modal window with the email form inside of it. The modal code would then have to be added to that checkout_success.php page after the main order form.

Or, I could add it as an on-page form directly on that checkout_success.php page after the main order form. Either way, I would have to alter a core file, which is something I was trying to avoid.

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

The point of the way that the wishlist module does things is that both modules require the same parameters.  You just want a different behavior depending on which button is clicked. 

9 hours ago, Demitry said:

Either way, I would have to alter a core file, which is something I was trying to avoid.

Add it as a footer script.  Either with a separate header tag module or simply by adding the appropriate block directly.  An example of adding modal HTML as a footer script directly:  https://github.com/gburton/CE-Phoenix/blob/65ba42f1d45be6b2e34b5af549812057dc4bb102/includes/modules/content/product_info/templates/tpl_cm_pi_gallery.php#L80

Always back up before making changes.

Link to comment
Share on other sites

Quote

Add it as a footer script. 

hi Matt,

That's actually a pretty good idea that I didn't even think of. Plus, I am already adding a footer script via a header_tags module for the JS validation for that feedback form. So, I'll add the modal and see how that works.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

  • 5 weeks later...

@kgtee @ecartz

KG, Matt,

Thank you both for your help and advice. I had some challenges with this addon, but finally got it working. It is now available:

Customer Feedback at Checkout

catalog-cs-module-modal-view.png.7ed4b5f36398c26fd8a67c4dbed6c434.png

 

For anyone else reading this thread, this is NOT a support thread for this addon.

 

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Well done! @Demitry Thank you for a very useful add-on. Although there are some issues on missing language definitions, I have managed to sort them out. Thanks again.

 

Edit comment: It would be nice to have a pop up thank you message upon submitting the feedback. Would you add this extra in the future update? 😁

Link to comment
Share on other sites

Quote

Although there are some issues on missing language definitions, I have managed to sort them out.

KG, what language file issues. I would certainly like to fix them, but am not sure what you are referring to.

 

Quote

It would be nice to have a pop up thank you message upon submitting the feedback.

If you mean like having the modal window display the "message sent" message, I was not planning on it. The modal closes automatically upon (an error-free) submission and the "message sent" message is displayed on the checkout_success.php page just below the heading title for this module.

I could add that message to display in the modal, but then the customer would have to manually close that modal and I'm not sure then,.. what would display on the reloaded checkout_success.php page.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

Quote

Although there are some issues on missing language definitions,

Ugh! I got it. I know exactly what this issue is. The language file is too deep in my laptop directory and was excluded because of this when I zipped the package. I will upload it now as an update. Thank you for letting me know. The only way for me to know this was to download it and unzip it and now I see that this language file is not in there.

Here it is posted here, if you want to just copy and paste it into your own.

<?php
/*
  $Id$
  
  Customer Feedback at Checkout 
  Version 1.0 for BS
  Mod by Demitry

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2020 osCommerce

  Released under the GNU General Public License
*/
define('MODULE_CONTENT_CHECKOUT_SUCCESS_CUSTOMER_FEEDBACK_TITLE', 'Customer Feedback at Checkout');
define('MODULE_CONTENT_CHECKOUT_SUCCESS_CUSTOMER_FEEDBACK_DESCRIPTION', 'Show Customer Feedback Form on the checkout success page.');

define('MODULE_CONTENT_CHECKOUT_SUCCESS_CUSTOMER_FEEDBACK_HEADING', 'And Now, We Need Your Help!');
define('MODULE_CONTENT_CHECKOUT_SUCCESS_CUSTOMER_FEEDBACK_TEXT_REQUEST', 'What "almost" kept you from completing your purchse today?'); // must be the same text in header_tags module language file
define('MODULE_CONTENT_CHECKOUT_SUCCESS_CUSTOMER_FEEDBACK_TEXT_MSG_SENT', 'Your message was sent. We truly appreciate you and your business.<br /><br />

Please make any <strong>available selections</strong> on this page and click the Continue button to save your changes.');
?>

 

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...