Item Custom Field - Vendor Selection

  • Posts: 41
  • Thank you received: 1
4 years 9 months ago #308502

-- HikaShop version -- : 4.1.0
-- HikaMarket version -- : 3.0.2
-- Joomla version -- : 3.9.10
-- Error-message(debug-mod must be tuned on) -- : Call to a member function setQuery() on null
/administrator/components/com_hikamarket/types/vendor_selection.php:38

I recently downloaded a fresh version of the most recent hikamarket and when I go to add an item custom field and choose "vendor selector" in the administration, I get this error message when accessing it. Any help to get this up and going is appreciated. I'd like to get this feature up and running on my site soon.

Call to a member function setQuery() on null	
/home1/fivptzer/public_html/shop/administrator/components/com_hikamarket/types/vendor_selection.php:38
Call stack
#	Function	Location
1	()	JROOT/administrator/components/com_hikamarket/types/vendor_selection.php:38
2	hikamarketVendor_selectionType->getVendorList()	JROOT/administrator/components/com_hikamarket/types/vendor_selection.php:49
3	hikamarketVendor_selectionType->displayDropdown()	JROOT/plugins/hikashop/market_vendorselectfield/market_vendorselectfield_class.php:137
4	hikashopMarket_vendorselectfield->display()	JROOT/administrator/components/com_hikashop/classes/field.php:1688
5	hikashopFieldClass->display()	JROOT/administrator/components/com_hikashop/views/field/tmpl/form.php:241
6	include()	JROOT/libraries/src/MVC/View/HtmlView.php:697
7	Joomla\CMS\MVC\View\HtmlView->loadTemplate()	JROOT/administrator/components/com_hikashop/helpers/helper.php:2225
8	hikashopView->loadTemplate()	JROOT/libraries/src/MVC/View/HtmlView.php:230
9	Joomla\CMS\MVC\View\HtmlView->display()	JROOT/administrator/components/com_hikashop/helpers/helper.php:2208
10	hikashopView->display()	JROOT/administrator/components/com_hikashop/views/field/view.html.php:22
11	FieldViewField->display()	JROOT/libraries/src/MVC/Controller/BaseController.php:672
12	Joomla\CMS\MVC\Controller\BaseController->display()	JROOT/administrator/components/com_hikashop/helpers/helper.php:1946
13	hikashopController->display()	JROOT/administrator/components/com_hikashop/helpers/helper.php:1692
14	hikashopController->edit()	JROOT/libraries/src/MVC/Controller/BaseController.php:710
15	Joomla\CMS\MVC\Controller\BaseController->execute()	JROOT/administrator/components/com_hikashop/helpers/helper.php:1924
16	hikashopController->execute()	JROOT/administrator/components/com_hikashop/hikashop.php:72
17	require_once()	JROOT/libraries/src/Component/ComponentHelper.php:402
18	Joomla\CMS\Component\ComponentHelper::executeComponent()	JROOT/libraries/src/Component/ComponentHelper.php:377
19	Joomla\CMS\Component\ComponentHelper::renderComponent()	JROOT/libraries/src/Application/AdministratorApplication.php:101
20	Joomla\CMS\Application\AdministratorApplication->dispatch()	JROOT/libraries/src/Application/AdministratorApplication.php:159
21	Joomla\CMS\Application\AdministratorApplication->doExecute()	JROOT/libraries/src/Application/CMSApplication.php:196
22	Joomla\CMS\Application\CMSApplication->execute()	JROOT/administrator/index.php:51

Last edit: 4 years 9 months ago by Jerome. Reason: [code] tag is nice

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 9 months ago #308530

Hello,

Would it be possible to know the context of your issue ?
Where do you have that "vendor selector" ? Can you provide us a screenshot ?

Regarding the issue, the vendor selection type is deprecated and should use a namebox instead.
But in order to fix the fatal error, you can edit the mentioned file and on line 38, you could add just before the initialization of the database object :

$db = JFactory::getDBO();

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: 41
  • Thank you received: 1
4 years 9 months ago #308653

What my end goal is to be able to have customers select which vendor they want to get credit for the sale. I work with various emergency service groups and I'm setting up a system on my website where they get a percentage of each sale. Each emergency service group is considered the "vendor" in this case. Since the vendors will only receive a portion of the emergency-related products to purchase, I'm setting it up so that customers can select it on the products that I'm allowing to give a portion of the sale to the vendor, not their whole order. So I went to Custom Fields and created a "Vendor selection" field type for the "Item". It seems as though once I selected "Namebox" in the "Vendor selection type", I don't get the error message now. I created a test product to make sure it works. It displays just as I want it to, however, once the order is placed and I change the status to reflect that it is a completed order, the selected vendor does not actually get a percentage of that item.

I have set everything up just as it says to here: www.hikashop.com/support/documentation/1...tml#config_main_main

I'm still trying to figure out why it's not working as it should. Based on what I described above and the documentation I was following, is that still the correct way to do it or am I missing something new that is not in that documentation that I need to do in order to make it work?

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 9 months ago #308731

Hello,

So, you did configure HikaMarket to use the "vendor selector" ?
In that setting, you did choose the item custom field you created ?
CF : www.hikashop.com/support/documentation/1...onfig_market_general

When that setting is enable, HikaMarket will look at the custom field value (can be an order or an item custom field) to assign dynamically the vendor.
Please note that the product should be "vendor free" ; without any vendor assignation in the backend. The system won't override an existing vendor assignation.
You also need to not enable the "vendor location" in the same time than the "vendor selector", it could generate unwanted side effects depending your other settings.
www.hikashop.com/support/documentation/1...tml#tuto_market_conf

You don't need to confirm the order to see the vendor assignations. In the HikaShop backend, when displaying an order you will have a dedicated section for HikaMarket which list the vendor related to the order and provide basis details.

Thanks to the link you gave, I was able to see that the item custom field is working (the value is right stored in the cart).
But we don't have access to your backend so we are not able to see your settings or the content of your test orders.
It would be useful to have such kind of access ; you can send us via the "contact form" with a link to that forum thread so the support team will know what to do with it.

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: 41
  • Thank you received: 1
4 years 9 months ago #308962

Yes, the vendor selector is set to be chosen by the item custom field. I will reach out with the admin access in a few minutes. Thanks!

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 9 months ago #308983

Hello,

I was able to reproduce your configuration and issue in a local website.
I created a patch and installed a new package of HikaMarket 3.0.2 in your website.
The vendor assignation when using an "item custom field" should work better now.

Let me know if you have any feedback so I will include that patch in the official package.

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: 41
  • Thank you received: 1
4 years 9 months ago #309093

Thanks!

One bit of feedback I'll provide right now is that when I delete one of those test orders, on the "Orders unpaid" area on the vendor list it still shows I owe the test vendor for that deleted order. I see this as an issue if someone accidentally creates a duplicate order. If I delete the duplicate order, it will still show that I owe the vendor for that amount. If I go into the orders for that vendor specifically, it shows the correct amount. When I click on "Pay", then I see the order I deleted with an order number of "None" and it shows I owe them. I either have to pay them or cancel the order. After I cancel it, it still doesn't remove the amount from the "Orders unpaid". I'm not sure if this is an issue related to the custom field or if it is a problem in general, as I'm only testing the custom field selector at the moment.

Attachments:
Last edit: 4 years 9 months ago by wild4gsus.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 9 months ago #309115

Hello,

Thank you for your feedback.
It looks like the HikaMarket sub sale and transaction are not deleted ; but I would need more details about that order and how you deleted it.
Cancelling an order before deleting it would assure you that the "transaction" is also cancel (and not "confirmed" like in your screenshot).

I take a look at your order and its transactions ; I can see that you have two order transaction created, one is correct and the other one should not be there. Probably because the item custom field is affecting too much the vendor assignation and might let see the main order as the vendor order (because it just have one product for that vendor).
Now that I was able to see the nature of the issue, I will be able to investigate and try to reproduce it in my test environment.

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: 41
  • Thank you received: 1
4 years 8 months ago #309457

Since it was a test sale, I did not cancel it. I will in the future though. Thanks!

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

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