Error happens when Chracteristics are added to a product

  • Posts: 1
  • Thank you received: 0
1 year 1 month ago #349582

-- 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.

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

  • Posts: 81508
  • Thank you received: 13064
  • MODERATOR
1 year 1 month ago #349587

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.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum