Author Topic: Need to display the words 'price' instead of 'array'  (Read 300 times)

ch1vph

  • Jr. Member
  • **
  • Posts: 51
  • A beginner
Need to display the words 'price' instead of 'array'
« on: June 18, 2019, 17:09:34 pm »
Hi there,

Having an issue implementing this code on these two posts:

http://forum.virtuemart.net/index.php?topic=139957
http://forum.virtuemart.net/index.php?topic=140113.msg492302#msg492302

As I need to display the words 'price' instead of 'array'

Below is the code I've added from the above posts and the wording 'array' has been removed, but I'm unsure how to get my specific words of 'Price' to display?

Code: [Select]
<?php
echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$this->showRating,'product'=>$this->product));
echo '<br />';

foreach ($this->productDisplayTypes as $type=>$productDisplayType) {

foreach ($productDisplayType as $productDisplay) {

foreach ($productDisplay as $virtuemart_method_id =>$productDisplayHtml) {
?>

<div class="<?php echo substr($type0, -1?> <?php echo substr($type0, -1).'-'.$virtuemart_method_id ?>">
<?php
echo $productDisplayHtml;
?>

</div>
<?php
}
}
}

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 412
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Need to display the words 'price' instead of 'array'
« Reply #1 on: June 18, 2019, 17:46:13 pm »
It would be easier to understand what you are trying to achieve, if you make a screenshot and add some info to that.

I am not sure which price you are talking about.

The code should add the shipping cost, do you need a lable for that?
Or are you talking about the product price which is written below that?

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10358
  • VirtueMart Version: 3+
Re: Need to display the words 'price' instead of 'array'
« Reply #2 on: June 18, 2019, 20:04:32 pm »
is the plugin etc returning an array? or  &$html   ?

what is it supposed to display?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

ch1vph

  • Jr. Member
  • **
  • Posts: 51
  • A beginner
Re: Need to display the words 'price' instead of 'array'
« Reply #3 on: June 18, 2019, 20:35:46 pm »
Thanks guys I found an older default file with the in stock out of stock option instead of just the words price!

Code: [Select]
<?php
if ($product->product_in_stock >=1) {
echo 
'<div class="stock"><span class="bold">'.JText::_('').'</span><i class="green">'.JText::_('IN STOCK').'</i> </div>';
}else {
echo 
'<div class="stock"><span class="bold">'.JText::_('').'</span><i class="red">'.JText::_('OUT OF STOCK').'</i> </div>';
}
?>