May 25, 201412 yr Hi everyone I have been asked to make a website like this http://www.fieldandflower.co.uk/buy/medium-regular-meat-box_15.htm The customer wants a "point system" to build a box that you can buy! i dont know where to start with this i am used to building normal online shops through wix etc i can do the template in dreamweaver etc but i dont even know what you would call this to research it.. Has anyone got any ideas of even a website i can use to build a shop like this or how to use a script to do this? i would appreciate any info you guys might have! Thanks Simon (foster177)
May 25, 201412 yr Some simple javascript will do. Create a javascript dictionary with the name of product and price together: product_dictionary = {product_1: 100, product_2: 123, etc...}, and another dictionary with the product names and points together. Now use these 2 dictionary to build the lists. If you no nothing about javascript, then I suggest you either inform your client of this or seriously start reading up. The main topic you want to cover is javascript dictionaries.
May 25, 201412 yr Author Thanks Mlytics i dont mind on reading up about it but how would i then incorporate this into an eCommerce site? another question how much do you think a system like this would cost to get set up if i got a proper designer to do it?
May 25, 201412 yr How you would incorporate it? Something like this: HTML: <div class = "package_menu"> <input id="package_name_1" type="checkbox" name="packages" value="{{package_price}}"/> <label for="package_name_1" class="menu_item_option"><span>{{option}}</span></label> </div> <div class = "total_package_points"></div> Javascript: Dictionary: var package_point_dictionary = { '{{package_1}}': '{{points_1}}', '{{package_2}}': '{{points_2}}', '{{package_3}}': '{{points_3}}', '{{package_4}}': '{{points_4}}', '{{package_5}}': '{{points_5}}', }; When a user clicks a package: $('.package_menu input').click(function(){ input_selection = []; var total_value = 0; $(".package_menu input").each(function(){ if ($(this).is(':checked')){ package_name = $(this).attr('id'); package_points = Number(package_points_dictionary[package_name]); total_value = total_value + option_price; input_selection.push(option_name); }//if })//each $('.total_package_points').html(total_value);//Posts calculation to the DOM. });//click That's the crude basis of it. Don't hold it against me if there are some mistakes as I wrote that in this forum window with no syntax highlights, but the general logic is there. In terms of price, I'm not sure, but personally I wouldn't ask for very much for something like this.
Create an account or sign in to comment