News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[SOLVED] Shipment method in product view display issue

Started by Cococoder, January 09, 2018, 11:06:16 AM

Previous topic - Next topic

Cococoder

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

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Cococoder

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

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Cococoder

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


Jörgen

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Cococoder

#7
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

tulen ise järele

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

Updated from what ???

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Cococoder

#10
"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

#11
Quote from: Jörgen on January 09, 2018, 13:58:05 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

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Cococoder

#13
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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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