I am inserting custom options programmatically for multiple products from some template where I add options and assign them to products But when I edit those options and assigned it to more products then it double added for previously assigned products. How can I check if that custom option is already assigned or exists for any product so it will only edit for that product.
I can't add whole code here and yes, I am referring below link but my options are dynamic. https://webkul.com/blog/create-custom-option-programmatically-in-magento2/