Ekdant-Online-Store/catalog/controller/startup/customer.php

23 lines
682 B
PHP
Raw Normal View History

2024-08-06 12:21:00 +00:00
<?php
namespace Opencart\Catalog\Controller\Startup;
/**
* Class Customer
*
* @package Opencart\Catalog\Controller\Startup
*/
class Customer extends \Opencart\System\Engine\Controller {
/**
* @return void
*/
public function index(): void {
$this->registry->set('customer', new \Opencart\System\Library\Cart\Customer($this->registry));
// Customer Group
if (isset($this->session->data['customer'])) {
$this->config->set('config_customer_group_id', $this->session->data['customer']['customer_group_id']);
} elseif ($this->customer->isLogged()) {
// Logged in customers
$this->config->set('config_customer_group_id', $this->customer->getGroupId());
}
}
}