Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/9915168 to your computer and use it in GitHub Desktop.
Save clifgriffin/9915168 to your computer and use it in GitHub Desktop.
Loading adhoc collections of products by ID(s)
<?php
$product_ids = array(12, 14);
ShoppCollection( new ProductCollection );
ShoppCollection()->slug = 'adhoc-collection';
ShoppCollection()->load( array(
'where' => array('p.id IN (' . implode(',', $product_ids) . ')')
));
shopp('storefront.collection');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment