Answer:
The first sentence makes sense; the second one doesn´t.
Step-by-step explanation:
Having a cart full of items
is a subordinate clause that makes sense because it refers to the subject Anya in the principal sentence
Anya let the woman buying just one thing go ahead of her in line.
Because Anya has a cart full of items, she decides to let the woman, who is buying just one thing, go ahead of her in line.
In the second sentence the same subordinate clause doesn't coincide with the subject
the woman