protected function setDataRelatedEditProduct()
    {
        $product_ids = $this->getData('product.related');

        $products = array();

        if (!empty($product_ids)) {
            $products = (array) $this->product->getList(array('product_id' => $product_ids));
        }

        $options = array(
            'entity' => 'product',
            'entity_id' => $product_ids,
            'template_item' => 'backend|content/product/suggestion'
        );

        foreach ($products as &$product) {
            $this->setItemThumb($product, $this->image, $options);
            $this->setItemPriceFormatted($product, $this->price);
            $this->setItemRendered($product, array('item' => $product), $options);
        }

        $widget = array(
            'multiple' => true,
            'name' => 'product[related]',
            'products' => $products,
            'error' => $this->error('related')
        );

        $this->setData('product_picker', $this->getWidgetProductPicker($widget));
    }
protected function setDataRelatedEditProduct()
    {
        $product_ids = $this->getData('product.related');

        $products = array();

        if (!empty($product_ids)) {
            $products = (array) $this->product->getList(array('product_id' => $product_ids));
        }

        $options = array(
            'entity' => 'product',
            'entity_id' => $product_ids,
            'template_item' => 'backend|content/product/suggestion'
        );

        foreach ($products as &$product) {
            $this->setItemThumb($product, $this->image, $options);
            $this->setItemPriceFormatted($product, $this->price);
            $this->setItemRendered($product, array('item' => $product), $options);
        }

        $widget = array(
            'multiple' => true,
            'name' => 'product[related]',
            'products' => $products,
            'error' => $this->error('related')
        );

        $this->setData('product_picker', $this->getWidgetProductPicker($widget));
    }
protected function setDataRelatedEditProduct ( ) { $ product_ids = $ this -> getData ( 'product.related' ) ; $ products = array ( ) ; if ( ! empty ( $ product_ids ) ) { $ products = ( array ) $ this -> product -> getList ( array ( 'product_id' => $ product_ids ) ) ; } $ options = array ( 'entity' => 'product' , 'entity_id' => $ product_ids , 'template_item' => 'backend|content/product/suggestion' ) ; foreach ( $ products as & $ product ) { $ this -> setItemThumb ( $ product , $ this -> image , $ options ) ; $ this -> setItemPriceFormatted ( $ product , $ this -> price ) ; $ this -> setItemRendered ( $ product , array ( 'item' => $ product ) , $ options ) ; } $ widget = array ( 'multiple' => true , 'name' => 'product[related]' , 'products' => $ products , 'error' => $ this -> error ( 'related' ) ) ; $ this -> setData ( 'product_picker' , $ this -> getWidgetProductPicker ( $ widget ) ) ; }
Sets related products
Sets related products