Author Topic: How to echo the price and ID value of related products on Product Details page  (Read 24930 times)

csho

  • Beginner
  • *
  • Posts: 33
Hi,

After this code:
Code: [Select]
echo jText::_($field->custom_field_desc);
$product = $model->getProductSingle($field->custom_value,false);
$price = $calculator -> getProductPrices($product);

You should try to add this:
Code: [Select]
echo $product->images[0]->displayMediaFull('class="product-image"',false,"class='modal'",true);
So instead of:
$this->product->images[0]->displayMediaFull(......

You should use:
$product->images[0]->displayMediaFull(......

I havent been able to test this yet, but it should work.

Didn't worked on my case, it got bugged and removed all the css-like styles in my page.
It usually seems that is because of an php error.
Any other guess?

illusiondrmr

  • Beginner
  • *
  • Posts: 29
Just popped in to say thanks to Genius WebDesign for the solution in page 1 !!

camble

  • Beginner
  • *
  • Posts: 34
Hi,

After this code:
Code: [Select]
echo jText::_($field->custom_field_desc);
$product = $model->getProductSingle($field->custom_value,false);
$price = $calculator -> getProductPrices($product);

You should try to add this:
Code: [Select]
echo $product->images[0]->displayMediaFull('class="product-image"',false,"class='modal'",true);
So instead of:
$this->product->images[0]->displayMediaFull(......

You should use:
$product->images[0]->displayMediaFull(......

I havent been able to test this yet, but it should work.

Didn't worked on my case, it got bugged and removed all the css-like styles in my page.
It usually seems that is because of an php error.
Any other guess?

I've managed to customise my Related Products in VM 2.6.6, however I just want to be able to pull through the main image for each product.

I tried the code (above) and it doesn't work, so do you have any ideas?


Kind regards
Liam