VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: p.barg on May 18, 2017, 11:27:00 AM

Title: shipment not shown in product details
Post by: p.barg on May 18, 2017, 11:27:00 AM
Hello,

I'm updating a site from j3.6.5/VM 2.018 to J3.7.1/VM 3.2.2
The following issue occured: in the product details view the shipping costs are no longer shown (used to be "Per DHL für 3,00 €"),
Instead the character P is shown...
Any ideas?

-- Petra
Title: Re: shipment not shown in product details
Post by: Milbo on May 19, 2017, 12:04:50 PM
There was a layout update, I think in vm3.0.18
Title: Re: shipment not shown in product details
Post by: p.barg on May 19, 2017, 12:30:47 PM
That was a typo, sorry. I was using VM 3.0.18. In that version it works fine. The issues arises in VM3.2.2.
I've taken a look and the problem seems to be in file .../plugins/vmshipment/weight_countries/weight_countries.php.
Line 461: $html[$this->_currentMethod->virtuemart_shipmentmethod_id] = $this->renderByLayout( 'default', array("method" => $this->_currentMethod, "cart" => $cart,"product" => $product,"currency" => $currency) );
produces the letter P (at least in my installation). I replaced the line by the one in VM3.0.18 ($html = $this->renderByLayout( 'default', array("method" => $this->_currentMethod, "cart" => $cart,"product" => $product,"currency" => $currency) );) and that works ok for me.
Maybe you can take a look at that?
Title: Re: shipment not shown in product details
Post by: Milbo on May 19, 2017, 14:41:45 PM
Do you use in the default.php

      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_method_id =>$productDisplayHtml) {
               ?>
               <div class="<?php echo substr($productDisplayType, 0, -1) ?> <?php echo substr($productDisplayType, 0, -1).'-'.$virtuemart_method_id ?>">
                  <?php
                  echo $productDisplayHtml;
                  ?>
               </div>
               <?php
            }
         }
      }

???
Title: Re: shipment not shown in product details
Post by: p.barg on May 19, 2017, 14:52:59 PM
arrgh, your're right  :-[. Thought I had tested with the standard file default.php, but obviously I didn't...
Works ok with the standard default.php.

Sorry!
Title: Re: shipment not shown in product details
Post by: ctubu on June 13, 2017, 14:39:27 PM
FYI
J 3.7.2 and VM 3.2.3 I have same problem as described above. It arises when using PHP 7.1, on 7.0 there is not such problem.
Title: Re: shipment not shown in product details
Post by: ClaudioRomeo on June 15, 2017, 14:39:41 PM
@ctubu
Confirmed. J3.72 + VM3.2.2. In a php 7.1 environment this option doesn't work. In a php 7.0 one, it does.