There are a few strategies you could use to avoid making impulse purchases while shopping online. One strategy is to develop a budget by allocating a certain amount every month to clothing, food, entertainment, etc. Use past months to come up with a goal for yourself.
Another strategy is to place items in your online "shopping cart" but make a rule to wait at least 24 hours before you check out. If you still really want or need the item after 24 hours, check your budget, and if it within your budget, buy it. If the item is not within your budget you can usually save the item for later in case you have more funds at a later date.