adding please select to custom field drop down issue

  • Posts: 490
  • Thank you received: 2
7 years 10 months ago #259225

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

hi

attached is my custom field settings.


what i wish is for the vendor to select an option from the drop down. if he does not the system will call an error from the please select with no value.

im having the following errors

Warning: Creating default object from empty value in
/home.../administrator/components/com_hikamarket/classes/product.php on line 92

Warning: Attempt to assign property of non-object in /home.../components/com_hikamarket/views/productmarket/tmpl/form_image.php on line 43

Warning: Attempt to assign property of non-object in /home...components/com_hikamarket/views/productmarket/tmpl/form_image.php on line 42.

how can i have a please select option that will call an error if vendor does not pick from the drop down

thanks

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 10 months ago #259231

Hi,

Is that working in the HikaShop backend ?

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: 490
  • Thank you received: 2
7 years 10 months ago #259329

yes, its working perfectly in the back end.

thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 10 months ago #259374

Hi,

Replace

		$product = $fieldsClass->getInput('product', $oldProduct, true, 'data', false, 'display:vendor_product_edit'); // 'all');
		if(empty($product))
			$ret = false;
By
		$product = $fieldsClass->getInput('product', $oldProduct, true, 'data', false, 'display:vendor_product_edit'); // 'all');
		if(empty($product)) {
			$product = $_SESSION['hikashop_product_data'];
			$ret = false;
		}
And it will remove the warning.

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: 490
  • Thank you received: 2
7 years 10 months ago #259557

hi

i tried this but the errors are still appearing.

i edited this file
/.../administrator/components/com_hikamarket/classes/product.php

i'm not sure if this is the file because no file was mentioned.

out of curiosity i tried this change

$product = $fieldsClass->getInput('product', $oldProduct, true, 'data', false, 'display:vendor_product_edit'); // 'all');
		if(empty($product))
			$ret = false;

to this
$product = $fieldsClass->getInput('product', $oldProduct, true, 'data', false, 'display:vendor_product_edit'); // 'all');
		if(empty($product)) 
			return false;

and it worked. not sure what it does but it worked.

what should i do? thanks

Last edit: 7 years 10 months ago by ronron.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 10 months ago #259586

Hi,

The fact that we are using a variable to mark the element as failed is for a reason.
Putting a "return" for sure will not show you any message but it will also not stored the data into the session to re-show them to the user in the front-end ; so everything he wrote for the product is being lost.

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.

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