Skip to content

Commit

Permalink
Fix issue digitalpianism#17
Browse files Browse the repository at this point in the history
  • Loading branch information
septoctobre committed Nov 15, 2016
1 parent 67e4d01 commit 9e8eb3d
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,14 @@ public function sendAbandonedCartsEmail($nodate = false, $dryrun = false, $teste
$timezone = Mage::app()->getStore($store)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
date_default_timezone_set($timezone);

// If the nodate parameter is set to false
if (!$nodate) {
// Get the delay provided and convert it to a proper date
$delay = Mage::getStoreConfig('abandonedcartsconfig/options/notify_delay');
$delay = date('Y-m-d H:i:s', time() - $delay * 24 * 3600);
} else {
// We create a date in the future to handle all abandoned carts
$delay = date('Y-m-d H:i:s', strtotime("+7 day"));
}
// get the user-defined delay or use 0 by default
$delay = Mage::getStoreConfig('abandonedcartsconfig/options/notify_delay');

if (!$delay) {
$delay = 0;
}

$delay = date('Y-m-d H:i:s', time() - $delay * 24 * 3600);

// Loop through the stores
foreach (Mage::app()->getWebsites() as $website) {
Expand Down

0 comments on commit 9e8eb3d

Please sign in to comment.