JavaScript (JS) shopping cart with PayPal API integration in a static landing site
Task:
Develop a shopping cart module with PayPal API integration (without using CMS or database). The site is static, products are added manually on separate HTML pages. The assembly of the site's index files occurs on the fly via SSI
Brief description:
The user adds products to the cart on each product page. Each product has only a 'price' and a 'quantity' selection (default -1). Some products have an additional 'variant' parameter, which may change the price but not the weight. If it exists, it should be displayed next to the price.
The module calculates the total cost and total weight, determines the shipping cost (based on 4 weight categories), and forms the final amount.
After that, the user clicks the "Pay" button, goes to PayPal, enters their details, and makes the payment.
Then — a redirect back to the specified page of the site.
On the product page, add:
- "Add to cart" button
- "Cart" button displaying the current quantity in the cart (dynamically)
Cart structure:
- Table with products:
- Name / variant, if available
- Quantity
- Weight, kg
- Price per unit, USD
- Total price per line
- At the bottom:
- Total weight
- Shipping cost
- Final amount
- "Pay via PayPal" button
Technical features:
1. Calculation of the amount: Total cost of products + Shipping cost (depends on total weight)
2. Product data is taken from a separate products file with variables: id, name, variant, weight, price
3. Shipping cost is taken from a shipping file with variables: maxWeight, cost
4. Cart data storage — in localStorage
5. PHP and databases are not used
6. Support for multiple products on different pages. The number displayed on the cart icon on different product pages should be synchronized.
7. Redirect after payment: "Successful payment" (return_url), "Payment canceled" (cancel_url)
8. Use 'PayPal API' to request payment and shipping address. Client ID and Merchant ID will be provided
What is not included in the task:
- Design is not required
- Mobile device layout is not required
- No need to manually insert code on each product page. One example of a simple product and another with a variant is sufficient.
What should be delivered:
1. Example of two HTML pages with the product addition button
2. "cart.html" page where the calculation, shipping selection, and payment transition occur
3. A working sample on your side. I will not be able to provide access to the site or PayPal.
Deadline: 3-5 days
Budget: Please suggest
Client's review of cooperation with Maksym C.
JavaScript (JS) shopping cart with PayPal API integration in a static landing siteThank you, Maxim, for the collaboration.
You are better than most developers I have encountered.
And I have encountered often and a lot.
I will recommend you in my circle (I work at Google Maps)
Freelancer's review of cooperation with Timur Grigoryan
JavaScript (JS) shopping cart with PayPal API integration in a static landing siteI sincerely thank Timur for the opportunity to collaborate. Working with him was truly pleasant and comfortable. The task turned out to be interesting and inspiring, and thanks to the detailed and well-prepared technical assignment, the work on the project was as efficient as possible. I would like to highlight that Timur was always available and responded promptly to questions. I greatly appreciate this collaboration and confidently recommend him to everyone!
-
454 5 0 Good day! Write to me. I will do it quickly and efficiently literally in 2 days...................................................
Current freelance projects in the category Java
Application developmentI wish to create a mobile application for communication, the app should have audio and video calls, group chat creation, the ability to sync with phone contacts, account settings: email binding, 2FA, phone number, the ability to customize app notifications, change the app… Java, Python ∙ 1 day 9 hours back ∙ 33 proposals |