Created
October 22, 2020 09:50
-
-
Save andriyun/3938aa78af909dca4dff0a41f10fbc6f to your computer and use it in GitHub Desktop.
This file contains 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 characters
<?php | |
/** | |
* 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); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment