like in this thread http://forum.virtuemart.net/index.php?topic=137229.msg480376#msg480376
the text 'array' is showing again on the product detail page.
I set all shippment methods "Show on the product details page" to "No".
Happens since the update from 3.2.12 to 3.2.14.
It is very likely and old layout override. Your default.php in productdetails view should have something like
foreach ($this->productDisplayTypes as $type=>$productDisplayType) {
foreach ($productDisplayType as $productDisplay) {
foreach ($productDisplay as $virtuemart_method_id =>$productDisplayHtml) {
?>
<div class="<?php echo substr($type, 0, -1) ?> <?php echo substr($type, 0, -1).'-'.$virtuemart_method_id ?>">
<?php
echo $productDisplayHtml;
?>
</div>
<?php
}
}
}
this code block is usually below
echo shopFunctionsF::renderVmSubLayout('rating', array('showRating' => $this->showRating, 'product' => $this->product));
Hi Milbo
I have the same issue. How exactly must I solve this issue?
www.web-ict.be
Same problem here... :-\
Open your override
/templates/yourtemplate/html/com_virtuemart/productdetails.
there is a file called default.php. Open it. Search for
$productDisplayTypes = array('productDisplayShipments', 'productDisplayPayments');
foreach ($productDisplayTypes as $productDisplayType) {
if(empty($this->$productDisplayType)){
continue;
} else if (!is_array($this->$productDisplayType)) {
$this->$productDisplayType = array($this->$productDisplayType);
}
foreach ($this->$productDisplayType as $productDisplay) {
if(empty($productDisplay)){
continue;
} else if (!is_array($productDisplay)){
$productDisplay = array($productDisplay);
}
foreach ($productDisplay as $virtuemart_shipmentmethod_id =>$productDisplayHtml) {
?>
<div class="<?php echo substr($productDisplayType, 0, -1) ?> <?php echo substr($productDisplayType, 0, -1).'-'.$virtuemart_shipmentmethod_id ?>">
<?php
echo $productDisplayHtml;
?>
</div>
<?php
}
}
}
or
if (is_array($this->productDisplayShipments)) {
foreach ($this->productDisplayShipments as $productDisplayShipment) {
echo $productDisplayShipment . '<br />';
}
}
if (is_array($this->productDisplayPayments)) {
foreach ($this->productDisplayPayments as $productDisplayPayment) {
echo $productDisplayPayment . '<br />';
}
}
replace it with the code, which I posted above.
Thank you Milbo!
For me, it was the second alternative alteration that was visible in the code... (which is why I didn't see it the first time around).
"Re: Array text showing again on product detail page"
I did not mention the second code, because the topic contained the word "again". I wonder if there is a Faq about.
Hi Milbo
I am sure that it is me but I don't know with which code I need to replace this. I found the code where it is, but I just need to know the code. You said that you posted the codes above, but I don't know exactly what code
Thank you
I hope this FAQ clears it http://forum.virtuemart.net/index.php?topic=140113.0
Hi Milbo,
I have the same problem on the website of a friend. Joomla! 3.9.2 and Virtuemart 3.4.2 : on some pages, we see "Array" above the price of products, ont other it doesn't appear.
The template has no override for Virtuemart.
It seems only new categories and products are affected, not ancient.
How can I set something to mask this word?
Thanks!
Robert
URL of an affected product?
Sorry jenkinhill and thanks for your reply!
I explored the code and found a "productdetails/tmpl/perso.php" dated of 2015, default.php modified to not show the "back to category" button on the product detail page.
I changed the choice to "default" in the "product layout" parameter in "Templates and Layouts" configuration, then I used the new code of default.php and changed it to mask this button.
Robert
OK