Warning: include(/home/uswsc3/public_html/uswebsitecreations.com/discount_example/cart_discount.php) [function.include]: failed to open stream: No such file or directory in /home/uswsc3/public_html/discount_example/cart.php on line 1

Warning: include() [function.include]: Failed opening '/home/uswsc3/public_html/uswebsitecreations.com/discount_example/cart_discount.php' for inclusion (include_path='.:/opt/php53/lib/php') in /home/uswsc3/public_html/discount_example/cart.php on line 1
Discount Code Example for Wojo Groups 'SimpleCart.js' Script
SimpleCart Logo from the The Wojo Group Logo

 

(A simple 'Checkbox' that adds a specific state's sales taxes for the Wojo Groups 'SimpleCart.js' Script)

 

(A simple 'Discount Code' adds a PayPal 10% Discount at Checkout for the Wojo Groups 'SimpleCart.js' Script)

 

Shopping Cart (click to download this example)

  • Empty Cart
  • Proceed to Checkout
  • Image
  • Product Name, Description, Tee-Shirt Slogan or Message, Color, & Size...
  • Delete
  • Qty
  • Unit Price
  • Subtotal

Your Discount Coupon Code was Accepted Successfully! An Item Should Have Been Placed in Your Shopping Cart Indicating The Discount Was Accepted.

 

Note: Discount will be applied when clicking the 'Checkout' button and will be viewable in PayPal.

  • Sub Total
  • Shipping
  • Grand Total

Add This Item To Your Cart Here

Heart Candle Main Image

Item # 4501 - Custom Tee

Custom Tee-Shirt with Your Choice of Slogan or Message

Item Price:

$35.50

Select Your Tee-Shirt Size:
Color Choice for Tee-Shirt:
Type in your Favorite Fragrance
images/tee_thumb.png

Find this Line in the simpleCart.js (Version = '2.2.2')

 

form.appendChild( me.createHiddenElement( "amount_" + counter, item.price ) );

 

And Modify it to This

 

form.appendChild( me.createHiddenElement( "amount_" + counter, this.currencyStringForPaypalCheckout( (item.price)* discount ) ) );



I should also mention that for the Discount Code Entry Page; I used ''Web Page Password Protect'' from www.zubrag.com


My Notes:

Pay close attention to the ''cart.php'' and the ''cart_discount.php'' files.

The ''cart.php'' include's statement:

[<]?php include("/home/uswsc3/public_html/uswebsitecreation.com/discount_example/cart_discount.php"); ?[>]

To find your relevant path (like the one above) use http://www.yourdomain.com/cart_discount.php?help

Will continue to redirect to ''cart_discount.php'' page until the correct ''Discount Code'' is entered.

Once the correct ''Discount Code'' is entered however, the redirect no longer exist and the ''cart.php'' page is loaded. This is where the 10% Discount cookie is set.

The code uses two (cookies) to operate.

''discount'' cookie sets the 10% (.9) Discount.

''verify'' verifies the discount was set to .9

All cookies (including the simpleCart cookies) have been set to 1 day (24 Hours).