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

Tentaurus

  • Jr. Member
  • **
  • Posts: 54
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: 9942
  • 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: 68
    • 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: 9942
  • 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: 68
    • 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: 9942
  • 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: 9942
  • 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/

RobertG

  • Beginner
  • *
  • Posts: 47
Re: Array text showing again on product detail page
« Reply #9 on: January 21, 2019, 11:04:43 am »
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

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27541
  • Always on vacation
    • Jenkin Hill Internet
Re: Array text showing again on product detail page
« Reply #10 on: January 21, 2019, 11:24:28 am »
URL of an affected product?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.3.10163 on Joomla 3.9.12 PHP 7.0.33

RobertG

  • Beginner
  • *
  • Posts: 47
Re: Array text showing again on product detail page
« Reply #11 on: January 21, 2019, 11:34:56 am »
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

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27541
  • Always on vacation
    • Jenkin Hill Internet
Re: Array text showing again on product detail page
« Reply #12 on: January 21, 2019, 12:16:40 pm »
OK
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.3.10163 on Joomla 3.9.12 PHP 7.0.33