Author Topic: shipment not shown in product details  (Read 318 times)

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 127
    • Barg IT
shipment not shown in product details
« 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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9085
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: shipment not shown in product details
« Reply #1 on: May 19, 2017, 12:04:50 pm »
There was a layout update, I think in vm3.0.18
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 127
    • Barg IT
Re: shipment not shown in product details
« Reply #2 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?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9085
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: shipment not shown in product details
« Reply #3 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
            }
         }
      }

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

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 127
    • Barg IT
Re: shipment not shown in product details
« Reply #4 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!

ctubu

  • Beginner
  • *
  • Posts: 6
  • A beginner
Re: shipment not shown in product details
« Reply #5 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.

ClaudioRomeo

  • Jr. Member
  • **
  • Posts: 92
    • VirtueMart Matters
Re: shipment not shown in product details
« Reply #6 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.
I'm the author of the VirtueMart 3 Reference Guide
https://www.virtuemartmatters.com