|
Answer» I don't know if anyone can help me but im after some code for a webpage I am trying to create a page on a website where you can customise a t-shirt where people pick the shirt style, the shirt color & the pocket they want and then go to the CHECKOUT I don't know if it is easier to embed a database with a UI or just to paste the code in the right place (p.s this is for a friend so it would help if it was easily explained over the internet)
hope i have given enough DETAILS What I would do is have a database table of shirts that stores the colour and style as well as a location to an image of a shirt in that colour. You could then have a second table of pockets where it would store the style of pocket and its colour as well as a location of the image of that pocket.
You could then use the method DESCRIBED here to overlay the image: HTTP://stackoverflow.com/a/6547828 ALTHOUGH I suggest you deal in PNG to allow transparency.
I would then use AJAX so when a user changes an option, it sends their style to the server that picks the image for the shirt, overlays the pocket onto it and returns the image to be displayed. jQuery is very good for dealing with AJAX so I recommend you use that.
Hope this helps, I imagine others may be able to give more information or other ways of doing this.
If you wanted to keep it even simpler and have limited colours, styles and pockets, you could just create an image for each combination and just return that, this would prevent you having to deal with image manipulation in PHP.
|