Skip to content

Commit

Permalink
fix: use proper website code for output, update example mail
Browse files Browse the repository at this point in the history
  • Loading branch information
c-walter committed Feb 12, 2024
1 parent 6991d69 commit 6521b33
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ n98-magerun2.phar customer:add-address [email] [website] [--firstname=STRING] [-
Examples:
```sh
n98-magerun2.phar customer:add-address [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" # add address of brandenburger tor to customer with email "[email protected]" in website "base"
n98-magerun2.phar customer:add-address [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" --default-billing --default-shipping # add address of brandenburger tor to customer with email "[email protected]" in website "base" as default billing and shipping
n98-magerun2.phar customer:add-address [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" # add address of brandenburger tor to customer with email "[email protected]" in website "base"
n98-magerun2.phar customer:add-address [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" --default-billing --default-shipping # add address of brandenburger tor to customer with email "[email protected]" in website "base" as default billing and shipping
```
Adds a customer address to given customer defined by email and website
Expand Down
3 changes: 2 additions & 1 deletion src/N98/Magento/Command/Customer/AddAddressCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
try {
$customer = $this->customerRepository->get($email, $website->getId());
} catch (NoSuchEntityException $e) {
$output->writeln("<error>Customer with email '$email' not found in website '$website'.</error>");
$websiteCode = $website->getCode();
$output->writeln("<error>Customer with email '$email' not found in website '$websiteCode'.</error>");
return Command::FAILURE;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/bats/functional_magerun_commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ function cleanup_files_in_magento() {
}

@test "Command: customer:add-address" {
run $BIN "customer:add-address" [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" --default-billing --default-shipping
assert_output --partial "Address added successfully to customer [email protected]"
run $BIN "customer:add-address" [email protected] base --firstname="John" --lastname="Doe" --street="Pariser Platz" --city="Berlin" --country="DE" --postcode="10117" --telephone="1234567890" --default-billing --default-shipping
assert_output --partial "Address added successfully to customer [email protected]"
}

@test "Command: db:add-default-authorization-entries" {
Expand Down

0 comments on commit 6521b33

Please sign in to comment.