Created
October 22, 2020 09:50
-
-
Save andriyun/3938aa78af909dca4dff0a41f10fbc6f to your computer and use it in GitHub Desktop.
Revisions
-
andriyun revised this gist
Oct 22, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /** * Helper function to log info. */ -
andriyun created this gist
Oct 22, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ /** * Helper function to log info. */ public static function _bc_filelog($message) { error_log(print_r($message, 1) . PHP_EOL, 3, '../checkout-session-info.log'); } /** * {@inheritdoc} */ public function addCartId($cart_id, $type = self::ACTIVE) { $key = $this->getSessionKey($type); $ids = $this->session->get($key, []); $ids[] = $cart_id; $this->session->set($key, array_unique($ids)); self::_bc_filelog(date('Y-m-d H:i:s', strtotime('now')) . ' ' . __FUNCTION__); self::_bc_filelog($_SESSION); }