Author Topic: [SOLVED] Shipment method in product view display issue  (Read 1198 times)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
[SOLVED] Shipment method in product view display issue
« on: January 09, 2018, 11:06:16 am »
Hi guys,

VirtueMart 3.2.10
Joomla! 3.8.3 Stable
PHP: 7.1.12

NOTE: same error with same config on PHP 7.0 on another site.


Effect: instead of the shipment method, a letter is displayed. It use to work fine. Link gives you a live example: https://store.seobytes.eu/index.php/en/product-variants/multi-variant-detail

Shipment methods display correctly in the cart page.

Trouble shooting steps taken so far:
Try with default beez template and clearing cache (no changes)
Try on two different sites (same issue)
Delete Shipment method and create new ones and clearing cache (no changes)

Any suggestion or help welcome.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #1 on: January 09, 2018, 11:27:09 am »
Does the W disappear when You disable the display of the shipment cost in Product details ?

This could be displayed from Your shipping plugin.

Check the code for the plugin.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #2 on: January 09, 2018, 12:37:11 pm »
No it does appear when it is enabled.
I am using the defaut weight zip code plugin
So far I did not find where this W comes from.
The product display (htdocs\components\com_virtuemart\views\productdetails) code is as follow:
<?php
      echo shopFunctionsF::renderVmSubLayout('rating', array('showRating' => $this->showRating, 'product' => $this->product));

      $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_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 assume the error is here echo substr($productDisplayType, 0, -1)  located in the div in the last foreach loop.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #3 on: January 09, 2018, 12:57:37 pm »
That code should work for everybody else.

I assume someone has accidentaly entered a W somewhere in ýour code or in the shipment method
  • sel pick up.


Have You altered the shipment method?
Entered some HTML in the shipment descriptions?
Do You have any problems with Your language files ? Try switching to English.

regards

Jörgen @ Kreativ Fotografi

Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #4 on: January 09, 2018, 13:13:21 pm »
Site is in english, product view and shipment method plugin not altered.
In my production site, letter appearing is different.
It seems the plugin does not fetch the proper data.
Issue persists even after complete virtuemart reset.

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #5 on: January 09, 2018, 13:33:37 pm »
I just did a reset and use the beez template
https://store.seobytes.eu/index.php/en/headpiece/cap-baseball-detail
Issue persists.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #6 on: January 09, 2018, 13:58:05 pm »
I think You have a fault in Your language file, please test with English.

In my shop i see "We ship to Sweden", You only see the W, there is something wrong here.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #7 on: January 09, 2018, 14:10:36 pm »
Again site is in english, using default english template and I just reset virtuemart thanks to the tool.
no other language installed
Language file not modified

If you have anything else in mind regarding testing the site in english please specify.

Debug is enabled and it shows: 2 vmdebug 1 Language, default shoplanguage (VmConfig::$jDefLang): en_gb en-GB

Also it has nothing to do with language file as the info that are displayed should be shipment method name desciption and cost which are user entered data in the shipment plugin

Country for shipment is set as available for all.

also IMPORTANT:it was working perfectly fine before the update and no modification has been made other than updating.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #8 on: January 09, 2018, 14:15:29 pm »
tulen ise järele

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #9 on: January 09, 2018, 14:20:04 pm »
Updated from what ???

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #10 on: January 09, 2018, 14:39:39 pm »
"tulen ise järele" was entered as shipment method name.
 now there is only the default plugin and issue persits
Updated from Virtuemat previous version (3.2.10 if remember correctly)  to Virtuemart current version 3.2.12

it seems that in two of my installs productDisplayShipment is not fetching the right data.

Any cue on how to solve that issue or guidance for continuing further the troubleshooting?

Also same data are displayed properly in the cart, it's where it gets confusing.

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #11 on: January 09, 2018, 15:20:35 pm »
In my shop i see "We ship to Sweden"

Hi again Jörgen, thanks for trying to help, just one question, as stated I am expecting to see shipment method available for the product.
In shipment methods open the shipment methods you wish to display and go to Configuration and set "Show on product details page" to yes.
When you do that. The shipment method name and description and price are displayed for eligible product country etc.

Is "Show on product details page" enable for your shipment methods?
If no, then this information is not relevant to the case. Indeed "we sheep to sweden" does not match what is expected from a shipment methods name or description hence the question. It seems we are speaking of two different things here.
Thanks for your help in this matter.

After further research
So it seems on your site this string is displayed: VMSHIPMENT_WEIGHT_COUNTRIES_SHIP_TO="We ship to "
Whereas I am expecting a variable containing the name and one containing the price of the shipment method as it was before the update. Do you have this info displayed on your site correctly?


Maybe the key lies in the XML

Further TS: the shipment logo is not displayed
All info are displayed correctly in the cart view


Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #12 on: January 09, 2018, 16:00:14 pm »
Yes display on product page must be chosen.

Have you not tried this before?
After that text comes information from the shipping method.
I would reinstall without uninstalling. And maybe check the language file.
Regards
Jörgen @ Kreativ Fotografi

Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #13 on: January 09, 2018, 16:22:06 pm »
Obviously it is chosen
I am double checking with your settings to verify we are speaking about the same thing. This string "We ship to" did not appear prior to the update.
Language file is fine (I just copied the exact same string that seems to cause issue in the reply above)
also I tried to reinstall from the tools just right now and the issue persists

I did a test with payment method and it did display paypal logo
I will try a complete re-install but it is not a proper solution for the production site


jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26843
  • Always on vacation
    • Jenkin Hill Internet
Re: Shipment method in product view display issue
« Reply #14 on: January 09, 2018, 18:35:29 pm »
I just looked at the generated page code for the url above, and see:

<div class="roductDisplayShipments roductDisplayShipments-0">
                   W               </div>

That should be "productDisplayShipments productDisplayShipments"  so have you edited  productdetails/default.php ?

The "With shipment....."  content is generated in  plugins/vmshipment/weight_countries/tmpl/default.php using:

echo vmtext::sprintf('VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT', $viewData['method']->shipment_name, $currency->priceDisplay($viewData['product']->prices['shipmentPrice']));
 
It is not unknown for errors to occur during installation, and reinstalling using Joomla's extentions manager usually overwrites any errors.
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.2.15.9866 on Joomla 3.8.8 PHP 7.0.30

Testing VM.3.2.15.9866 on J3.8.8