- Posts: 1
- Thank you received: 0
Error happens when Chracteristics are added to a product
3 years 7 months ago #349582
by mighty
Error happens when Chracteristics are added to a product was created by mighty
-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Chrome 109.0.5414.119
-- Error-message(debug-mod must be tuned on) -- : Attempt to modify property "characteristics" on null
JROOT/components/com_hikashop/views/product/tmpl/show_block_characteristic.php:23
If any characteristic is added, either the ones that were created with the demo content, or a new one created afterwards, the same error appears on that specific product.
If the product has no chracteristics added, no error is present.
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Chrome 109.0.5414.119
-- Error-message(debug-mod must be tuned on) -- : Attempt to modify property "characteristics" on null
JROOT/components/com_hikashop/views/product/tmpl/show_block_characteristic.php:23
If any characteristic is added, either the ones that were created with the demo content, or a new one created afterwards, the same error appears on that specific product.
If the product has no chracteristics added, no error is present.
Please Log in or Create an account to join the conversation.
3 years 7 months ago #349587
by nicolas
Replied by nicolas on topic Error happens when Chracteristics are added to a product
Hi,
I suppose you added the characteristic to the product but didn't add any variant to the product yet. So the product is in an "in-between" state leading to that error.
Change the line:
if(empty($this->element->characteristics))
to:
if(empty($this->element->characteristics) || empty($this->element->main->characteristics))
in the file /components/com_hikashop/views/product/tmpl/show_block_characteristic.php and it should avoid the error.
But you'll still have to add variants to your product.
I suppose you added the characteristic to the product but didn't add any variant to the product yet. So the product is in an "in-between" state leading to that error.
Change the line:
if(empty($this->element->characteristics))
to:
if(empty($this->element->characteristics) || empty($this->element->main->characteristics))
in the file /components/com_hikashop/views/product/tmpl/show_block_characteristic.php and it should avoid the error.
But you'll still have to add variants to your product.
Please Log in or Create an account to join the conversation.
Time to create page: 0.263 seconds