Skip to content

Instantly share code, notes, and snippets.

@jonathandavis
Created July 3, 2013 19:00
Show Gist options
  • Select an option

  • Save jonathandavis/5921715 to your computer and use it in GitHub Desktop.

Select an option

Save jonathandavis/5921715 to your computer and use it in GitHub Desktop.
$products = self::$products;
$quantities = array(1, 8, 6, 12);
$items = array();
foreach ( $products as $i => $Product ) {
$Item = new Item ( $Product, false );
$Item->quantity( $quantities[$i] );
$items[ $Item->fingerprint() ] = $Item;
}
ShoppOrder()->Cart->populate($items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment