add category name to permalinks on product page /category-name/product-name
What do you mean, “whatever I tried under ‘Permalinks’ didn’t work? Select “Shop with Category Base”. That adds the product category the single product URL. Don’t forget to choose something other than “default” under the Common Settings for permalinks.