original_string: 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));
      }
code: 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));
      }
code_tokens: 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 ) ) ; }
docstring: Sets related products
docstring_tokens: Sets related products