-
-
Save EHLOVader/7001894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in action tab | |
$category_ids = array(array(5,10,6,7)); | |
$this->data['products'] = Shop_Product::create() | |
->apply_filters() | |
->join('shop_products_categories', 'shop_products_categories.shop_product_id=shop_products.id') | |
->where('shop_products_categories.shop_category_id in (?)', $category_ids); | |
$this->data['products']->reset_order(); | |
$this->data['products'] = $this->data['products']->order('shop_products.created_at desc') | |
->limit(16) | |
->find_all(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach($products as $p){ | |
echo $p->categories[0]->name . ' ' . $p->sku . ' ' . $p->created_at . ' </br>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment