General in personam jurisdiction
When an entity is essentially "at home" in a state (e.g. the state is the principal place of business, state of incorporation, or a person's residence), that state's court may exercise general in personam jurisdiction over that entity.
As said in BNSF Railroad Co. v. Tyrell, 581 U.S. ___ (2017), a state court has general in personam jurisdiction over an entity:
when their affiliations with the State are so
‘continuous and systematic’ as to render them essentially at home in the forum State.
Personal jurisdiction
A state court may also have jurisdiction where a claim arises out of activities undertaken by an entity in that state. The entity must have (International Shoe Co. v. Washington, 326 U.S. 310 (1945)):
certain minimum contacts with it such
that the maintenance of the suit does not offend "traditional notions of fair play and substantial justice."
The Supreme Court has recognized that such "minimum contacts" can exist when (Calder v. Jones, 465 U.S. 783 (1984)):
- the plaintiff is the focus of the activities of the defendant out of which the suit arises;
- where a libellous story concerns the affairs of a state resident;
- where the libellous story impugned a person's career that is centered in the state;
- where the "brunt of the harm, in terms both of respondent's emotional distress and the injury to her professional reputation,
was suffered in California";
- where "their intentional, and
allegedly tortious, actions were expressly aimed at [the state]."
Statutory authority
The above are limits that flow from the due process clause of the Fourteenth Amendment. The court must also have been actually granted such jurisdiction by statute. See e.g. the Commonwealth of Virginia's "Long Arm" Statute. It appears to grant jurisdiction to the extent permissible by International Shoe and BNSF, but not as far as allowed by Calder (this is my own reading, and I have not confirmed this limit by research).
California's is much more clearly expressed to match exactly the constitutional limits: "A court of this state may exercise jurisdiction on any basis not inconsistent with the Constitution of this state or of the United States."
Application
In your scenarios, where the seller is "at home" in Virginia or where the seller sells into Virginia, Virginia courts would have jurisdiction over the law suit.
In addition, if Calder's test is met (this depends on evidence of intention and effect), it would be constitutionally permissible for a state court in Virginia to have jurisdiction, even without selling into Virginia, but it does not appear that Virginia's long-arm statute reaches this far.