the text 'array' is shown and/ shipment is not shown on the product details page

Started by Milbo, May 02, 2018, 14:09:14 PM

Previous topic - Next topic

Milbo

It is very likely an old layout override.

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($productDisplayType0, -1?> <?php echo substr($productDisplayType0, -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 />';
    }
}


this code block is usually below

echo shopFunctionsF::renderVmSubLayout('rating', array('showRating' => $this->showRating, 'product' => $this->product));


replace it with this code

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
}
}
}


Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/