| 1: | <?php
|
| 2: | namespace Opencart\Catalog\Controller\Cron;
|
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: |
|
| 8: | class Gdpr extends \Opencart\System\Engine\Controller {
|
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: |
|
| 18: | public function index(int $cron_id, string $code, string $cycle, string $date_added, string $date_modified): void {
|
| 19: | $this->load->model('account/gdpr');
|
| 20: | $this->load->model('account/customer');
|
| 21: |
|
| 22: | $results = $this->model_account_gdpr->getExpires();
|
| 23: |
|
| 24: | foreach ($results as $result) {
|
| 25: | $this->model_account_gdpr->editStatus($result['gdpr_id'], 3);
|
| 26: |
|
| 27: | $customer_info = $this->model_account_customer->getCustomerByEmail($result['email']);
|
| 28: |
|
| 29: | if ($customer_info) {
|
| 30: | $this->model_account_customer->deleteCustomer($customer_info['customer_id']);
|
| 31: | }
|
| 32: | }
|
| 33: | }
|
| 34: | }
|
| 35: | |