VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ch1vph on June 18, 2019, 17:09:34 PM

Title: Need to display the words 'price' instead of 'array'
Post by: ch1vph 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?

<?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
}
}
}
Title: Re: Need to display the words 'price' instead of 'array'
Post by: StefanSTS 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?

Title: Re: Need to display the words 'price' instead of 'array'
Post by: PRO on June 18, 2019, 20:04:32 PM
is the plugin etc returning an array? or  &$html   ?

what is it supposed to display?
Title: Re: Need to display the words 'price' instead of 'array'
Post by: ch1vph 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!

<?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>';
}
?>