You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like you can't delete catalog options in version 4.0.2.3.
Root Cause: there is no function getTotalProductsByOptionId in admin/model/catalog/product.php
Solution: add function getTotalProductsByOptionId to admin/model/catalog/product.php
/**
* Get Total Products By Option ID
*
* @param int $option_id
*
* @return int
*/
public function getTotalProductsByOptionId(int $option_id): int {
$query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "product_option` WHERE `option_id` = '" . (int)$option_id . "'");
return (int)$query->row['total'];
}
This will trigger the error if the option is in use, once it's no longer in use the option can be deleted.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey
It looks like you can't delete catalog options in version 4.0.2.3.
Root Cause: there is no function getTotalProductsByOptionId in admin/model/catalog/product.php
Solution: add function getTotalProductsByOptionId to admin/model/catalog/product.php
This will trigger the error if the option is in use, once it's no longer in use the option can be deleted.
Beta Was this translation helpful? Give feedback.
All reactions