Some vendor subzones not shown correctly

  • Posts: 16
  • Thank you received: 0
9 years 6 months ago #200800

-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.29

Hello,
on the vendor listing page, I need to show also Vendor's "country" and "state" fields (not only image and name).

I've added following code to listingcontent_img_title.php :

echo $this->fieldsClass->show($this->extraFields['vendor']['vendor_address_country'],$this->row->vendor_address_country);
	echo ' / ';
	echo $this->fieldsClass->show($this->extraFields['vendor']['vendor_address_state'],$this->row->vendor_address_state);

As you can see also in the screenshot, for "country" (Bratislava, Nitra, Zilina...) it works OK.
But for "state", which is the subzone of "country", it works only for the first of the "countries" (Bratislava) and for the others there is just the internal identificator of the value shown.

Any idea what could be wrong here and how to fix it?

Thanks much.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 6 months ago #200802

Hi,

Yes, it's almost logical.

The zone custom fields require to load the zone data to display correctly the state.
By default, HikaShop will just load the states of the default country zone ; so if you have a listing with zone from different countries, you have to force the loading of the state zones.

You can see the function "handleZone" in the file "administrator/components/com_hikashop/classes/field.php" which is used to load the addresses zones. You have also the function "handleZoneListing" which is quite similar.
I think that you should call the handleZone for your vendors so it will load the missing state elements which are missing in the cache.
Like we do, for example, in the listing of users :

$fieldsClass->handleZoneListing($fields, $rows);
(where $fields are the custom fields and $rows are the list of elements).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: wenglos

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.053 seconds
Powered by Kunena Forum