VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: qb-virtue on February 10, 2015, 23:03:30 PM

Title: oncheckout_show_steps Not working!
Post by: qb-virtue on February 10, 2015, 23:03:30 PM
Hello, I am on VM 2.6.14 and oncheckout_show_steps does not work. Is there something I'm missing?

I entered the following code just as a test and it will not work

<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
echo 'Here is step 4 so add html code with steps in divs with images that should be displayed on the end';
} else {
echo 'Here is step 1 so add html code with steps in divs with images that should be displayed on the beginning';
}
?>



but even on the confirm page it still outputs Here is step 1 so add html code with steps in divs with images that should be displayed on the beginning
Title: Re: oncheckout_show_steps Not working!
Post by: GJC Web Design on February 11, 2015, 00:08:57 AM
the only way to prove if it works or not is to echo out your vars

(VmConfig::get ('oncheckout_show_steps', 1) && $this->checkout_task === 'confirm')

print 'Debug Line '.__LINE__.' oncheckout_show_steps <pre>'; print_r (VmConfig::get ('oncheckout_show_steps', 1)); print "</pre><br />\n";

print 'Debug Line '.__LINE__.' $this->checkout_task <pre>'; print_r ($this->checkout_task); print "</pre><br />\n";

if not what u expect work backwards
Title: Re: oncheckout_show_steps Not working!
Post by: qb-virtue on February 11, 2015, 15:54:04 PM
Thank you for your response!

I tried your code and it worked, and then I was stumped. I looked at the code with a fresh eye this morning and I made a really stupid mistake. For anyone that tries this code... it does not work unless the option to "Show Checkout Steps" is checked in Virtuemart Configuration. Once I checked that, it started working as necessary.
<?php if (VmConfig::get ('oncheckout_show_steps', 1) && $this->checkout_task === 'confirm') {
      echo 'Here is step 4 so add html code with steps in divs with images that should be displayed on the end';
   } else {
      echo 'Here is step 1 so add html code with steps in divs with images that should be displayed on the beginning';
      }
   ?>