Hello,
I've a problem with Delete customer action on dashboard.
I've that in custom script and call it on my form
public function getDeleteUrl() { return $this->getUrl('*/*/delete', ['id' => $this->getCustomerId()]); }
this is my form
<form class="form-delete-account" action="<?php echo $block->getDeleteUrl(); ?>" method="post">
The url is -> be_fr/customer/account/delete/ and when I submit the form, I'm redirect on 404 error page ...
Any idea?
Thank
Solved! Go to Solution.
Hi @JoouulDev
could you try this.
$customerID = 1;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customer = $objectManager->create('Magento\Customer\Model\Customer')->load($customerID);
if($customer->delete()){
}else{
}
Problem solved? Click Kudos & Accept as Solution!
Thanks
Hi,
The delete action is not available/not called correctly. Can you please check to delete action is available or not in the account controller.
Thank you!
Hi @JoouulDev
could you try this.
$customerID = 1;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customer = $objectManager->create('Magento\Customer\Model\Customer')->load($customerID);
if($customer->delete()){
}else{
}
Problem solved? Click Kudos & Accept as Solution!
Thanks