Skip to content

Instantly share code, notes, and snippets.

Last active Aug 16, 2017
What would you like to do?
Place this file in the following file (you'll need to create this file if it doesn't yet exist).
To check it is working, you can then load the following URL. You should see your list of products:
https://<your domain here>/index.php?route=api/jetti/products
class ControllerApiJetti extends Controller {
public function products() {
$json = array();
// Get all products
$products = $this->model_catalog_product->getProducts();
foreach ($products as $product) {
// Add the images for this product to the response
$json['success']['images'][$product['product_id']] = $this->model_catalog_product->getProductImages($product['product_id']);
$json['success']['products'] = $products;
$this->response->addHeader('Content-Type: application/json');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment