Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can Anyone Help Me? Problem with E-Commerce

Featured Replies

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)

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.

  • 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?

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.