zabak / open-source-self-check

Automatically exported from code.google.com/p/open-source-self-check
0 stars 0 forks source link

ByPassing Welcome Screen #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Eric,
Is it possible to have the self check go straight to the checkout screen after 
validating the patron instead of the welcome screen?  I'm not sure where the 
trigger is that changes from the welcome screen to the checkout screen.

Christopher

Original issue reported on code.google.com by CDASupp...@gmail.com on 11 Sep 2012 at 3:28

GoogleCodeExporter commented 8 years ago
FYI, we are looking at bypassing the welcome screen because it is so similar to 
the login screen, patrons don't notice the change.  Sometimes they come to us 
saying it isn't working, when in fact it is.  I'm thinking going to a blank 
checkout screen would do the trick.

Christopher

Original comment by CDASupp...@gmail.com on 11 Sep 2012 at 3:29

GoogleCodeExporter commented 8 years ago
in pages/home.php change 
$("#page_content").html(data);
to
window.location = 'index.php?page=checkout';

Original comment by ericmelton1@gmail.com on 11 Sep 2012 at 3:42

GoogleCodeExporter commented 8 years ago
Eric,
Thanks a million!  That's perfect.

Now, one more mystery.  So, I created a variable in the config.php file so I 
could give the option to bypass the screen or not.  Then I put the following 
logic in the home.php:

} else { //if everything is ok with the patron's account show the welcome screen
   $show_welcome_screen=<?php echo $show_welcome_screen;?>;
   if ($show_welcome_screen) {
      $("#page_content").html(data);
   } else {
      window.location = 'index.php?page=checkout';
   }
}

Since this part of the page is javascript, I converted the php variable from 
the config.php file to a javascript variable.  However, for some reason, it 
only works if the variable in config.php is set to true.  If I set it to false, 
it just sits and won't do anything.  Any idea why?  I must be missing something 
here.

Christopher

Original comment by CDASupp...@gmail.com on 11 Sep 2012 at 4:35

GoogleCodeExporter commented 8 years ago
You could try (note the 'quotes')...
$show_welcome_screen='<?php echo $show_welcome_screen;?>';
   if ($show_welcome_screen=='true') {

Original comment by ericmelton1@gmail.com on 11 Sep 2012 at 5:43

GoogleCodeExporter commented 8 years ago
Eric,
As it turns out, I wasn't creating my variable correctly in javascript.  I now 
have a working method.

In the config.php file, add:

$show_welcome_screen=false;

And in the home.php file, modify the javascript to read as follows:

} else { //if everything is ok with the patron's account show the welcome screen
   var showWelcomeScreen = "<?php echo $show_welcome_screen ?>";
   if (showWelcomeScreen) {
      $("#page_content").html(data);
   } else {
      window.location = 'index.php?page=checkout';
   }
}

Thanks for the assist!

Christopher

Original comment by CDASupp...@gmail.com on 11 Sep 2012 at 7:49