hi abdul salam,

this error probably due the primary key hidden field. check if the primary key value is not set then unset the primary key data.

  $primaryKey = $data['primary_id'];

   if(empty($primaryKey)):
     unset($data['primary_id']);
   endif;

Reason: when the primary key is set model try to update the record in table.

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

© Copyrights 2025. All rights reserved.