Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Prevent Duplicate Product Code Rate Topic   - - - - -

 
  • alaa
  • Advanced Member
  • Members
  • Join Date: 18-Mar 18
  • 132 posts

Posted 13 May 2019 - 06:38 PM #21

I made the same action and see that the product was not created. If you want to add error notification, use the following code

 

if (empty($product_id)) {
    $pid = db_get_field("SELECT product_id FROM ?:products WHERE product_code = ?s", $product_data['product_code']);
    if (!empty($pid)) {
        $can_update = false;
        fn_set_notification('E', __('error'), __('unique_sku_error'));
    }
}

Then add unique_sku_error language variable with the required value

 

You are right, eComLabs. 

 

I get it working finally. The error notification is very handy, thank you very much. 

 

Best Regards, 

Alaa



 

Posted 13 May 2019 - 08:04 PM #22

You are right, eComLabs. 

 

I get it working finally. The error notification is very handy, thank you very much. 

 

Best Regards, 

Alaa

 

If you like to find products with duplicate product codes you can use our addon - Incomplete products.

 

orders_form.png


Only helpful and unique addons https://store.retailfactory.ru