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

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #15 on: January 09, 2018, 21:48:28 pm »
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

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #16 on: January 10, 2018, 09:45:31 am »
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

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #17 on: January 10, 2018, 12:04:08 pm »
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

  • 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 #18 on: January 10, 2018, 12:32:10 pm »
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

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

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #19 on: January 10, 2018, 14:18:55 pm »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #20 on: January 10, 2018, 15:02:47 pm »
"With shipment %1s for %2s"

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

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 #21 on: January 10, 2018, 15:25:44 pm »
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

  • 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 #22 on: January 10, 2018, 17:42:25 pm »
The files you want are:

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

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1448
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Shipment method in product view display issue
« Reply #23 on: January 11, 2018, 09:15:38 am »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Cococoder

  • Beginner
  • *
  • Posts: 30
  • A beginner
Re: Shipment method in product view display issue
« Reply #24 on: January 11, 2018, 12:39:51 pm »
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.