Use JQuery to implement a shopping cart similar to a shopping mall

Source: Internet
Author: User
Use the JQueryClone template to display product information, you can modify the td in the template to determine how many items are displayed in each row. The product information uses JSON data to simulate multiple clicks on the same product without repeated additions, but on the basis of the existing quantity + 1, the number of goods... syntaxHighlighter. all ();

 

Use the JQuery Clone template to display product information. You can modify the td in the template to determine how many items are displayed in each row.

Product Information is simulated using JSON data

If you click the same product multiple times, you will not add it again. Instead, the number of existing products is + 1,

You can also manually enter the number of items. If you enter 0, the item will be automatically deleted from the shopping cart (when you click the minus sign to less than 1, the system will also prompt whether to delete the item information from the shopping cart)

The price and total price of each product are calculated dynamically based on the addition and deletion operations.

Download link: http://up.2cto.com/2011/1207/20111207052620634.rar

Basic functions have been implemented. We recommend that you use IE6, and the browser run. Other Browsers Do not test the function.

 

 

HTML code:

 

Untitled document

Item List

No.: 000001

Name: aa

Price: 2.5

Description: aaaaa

No.: 000001

Name: aa

Price: 2.5

Description: aaaaa

 

No.: 000001
 

Name: aa

Price: 2.5

Description: aaaaa

 

No.: 000001
 

Name: aa

Price: 2.5

Description: aaaaa

Shopping Cart

Serial number No. Name Description Quantity Unit Price Total price Delete
1 000001 Aa Aaaaa

0 0

Total price 0.0

 

JS Code

View Code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.