Skip to content

Commit

Permalink
Add extra method to insert custom attributes to the shopping feed
Browse files Browse the repository at this point in the history
  • Loading branch information
annuh committed Sep 7, 2017
1 parent 45c5cb0 commit 4294e6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/composer.lock
/vendor
/cache
/cache
.idea
12 changes: 12 additions & 0 deletions src/LukeSnowden/GoogleShoppingFeed/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,18 @@ public function custom_label_4($customLabel)
$this->nodes['custom_label_4'] = $node->value($customLabel)->_namespace($this->namespace);
}

/**
* Adds a custom attribute to the shopping feed.
*
* @param string $name
* @param string $value
*/
public function custom($name, $value)
{
$node = new Node($name);
$this->nodes[] = $node->value($value)->_namespace($this->namespace);
}

/**
* Returns item nodes
* @return array
Expand Down

0 comments on commit 4294e6c

Please sign in to comment.