How to add/show a field on Vendor Listing Page?

  • Posts: 6
  • Thank you received: 0
9 years 8 months ago #192183

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29

Hi

Im trying to add a custom Field (city) to each vendor on the vendor listing Page (front-end). Do i need to add a custom field or can i take an existing field to do so? Either way, i can't show the field on the vendor listing page. I think im close but i couldn't figure out how to show it in the front-end.

Thanks for any help.

Cheers
Chris

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 8 months ago #192228

Hi,

Yes you can use an existing vendor custom field.
And you can simply configure the "Display" part in order to indicate where the custom will be display (vendor page, vendor listing, etc).

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.

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

  • Posts: 6
  • Thank you received: 0
9 years 8 months ago #193096

Hi Jerome

Thanks again for your response. I found the existing custom field "address_city" and opened it. I tried to find the option in the "Display" part. But there is no option called Vendor listing :unsure:

I just see:
Frontend
Vendor order display
Vendor order edition
Vendor user show
Vendor user edit

All of them are checked yes. Access rights are set to all.

On top right there is a dropdown called:
The display is restricted for: all (what does this mean?)

What am i doing wrong?

Cheers
Chris

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 8 months ago #193104

Hi,

That's right, sorry for the confusion.
For the vendor listing, HikaMarket is loading the custom fields which are displayed in the "fornt-end".
When you are displaying the vendors in a table, it will display the custom fields as columns.
If you are displaying the vendors in div list ; you will have to override the views in order to display the custom fields that you want to display.

Here the code used in the listing table to display all custom fields in different columns:

if(!empty($this->extraFields['vendor'])) {
	foreach($this->extraFields['vendor'] as $fieldName => $oneExtraField) {
?>
		<td class="hikamarket_vendor_custom_<?php echo $oneExtraField->field_namekey;?>_row"><?php
			echo $this->fieldsClass->show($oneExtraField, $this->vendorFields->$fieldName);
		?></td>
<?php
	}
}

If you want to display one single custom field, you could use:
$fieldName = 'vendor_address_city';
echo $this->fieldsClass->show($this->extraFields['vendor'][$fieldName], $this->vendorFields->$fieldName);

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.
Last edit: 9 years 8 months ago by Jerome.

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

  • Posts: 4
  • Thank you received: 0
9 years 7 months ago #197506

-- HikaShop Business version -- : 2.4.0
-- HikaMarket Multivendor: 1.6.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.38

Hello,

I am trying to do the same thing as the OP. I have created custom fields. I have chosen to display them on everything except the Back End Listing. I've attached screenshots.

The columns and column headers are displaying on the Vendors Listing page but not the values. The values display in the Back End Form.

I see the code snippet you referenced in this thread within my listingcontainer_table view file. Does the listingcontainer_table view file need to be altered?

Thank you for any help you can give.

Warren

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #197553

Hi,

Would it be possible to know which screenshot comes from where (and which data it should display) ?
I see various screenshots but I don't understand the second and the last one.

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.

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

  • Posts: 4
  • Thank you received: 0
9 years 7 months ago #197588

The second one is my Vendors List. Here is the link to the page in development:
www.pixelmatte.com/index.php/vendors-listing

You will see that the fields are displaying what is on the form before it is filled out. You can see it here in the last section of the vendor registration form ( vendor list page ):
www.pixelmatte.com/index.php/vendor-details

The last screenshot shows that the form values have been filled out and passed along to the backend in the Your Vendor form under the main information tab.

So the custom fields on the Vendors Listing page are not displaying in the table like they are in the backend form. They are either blank or the default values.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #197592

Hi,

Thanks for the details.
Can you please use the line

echo $this->fieldsClass->show($oneExtraField, $this->row->$fieldName);
instead of the line
echo $this->fieldsClass->show($oneExtraField, $this->vendorFields->$fieldName);
In the view ; it looks like the vendorFields variable is wrong initialized.

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: digglescreative

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

  • Posts: 4
  • Thank you received: 0
9 years 7 months ago #197598

Works.

Thanks!
Warren

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

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