Click here to Skip to main content
15,885,546 members

how to make cart empty intially

Abhimanyu vij asked:

Open original thread
as i m trying to add product into the cart which i have done successfully but next time after run my project in visual studio that earlier product already there in the cart.but i want when new user visit the website and add the product into the cart that cart should be an empty. here is the code for to add value in the cart can any body plz tell me how i can pen:
HTML
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" />
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="abhimanyu.vij@gmail.com" />
<input type="hidden" name="item_name" value="pen" />

<input type="hidden" name="amount" value="1.00" />
 <input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="shopping_url" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="cancel_return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="bn" value="PP-ShopCartBF:x-click-but22.gif:NonHosted" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" name="submit"
    alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
    height="1" />
</form>
pencil
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="2" />
<input type="hidden" name="business" value="abhimanyu.vij@gmail.com" />
<input type="hidden" name="item_name" value="Pencil" />
<input type="hidden" name="amount" value="2.00" />
<input type="hidden" name="shipping" value="1.00" />
 <input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="shopping_url" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="cancel_return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="bn" value="PP-ShopCartBF:x-click-but22.gif:NonHosted" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" name="submit"
    alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
    height="1" />
</form>
Car
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="3" />
<input type="hidden" name="business" value="abhimanyu.vij@gmail.com" />
<input type="hidden" name="item_name" value="Car" />
<input type="hidden" name="amount" value="10.00" />
<input type="hidden" name="shipping" value="1.00" />
 <input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="shopping_url" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="cancel_return" value="http://localhost:50075/HTMLPage1.htm" />
<input type="hidden" name="bn" value="PP-ShopCartBF:x-click-but22.gif:NonHosted" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" name="submit"
    alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
    height="1" />
</form>
View Cart:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="display" value="1" />
<input type="hidden" name="business" value="abhimanyu.vij@gmail.com" />
<input type="hidden" name="shopping_url" value="http://localhost:50075/HTMLPage1.htm" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart_02.gif" name="submit"
    alt="Make payments with PayPal - it's fast, free and secure!" />
</form>
Tags: ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900