Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin>Modules>Featured-Home Page : gives error if no products are added #2660

Closed
Shweta317 opened this issue Feb 10, 2015 · 0 comments
Closed

Comments

@Shweta317
Copy link

Admin>Modules>Featured-Home Page : gives the following error if no products are mapped :
Warning: Invalid argument supplied for foreach() in /admin/controller/module/featured.php on line 124

Fix : Added condition before foreach() to check if the products array is empty :

    if(!empty($products)){
        foreach ($products as $product_id) {
            $product_info = $this->model_catalog_product->getProduct($product_id);
            if ($product_info) {
                $data['products'][] = array(
                    'product_id' => $product_info['product_id'],
                    'name'       => $product_info['name']
                );
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants