Shares of Wayfair Inc. (W - Get Report) and Inc. (OSTK - Get Report) were rallying Tuesday as the U.S. Supreme Court began oral arguments on South Dakota v. Wayfair Inc., which addresses whether those vendors must collect state sales tax on online purchases made through their sites.

"For those making the bet that the Supreme Court doesn't reverse [an earlier decision on the issue], that would mean the stocks go up," said Tom Forte, an e-commerce analyst at D.A. Davidson, who tracks Wayfair, Overstock and  (AMZN - Get Report) . Wayfair was trading 2.4% higher and Overstock up nearly 1% at market close.

Central to the case is whether e-tailers must collect state sales tax on purchases made through their sites even if the firms lack a so-called "nexus" in a state like having a warehouse or store there. The state of South Dakota brought the lawsuit, and if it wins, a Supreme Court decision would likely upend a 1992 high-court ruling called Quill Corp. v. North Dakota that now holds sway over the matter.

Quill Corp. v. North Dakota only requires online retailers to collect sales taxes on purchases made in states where the vendor has a physical presence or substantial agents or activities. States complain that costs them lots of lost tax revenues, while traditional bricks-and-mortar retailers say they lose sales to online companies that don't collect sales tax.

Forte said a decision in favor of South Dakota could hurt both Wayfair and Overstock because they both sell big-ticket items like furniture, which would come with hefty sales taxes if bought at a bricks-and-mortar retailer. That's also true with electronics like those sold by a third respondent in the case, online retailer Newegg Inc., owned by Chinese-listed Hangzhou Liaison Interactive Information Technology Co.

Forte believes Wayfair could suffer more than Overstock because its customers tend to earn less and are more price-sensitive. But the analyst said both e-retailers could lose business that would limit their ability to expand beyond current offerings.

Another loser in this case could be small third-party vendors who sell their wares through services like Amazon's Amazon Marketplace. Amazon currently collects state sales tax where applicable on its own merchandise, but doesn't generally assess it on items shoppers purchase from third parties via the Marketplace.

Forte said that if the law or practice changes, leaving price and quality equal, consumers might favor products sold directly by Amazon instead of from third parties, due to easier returns and access to Amazon Prime's preferred shipping.

However, retail analyst Oliver Wintermantel of MoffettNathanson LLC said charging sales tax on online purchases wouldn't typically impact whether consumers buy products via e-tailers or traditional bricks-and-mortar stores. After all, Wintermantel said his firm has polled consumers and found they value selection, price and convenience first. Avoiding sales taxes only ranks sixth or seventh in importance.

Besides, consumers are more or less used to paying sales tax for online purchases these days. That's because Amazon — the world's largest e-tailer — already collects such taxes on all items it sells from its own stock to consumers in the District of Columbia and 45 states that charge sales taxes.

AMZN even collects sales taxes on third-party Amazon Marketplace purchases made by customers in Pennsylvania and Rhode Island, albeit not for consumers in other states. So, analysts predict that even a Supreme Court decision in favor of South Dakota would have only a negligible impact on Amazon.

However, experts say a larger implication of a Supreme Court ruling that goes against e-tailers is that the decision would set the stage for states to pass individual laws on collecting sales taxes from out-of-state online vendors.

Both Amazon and Wayfair support a single federal rule to govern such taxes, rather than up to 50 individual state laws and one for the District of Columbia. However, bills to address this situation in Congress so far has failed to gain traction.

Observers expect the high court to make a decision in South Dakota v. Wayfair by June 30.

This column appeared at 1:45 p.m. ET on Real Money, our premium site for active traders. Click here to get great columns like this from Jim Cramer and other experts each trading day. Inc  is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells AMZN? Learn more now.