rendered paste bodytry{ $customer = new inspired_customer(); $customer->setPk(9); $customer->read(); // product ids to test $ids = array(15,20,25); foreach($ids as $id) { $object = new inspired_product(); $object->set('productid', $id); $object->read(); $objects[] = $object; } // Setup the decorators $decorator = new decorator( array( new inspired_product_decorator_discount_group($customer), new inspired_product_decorator_discount_category(), ) ); $decorator->setObjects($objects); $decorator->decorate(); foreach($decorator->getObjects() as $product){ echo '<hr>'; echo $product->getPk().' '.$product->prodname.'<br>'; var_dump($product->discounts); }}catch(Exception $e){ echo $e->getMessage().'<br>';}