opencart/opencart-3

Customer approval buttons no twig page load

condor2 opened this issue · 20 comments

Both functions: aprove and deny doesn't have a page redirect

https://github.com/opencart/opencart-3/blob/main/upload/admin/controller/customer/customer_approval.php#L179

$this->response->setOutput...

Yes, correct. Something is missing here. However, it is not a TWIG file. Since it is a single action that is required per row, whether we need to approve or deny the request, I have another idea for this without the use of a page.

The only problem is the customer_id to be propagated if being done without a TWIG file ... all this for a URL filter that does not respond in the URL bar after the button_filter is hit ...

You can make like in oc 4.0 with 2 twig files. customer_approval and customer_approval_list

Won't work with this jQuery version. That's the real issue. In OC 4, the URL do appear on the bar accordingly with the button_filter but previous versions don't (or maybe they used to show a long time ago).

Then, maybe like old 2.3.0.2 customer controller?
For approve/deny functions

There's no customer_approval in OC v2.3.0.2 release nor is there a approve/deny methods as you call them functions.

Then, maybe like old 2.3.0.2 customer controller? For approve/deny functions

I know what you're saying. By following that solution, you're still suggesting to separate the customer_id on a separate page from the URL by adding a new TWIG form page.

I sugested like in 2.3.0.2 customer controller.

customer_approval controller
customer_approval_list twig file

And aprove function to be like

public function approve() {
$this->load->language('customer/customer_approval');

	$this->document->setTitle($this->language->get('heading_title'));

	$this->load->model('customer/customer_approval');

	$customer_approval= array();


		$this->response->redirect($this->url->link('customer/customer_approval', 'user_token=' . $this->session->data['user_token'] . $url, true));
	}

	$this->getList();
}`

The controller is not the issue. I will post the changes shortly.

Should be fixed now (at least for this jQuery version): a6e241a . For OC 4, it won't be necessary.

When you click on button you are log out and the url is

customer/customer_approval&user_token=

When you click on button you are log out and the url is

customer/customer_approval&user_token=

Updated: 60e85ad .

Now buttons don't do nothing, just refresh the page

Developers kit.

No errors

In the network tab, does it show status 200?

Yes

LE. On my repo I used something like this:

approve

I updated the code.