Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-24-2020 11:46:43

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19850
Website

K9: Checkout Disabled Message Mod

Hello, all.  We've been getting a bunch of requests in for a way to keep the store and SEO up and running while disabling checkout.  The following modification is part of update 9.1.0 (to be released).  Follow these steps to implement:

(1) Use the K9 management interface to access System / Database / Raw Database Admin and choose to Execute a Raw SQL Statement.  Execute this statement:

Code:

INSERT INTO core_settings VALUES('ecom.checkoutdisabledmessage', 'Checkout Disabled Message', 'ecom', 'Checkout', 'TEXTAREA-SMALL', '', '', '0', '', 'Enter a message in this field to Disable Checkout.  If a message is present in this field, checkout will be disabled, and this message will be displayed.')

(2) Next, edit {private}/apps/ecom/ECOM/includes/cartdisplay.php.  Towards the bottom of the file you will see a comment noting 'Print the buttons/links.'.  This is the section that prints the checkout button.  In that section, replace:

Code:

} elseif ($savetype == 'CART') {

With:

Code:

} elseif ((!($this->globals('core_settings.ecom.checkoutdisabledmessage'))) && ($savetype == 'CART')) {

Then in the section below that, commented with 'Form closure', right below:

Code:

print '</form>' . $eol;

if (!(empty($isbackend))) {print '</div>' . $eol;}

Add:

Code:

if (($this->globals('core_settings.ecom.checkoutdisabledmessage')) && (empty($isbackend))) {

     $this->include_namespace('core','print_message',array('msgtype' => 'NOTIFY', 'stringdisp' => $this->globals('core_settings.ecom.checkoutdisabledmessage')));

     return 1;

} // End of if statement.

(3) Edit the file {private}/apps/ECOM_Checkout/ECOM_Checkout.php.  Locate the checkoutfn() function, and right above the line:

Code:

return $this->docheckout();

Add:

Code:

$checkoutdisabledmessage = $this->globals('core_settings.ecom.checkoutdisabledmessage');
$interface               = $this->globals('core.interface');

if ((!(empty($checkoutdisabledmessage))) && ($interface != 'BackEnd')) {

      if ($this->debug) {$this->debugger("docheckoutfn: Checkout is disabled with a message.");}

      $this->exec_namespace(array('app' => 'core', 'namespace' => 'print_message', 'type' => 'INTERNAL', 'params' => array('msgtype' => 'NOTIFY', 'stringdisp' => $checkoutdisabledmessage)));

      return 1;

} // End of if statement.

Once you have completed these steps, you can add a Checkout Disabled Message using the management interface.  Access Store / Component / Settings / Checkout and edit the new Checkout Disabled Message.  Entering a message disables checkout and presents that message.  If using this feature, it's a really good idea to let customers know when ordering may become available again.


Nick Hendler

Offline

 

Board footer