While talking with a pro bono client today they were wondering how hard it would be to add an “add to cart” button instead of a single item “buy now” button on their site. At the time their website was developed (approximately 7 years ago) they only offered one item for sale.
Of course 7 years later they now have 5 items they sell online. Currently the solution is not setup to add items to cart but after doing a little bit of research today, it’s not hard to covert those… This is an example of what the “single purchase button” is coded…
The first step to converting the button is to add this to the form tag:
The next thing you will want to do is to locate this line of code:
and replace it with this:
This line will also need to be added to the form tag:
Then you will want to locate the input-type-image area and replace that code with this:
The finished product once you have finished inputting everything and swapping out these snippets of code should look something like this:
Fortunately for me the non-profit that was asking about this has now got their in-house IT guy to make the changes, it’s somewhat time consuming and if you only have 5 products or so, you can probably almost generate new add to cart buttons just as fast, which is what I recommended.