Skip to content

Commit

Permalink
Merge pull request #25 from annuh/add_custom_attributes
Browse files Browse the repository at this point in the history
Add custom attributes to shopping feed
  • Loading branch information
lukesnowden authored Sep 7, 2017
2 parents 45c5cb0 + f846f6c commit d4ee8d5
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[$name] = $node->value($value);
}

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

0 comments on commit d4ee8d5

Please sign in to comment.