The transaction is another sign of the pressure that traditional retailers and pharmacies are facing from consumers shopping online.