Skip to content

Commit

Permalink
Merge pull request #40 from juriansluiman/hotfix/docs-php-examples
Browse files Browse the repository at this point in the history
Fix code examples with constructor arguments
  • Loading branch information
Jurian Sluiman committed Jun 15, 2014
2 parents e86efe6 + 39a521e commit 44a00b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,9 @@ To track a transaction, you should use the
use SlmGoogleAnalytics\Analytics\Ecommerce\Transaction;
use SlmGoogleAnalytics\Analytics\Ecommerce\Item;

$transaction = new Transaction;
$transaction->setId('1234'); // order ID
$transaction->setTotal('28.28'); // total

$item = new Item;
$item->setPrice('11.99'); // unit price
$item->setQuantity('2'); // quantity
$transaction = new Transaction('1234', '28.28');

$item = new Item('5678', '11.99', '2', 'Blue elephant');
$transaction->addItem($item);

$ga->addTransaction($transaction);
Expand Down

0 comments on commit 44a00b1

Please sign in to comment.