From c7d143165448ac86a4a9e7c8e6dabec6ae98f06a Mon Sep 17 00:00:00 2001 From: Holger Jensen Date: Fri, 12 Mar 2021 15:14:26 +0100 Subject: [PATCH 1/3] added Google Shopping feed item sale_price_effective_date --- src/LukeSnowden/GoogleShoppingFeed/Item.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/LukeSnowden/GoogleShoppingFeed/Item.php b/src/LukeSnowden/GoogleShoppingFeed/Item.php index b79b380..f644658 100644 --- a/src/LukeSnowden/GoogleShoppingFeed/Item.php +++ b/src/LukeSnowden/GoogleShoppingFeed/Item.php @@ -141,6 +141,15 @@ public function sale_price($salePrice) $this->nodes['sale_price'] = $node->value( $salePrice . " {$code}" )->_namespace($this->namespace); } + /** + * @param $salePriceEffectiveDate + */ + public function sale_price_effective_date($salePriceEffectiveDate) + { + $node = new Node('sale_price_effective_date'); + $this->nodes['sale_price_effective_date'] = $node->value( $salePriceEffectiveDate )->_namespace($this->namespace); + } + /** * @param $description * @param string $encoding @@ -564,10 +573,10 @@ public function pattern($pattern) $node = new Node('pattern'); $this->nodes['pattern'] = $node->value($pattern)->_namespace($this->namespace); } - + /** * Add one additional image (string) or multiple images (array). - * + * * @param $imagesLink */ public function additional_image_link($imagesLink) @@ -577,12 +586,12 @@ public function additional_image_link($imagesLink) foreach ($imagesLink as $imageLink) { $node = new Node('additional_image_link'); $imageLink = $this->safeCharEncodeURL(urldecode($imageLink)); - array_push($this->nodes['additional_image_link'], $node->value($imageLink)->_namespace($this->namespace)->addCdata()); + array_push($this->nodes['additional_image_link'], $node->value($imageLink)->_namespace($this->namespace)->addCdata()); } } else { $node = new Node('additional_image_link'); $imageLink = $this->safeCharEncodeURL(urldecode($imagesLink)); - array_push($this->nodes['additional_image_link'], $node->value($imagesLink)->_namespace($this->namespace)->addCdata()); - } + array_push($this->nodes['additional_image_link'], $node->value($imagesLink)->_namespace($this->namespace)->addCdata()); + } } } From 32577d997350ab8f85dd9caa87c164dc9476a804 Mon Sep 17 00:00:00 2001 From: Holger Jensen Date: Fri, 12 Mar 2021 15:15:13 +0100 Subject: [PATCH 2/3] Revert "added Google Shopping feed item sale_price_effective_date" This reverts commit c7d143165448ac86a4a9e7c8e6dabec6ae98f06a. --- src/LukeSnowden/GoogleShoppingFeed/Item.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/LukeSnowden/GoogleShoppingFeed/Item.php b/src/LukeSnowden/GoogleShoppingFeed/Item.php index f644658..b79b380 100644 --- a/src/LukeSnowden/GoogleShoppingFeed/Item.php +++ b/src/LukeSnowden/GoogleShoppingFeed/Item.php @@ -141,15 +141,6 @@ public function sale_price($salePrice) $this->nodes['sale_price'] = $node->value( $salePrice . " {$code}" )->_namespace($this->namespace); } - /** - * @param $salePriceEffectiveDate - */ - public function sale_price_effective_date($salePriceEffectiveDate) - { - $node = new Node('sale_price_effective_date'); - $this->nodes['sale_price_effective_date'] = $node->value( $salePriceEffectiveDate )->_namespace($this->namespace); - } - /** * @param $description * @param string $encoding @@ -573,10 +564,10 @@ public function pattern($pattern) $node = new Node('pattern'); $this->nodes['pattern'] = $node->value($pattern)->_namespace($this->namespace); } - + /** * Add one additional image (string) or multiple images (array). - * + * * @param $imagesLink */ public function additional_image_link($imagesLink) @@ -586,12 +577,12 @@ public function additional_image_link($imagesLink) foreach ($imagesLink as $imageLink) { $node = new Node('additional_image_link'); $imageLink = $this->safeCharEncodeURL(urldecode($imageLink)); - array_push($this->nodes['additional_image_link'], $node->value($imageLink)->_namespace($this->namespace)->addCdata()); + array_push($this->nodes['additional_image_link'], $node->value($imageLink)->_namespace($this->namespace)->addCdata()); } } else { $node = new Node('additional_image_link'); $imageLink = $this->safeCharEncodeURL(urldecode($imagesLink)); - array_push($this->nodes['additional_image_link'], $node->value($imagesLink)->_namespace($this->namespace)->addCdata()); - } + array_push($this->nodes['additional_image_link'], $node->value($imagesLink)->_namespace($this->namespace)->addCdata()); + } } } From 372ab69c80d8bb4b2a0d036b7746b1d177e88827 Mon Sep 17 00:00:00 2001 From: Holger Jensen Date: Fri, 12 Mar 2021 15:15:56 +0100 Subject: [PATCH 3/3] added Google Shopping feed item sale_price_effective_date --- src/LukeSnowden/GoogleShoppingFeed/Item.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/LukeSnowden/GoogleShoppingFeed/Item.php b/src/LukeSnowden/GoogleShoppingFeed/Item.php index b79b380..b6de24e 100644 --- a/src/LukeSnowden/GoogleShoppingFeed/Item.php +++ b/src/LukeSnowden/GoogleShoppingFeed/Item.php @@ -141,6 +141,15 @@ public function sale_price($salePrice) $this->nodes['sale_price'] = $node->value( $salePrice . " {$code}" )->_namespace($this->namespace); } + /** + * @param $salePriceEffectiveDate + */ + public function sale_price_effective_date($salePriceEffectiveDate) + { + $node = new Node('sale_price_effective_date'); + $this->nodes['sale_price_effective_date'] = $node->value( $salePriceEffectiveDate )->_namespace($this->namespace); + } + /** * @param $description * @param string $encoding