Skip to content

Commit

Permalink
Gender (#495)
Browse files Browse the repository at this point in the history
* optional attribute type

* optional attribute type

* styleCI

* styleCI
  • Loading branch information
Pfabeck authored Jun 19, 2019
1 parent fa13701 commit 055bbf4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function generate(Customer $customer, Order $order): array
'typeId' => 1,
'firstName' => $customer->getFirstname(),
'lastName' => $customer->getLastname(),
'gender' => $customer->getGender() === Customer::GENDER_MALE ? 'male' : 'female',
'gender' => $customer->getGender(),
'lang' => $languageIdentity->getAdapterIdentifier(),
'singleAccess' => $customer->getType() === Customer::TYPE_GUEST,
'plentyId' => $shopIdentity->getAdapterIdentifier(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private function getCustomer(array $entry)
$customer->setEmail($this->getMail($entry));
$customer->setLanguageIdentifier($languageIdentity->getObjectIdentifier());
$customer->setCustomerGroupIdentifier($customerGroupIdentity->getObjectIdentifier());
$customer->setGender($entry['customerData']['gender'] === 'male' ? Customer::GENDER_MALE : Customer::GENDER_FEMALE);
$customer->setGender($entry['customerData']['gender']);
$customer->setFirstname($entry['customerData']['firstName']);
$customer->setLastname($entry['customerData']['lastName']);
$customer->setPhoneNumber($this->getPhoneNumber($entry));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function parse(array $entry)
} elseif ($entry['salutation'] === 'ms' || $entry['salutation'] === 'frau') {
$gender = Customer::GENDER_FEMALE;
} else {
$gender = null;
$gender = Customer::GENDER_DIVERSE;
}

$params = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function parse(array $entry)
} elseif ($entry['salutation'] === 'ms' || $entry['salutation'] === 'frau') {
$gender = Customer::GENDER_FEMALE;
} else {
$gender = null;
$gender = Customer::GENDER_DIVERSE;
}

if (empty($entry['birthday'])) {
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- separate price import logic (@Pfabeck)
- bundle variation limit (@Pfabeck)
- variant properties are now transferred as attribute (beta feature) (@Pfabeck)
- 3rd gender support (@Pfabeck)

### Changed
- change media command handler to update media if exists (@lacodimizer)
Expand Down
1 change: 1 addition & 0 deletions Connector/TransferObject/Order/Address/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Address extends AbstractValueObject implements AttributableInterface
{
const GENDER_MALE = 'male';
const GENDER_FEMALE = 'female';
const GENDER_DIVERSE = 'diverse';

/**
* @var null|string
Expand Down
1 change: 1 addition & 0 deletions Connector/TransferObject/Order/Customer/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Customer extends AbstractValueObject

const GENDER_MALE = 'male';
const GENDER_FEMALE = 'female';
const GENDER_DIVERSE = 'diverse';

/**
* @var int
Expand Down

0 comments on commit 055bbf4

Please sign in to comment.