ProfileAddressBookDeleteForm.php in Commerce Core 8.2
File
modules/order/src/Form/ProfileAddressBookDeleteForm.php
View source
<?php
namespace Drupal\commerce_order\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Url;
class ProfileAddressBookDeleteForm extends ContentEntityDeleteForm {
public function getQuestion() {
return $this
->t('Are you sure you want to delete the %label address?', [
'%label' => $this
->getEntity()
->label(),
]);
}
protected function getDeletionMessage() {
$entity = $this
->getEntity();
return $this
->t('The %label address has been deleted.', [
'%label' => $entity
->label(),
]);
}
public function getCancelUrl() {
$entity = $this->entity;
return Url::fromRoute('commerce_order.address_book.overview', [
'user' => $entity
->getOwnerId(),
]);
}
protected function getRedirectUrl() {
return $this
->getCancelUrl();
}
}