Author Topic: Array text showing again on product detail page  (Read 760 times)

Tentaurus

  • Jr. Member
  • **
  • Posts: 50
Array text showing again on product detail page
« on: April 12, 2018, 13:01:31 pm »
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.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Array text showing again on product detail page
« Reply #1 on: April 12, 2018, 20:01:07 pm »
It is very likely and old layout override. Your default.php in productdetails view should have something like

Code: [Select]
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
}
}
}

this code block is usually below
Code: [Select]
echo shopFunctionsF::renderVmSubLayout('rating', array('showRating' => $this->showRating, 'product' => $this->product));
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

web-itc

  • Beginner
  • *
  • Posts: 18
  • A beginner
Re: Array text showing again on product detail page
« Reply #2 on: April 16, 2018, 13:29:03 pm »
Hi Milbo

I have the same issue.  How exactly must I solve this issue?
www.web-ict.be

Nilsy

  • Jr. Member
  • **
  • Posts: 62
    • Sexhibition
  • VirtueMart Version: 3.2.1
Re: Array text showing again on product detail page
« Reply #3 on: April 19, 2018, 14:16:10 pm »
Same problem here...  :-\
Joomla 3.6.5

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Array text showing again on product detail page
« Reply #4 on: April 19, 2018, 23:44:13 pm »
Open your override

/templates/yourtemplate/html/com_virtuemart/productdetails.

there is a file called default.php. Open it. Search for
Code: [Select]

$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
Code: [Select]
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Nilsy

  • Jr. Member
  • **
  • Posts: 62
    • Sexhibition
  • VirtueMart Version: 3.2.1
Re: Array text showing again on product detail page
« Reply #5 on: April 20, 2018, 21:53:08 pm »
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).
Joomla 3.6.5

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Array text showing again on product detail page
« Reply #6 on: April 21, 2018, 11:32:09 am »
"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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

web-itc

  • Beginner
  • *
  • Posts: 18
  • A beginner
Re: Array text showing again on product detail page
« Reply #7 on: April 24, 2018, 23:34:11 pm »
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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9591
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Array text showing again on product detail page
« Reply #8 on: May 02, 2018, 14:10:15 pm »
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/