2016-04-28 10 views
0

私はカスタム製品のデザインに取り組んでいます。製品のデザインは、製品の高さと幅と製品のカスタムイメージのベースで計算されたカスタム価格を設定しています。これは、$ items配列の価格とカスタム値を示しています。これらの値を取得することはできません。私はカート内のカスタム価格とカスタム画像の値を取得できます。これは価格と画像の値を設定するための私のコードです。Magentoカート内のカスタム価格とカスタムイメージの値を取得する方法は?

  $item->setCustomImage($products['imageutl1']); 
      $item->setCustomPrice($custom_price); 
      $item->setOriginalCustomPrice($custom_price); 
      // Enable super mode on the product. 
      $item->getProduct()->setIsSuperMode(true); 

      This is my code to get the price and image value on cart page.when i am trying to get the values on cart page using this code then it blanks the page.  
      $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems(); 

      foreach($items as $item) { 


       echo $productName = $item->getProduct()->getName(); 
       $productPrice = $item->getProduct()->getPrice(); 
       echo $item->getProduct()->custom_image(); 

      }  

[product_id] => 800 
      [product_type] => simple 
      [sku] => 111 
      [name] => Test product 
      [weight] => 4.0000 
      [tax_class_id] => 0 
      [base_cost] => 
      [is_recurring] => 0 
      [is_qty_decimal] => 0 
      [calculation_price] => 50.56 
      [base_calculation_price] => 
      [custom_price] => 50.56 
      [custom_image] => http://testimage.com/test/test.php/myimage.php 
      [is_nominal] => 
      [qty_to_add] => 1 
      [qty] => 1 
      [qty_options] => Array 
       (
       ) 

      [original_custom_price] => 50.56 
      [small_image] => 
      [thumbnail] => 
      [is_virtual] => 
      [created_at] => 2016-04-29 05:08:15 
      [updated_at] => 2016-04-29 05:08:15 
      [item_id] => 159 

答えて

0

$アイテム - をエコーするecho $item->getProduct()->getData('custom_image');

+0

これは働いていません。上記のコードにも製品の配列が追加されています。 –

+0

編集したソリューションを試す – Shivanand

+0

これも動作していません。製品名のみを表示しています。 –

0

変更echo $item->getProduct()->custom_image();echo $item->getProduct()->custom_image();を置き換える> getProduct() - > getCustomImage();

関連する問題