Don't send image_url when it is empty

This commit is contained in:
Narek Zakarian 2023-09-08 14:41:21 +04:00
parent b4f8478920
commit fa45071a5f
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -249,9 +249,12 @@ class Item {
'sku' => $this->sku(), 'sku' => $this->sku(),
'category' => $this->category(), 'category' => $this->category(),
'url' => $this->url(), 'url' => $this->url(),
'image_url' => $this->image_url(),
); );
if ( $this->image_url() ) {
$item['image_url'] = $this->image_url();
}
if ( $this->tax() ) { if ( $this->tax() ) {
$item['tax'] = $this->tax()->to_array(); $item['tax'] = $this->tax()->to_array();
} }