The circumstance is I have a site built in WordPress. And within my WordPress I have a shop. Here is the sequence of events in a hypothetical situation: 1. A Customer goes to my website and enters the Shop. 2. That customer adds an item to the cart. 3. While navigating within the shop there is a sticky cart (usually an icon of a shopping cart/basket with a count of items currently in the cart) on every page within the shop, that when clicked on, the customer may "check out". 4. The customer navigates out of the shop but is still within my WordPress, but the sticky cart no longer appears.
So I'm looking for a solution on how to display this sticky cart on every page outside of the shop reflecting the quantity of items currently in the cart. Respectfully, I'm not looking to pay for a service or program to solve this solution. Rather, I'm looking for the solution to implement myself.
I have tried using AJAX and Fetch for this but I'm getting CORS errors. Is there another solution?