Skip to content

Commit

Permalink
Merge pull request #26 from RaSiM/RaSiM
Browse files Browse the repository at this point in the history
item add pattern
  • Loading branch information
lukesnowden authored Jan 10, 2018
2 parents 6e723fa + 5605c42 commit 5314858
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/LukeSnowden/GoogleShoppingFeed/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ public function price($price)
/**
* [sale_price - set the sale price, do not format before passing]
* @param [type] $salePrice [description]
* @return [type] [description]
*/
public function sale_price($salePrice)
{
$node = new Node('sale_price');
$this->nodes['sale_price'] = $node->value(number_format($salePrice, 2, '.', ''))->_namespace($this->namespace);
$salePrice = number_format($salePrice, 2, '.', '');
$code = GoogleShopping::getIso4217CountryCode();
$this->nodes['sale_price'] = $node->value( $salePrice . " {$code}" )->_namespace($this->namespace);
}

/**
Expand Down Expand Up @@ -521,6 +522,14 @@ public function material($material) {
$this->nodes['material'] = $node->value($material)->_namespace($this->namespace);
}

/**
* @param $pattern
*/
public function pattern($pattern) {
$node = new Node('pattern');
$this->nodes['pattern'] = $node->value($pattern)->_namespace($this->namespace);
}

/**
* @param $imageLink
*/
Expand Down

0 comments on commit 5314858

Please sign in to comment.