Added default country when creating order and fixed ICML generation

This commit is contained in:
gleemand 2022-06-09 13:21:53 +03:00 committed by GitHub
parent 1fe840d96f
commit 1568783e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -236,8 +236,11 @@ class RetailcrmCatalog
if (!$pictures) {
$image = Image::getCover($product['id_product']);
$picture = $this->protocol . $this->link->getImageLink($product['link_rewrite'], $image['id_image'], 'large_default');
$pictures[] = $picture;
if (isset($image['id_image'])) {
$picture = $this->protocol . $this->link->getImageLink($product['link_rewrite'], $image['id_image'], 'large_default');
$pictures[] = $picture;
}
}
if ('1.3' == $this->version) {

View File

@ -180,6 +180,7 @@ class RetailcrmCustomerAddressBuilder extends RetailcrmAbstractBuilder implement
{
if (empty($this->customerAddress)) {
$this->customerAddress = new Address();
$this->setAddressField('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
}
$this->customerAddress->id_customer = $this->idCustomer;
@ -197,6 +198,7 @@ class RetailcrmCustomerAddressBuilder extends RetailcrmAbstractBuilder implement
if (array_key_exists('countryIso', $this->dataCrm)) {
$countryIso = null;
if (Validate::isLanguageIsoCode($this->dataCrm['countryIso'])) {
$countryIso = Country::getByIso($this->dataCrm['countryIso']);
}