News:

Support the VirtueMart project and become a member

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

Yes I did a test by editing echo substr($productDisplayType,0, -1) to echo substr($productDisplayType,1). even without that edit, issue persists (I edited back to normal).

I'll try your suggestion and let you know the results.

Thanks for your input.

Cococoder

#16
Hi Jenkinhill,

I uncommented and edited the vmdebug in the default.php file and verified that $viewData['method']->shipment_name and  $currency->priceDisplay($viewData['product']->prices['shipmentPrice']) from the line
echo vmtext::sprintf('VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT', $viewData['method']->shipment_name, $currency->priceDisplay($viewData['product']->prices['shipmentPrice']));
returns the correct data.

By printing the variables I could determine that $this->$productDisplayType is only made of an array of length one, with the value being the first letter of VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT

Uninstalling and reinstalling the shipment plugin did not solve the issue - cached was cleared.

Note: to narrow down the cause of the error, I edited default.php in weight_countries this way: echo  $viewData['method']->shipment_name.' '.$currency->priceDisplay($viewData['product']->prices['shipmentPrice']);

The result is that it is now the first letters of the shipment_name variable that is displayed.

Cococoder

Okay, keeping you guy posted about the issue.

I just di a fresh installed of joomla and a fresh install of virtuemart without any additional edit, plugin, nor template. Everything is straight out of the box.

Issue is there. It seems we have a legitimate bug here.

PHP version:    7.1.12
Joomla! Version   Joomla! 3.8.3 Stable [ Amani ] 12-December-2017 15:00 GMT
Joomla! Platform Version   Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
VirtueMart 3.2.12
You can check here with debug mod enable
https://store.seobytes.eu/index.php/test/test-detail

jenkinhill

Can you try a different PHP version? I have seen some bug reports with PHP 7.1.12  I think most of us are still on PHP7.0.x (or earlier).

Also try creating a language override for VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT  using  "With shipment %1s for %2s"  and if you see just the W again try changing the wording.

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

Cococoder

#19
I am taking care of the php downgrade. Meanwhile can you sketch out for me how the data from
echo vmtext::sprintf('VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT', $viewData['method']->shipment_name, $currency->priceDisplay($viewData['product']->prices['shipmentPrice']));
are assigned to $productDisplayShipments
My goal is to write a piece of code to get the shipment method info. They are correctly displayed in the debug mode therefore I should be able to call them as simply in the body of the page.

Any hint regarding how to do this would be appreciated.

Jörgen

"With shipment %1s for %2s"

%1s = Shipment name
%2s = Cost of shipment

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

#21
thanks Jörgen, you actually answer what is the value off $productDisplayShipments , not how/where this value is assigned.

I understand this might be trivial to a lot of you, unfortunately it is not trivial to me.

Thanks again for your input guys

jenkinhill

The files you want are:

plugins/vmshipment/weight_countries/weight_countries.php
components/com_virtuemart/views/productdetails/view.html.php
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

Jörgen

If You didn´t see the text "With shipment .... "  before the update You must have some overrides.
You may have an language override for the key:
"VMSHIPMENT_WEIGHT_COUNTRIES_WITH_SHIPMENT"
\plugins\vmshipment\weight_countries\language\en-GB\en-GB.plg_vmshipment_weight_countries.ini

You can also have an override in
/templates/your-template/html/vmshipment/weight_countries/default.php

There is where my text "We ship to.. " is added


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

#24
Hi Jörgen,

The test site I am troubleshooting now with your help is as barebone as you can get, no override here or customisation. Fresh install.

Those said, the the template I use on the production site has a product detail override but this is not the matter at hand at the moment.

If the debug mode reports correct information, there should be a way to get this working properly even on php 7.1

@jenkinhill
Thanks for the pointer, I'll try to find my way in the code.
[EDIT] Rolling back to php 7.0 solved the issue

Thanks for helping me out on that one.