Skip to main content

Product Options Error

More
15 years 1 week ago #25606 by plantpotphil
Hi,

I have just tried adding an option to a proudct and i get the following error on the product page on the front end:


Catchable fatal error: Object of class stdClass could not be converted to string in public_html/libraries/joomla/application/component/view.php on line 628.


Line 628 in that file is:

$option = preg_replace('/[^A-Z0-9_\.-]/i', '', $option);

Any idea what's causing this?

Thanks,

Phil

Create your own style of luxury bespoke furniture online

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

More
15 years 1 week ago #25621 by nicolas
Replied by nicolas on topic Re: Product Options Error
I would say that this comes from the fact that you have the register globals option of your php turned on, which you shouldn't. Because of that, the option variable we use in our view overwrites the option variable that joomla uses on it end and thus you can that error.

Three solutions:
1. you change that line by:
$option = preg_replace('/[^A-Z0-9_\.-]/i', '', JRequest::getString('option'));

2. You edit the file option of the view product via the menu Display->Views and you change the variable $option by $optionElement to avoid the conflict.

3. You deactivate that php option, supposing that you have access to your php.ini

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

More
15 years 1 week ago - 15 years 1 week ago #25626 by plantpotphil
Hi Nicolas, is this something I can change in my server's cPanel or something I could ask my hosting supplier to change for me?

Alternatively, what would be the repercussions of changing the $option = preg_replace('/[^A-Z0-9_\.-]/i', '', JRequest::getString('option')); line? Would this impact anything else ont he site? Or can it be changed without worry?

Thanks,

(I'm loving all the new features in the business edition by the way! Well worth the money)

Phil

Create your own style of luxury bespoke furniture online
Last edit: 15 years 1 week ago by plantpotphil.

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

More
15 years 1 week ago #25627 by nicolas
Replied by nicolas on topic Re: Product Options Error
Hi,

Apparently you can do it with cpanel:
docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/PhpIni

It might or might not impact the rest of the website. I think it won't but you never know. You can always revert the change if you have a problem...

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

More
15 years 1 week ago #25628 by plantpotphil
Hi Nicolas,

When you say "2. You edit the file option of the view product via the menu Display->Views and you change the variable $option by $optionElement to avoid the conflict." do you mean change all instances of $option to $optionElement in that view?

Create your own style of luxury bespoke furniture online

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

More
15 years 1 week ago #25629 by nicolas
Replied by nicolas on topic Re: Product Options Error
Yes, indeed.

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

More
15 years 1 week ago #25630 by plantpotphil
That's fixed that error, thanks for your help.

As another issue, the option doesn't seem to list anywhere on the page?

Where are options supposed to be displayed? :huh:

I have attached my view Product > Show.php in case its something in there which i causing the issue.

This attachment is hidden for guests.
Please log in or register to see it.


Create your own style of luxury bespoke furniture online

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

More
15 years 1 week ago #25634 by nicolas
Replied by nicolas on topic Re: Product Options Error
Maybe you didn't do the modification properly in the option file of the view product ?

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

More
15 years 1 week ago - 15 years 1 week ago #25635 by plantpotphil
I don't think so since I simply run a find-replace-all for field $option to $optionElement

That is the only modification I have made in that view. File attached.

This attachment is hidden for guests.
Please log in or register to see it.


Create your own style of luxury bespoke furniture online
Last edit: 15 years 1 week ago by plantpotphil.

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

More
15 years 1 week ago #25636 by nicolas
Replied by nicolas on topic Re: Product Options Error
Could you give a link to that page ?

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

More
15 years 1 week ago #25637 by plantpotphil
I will PM you the details to log in (site is in offline mode)

Create your own style of luxury bespoke furniture online

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

More
15 years 1 week ago #25640 by nicolas
Replied by nicolas on topic Re: Product Options Error
I checked your product on the back end and there is no option configured:
/administrator/index.php?option=com_hikashop&ctrl=product&task=edit&cid[]=15

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

More
15 years 1 week ago #25641 by plantpotphil
...doh.

I didn't realise you needed to hit the product save button after hitting the 'ok' button in the product options squeezebox.

sorry for wasting your time!!

Create your own style of luxury bespoke furniture online

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

Time to create page: 0.277 seconds
Powered by Kunena Forum