'george@jge.com', //paypal email address 'currency' => 'USD', //paypal currency 'cursymbol'=> '$', //currency symbol 'location' => 'US', //location code (ex GB) 'returnurl'=> 'http://mysite/myreturnpage',//where to go back when the transaction is done. 'returntxt'=> 'Return to My Site', //What is written on the return button in paypal 'cancelurl'=> 'http://mysite/mycancelpage',//Where to go if the user cancels. //Shipping Cost 'custom' => $invoice,//Custom attribute 'handling_cart' => '',// if using percentage handling below leave empty ); $adminEmail='email'; $shopName ='PayPal Shopping Cart'; $slogan ='Be in business in minutes. One page of code, css and product file.'; $pageTitle = 'CMXads.com "FREE". One Page PayPal Shopping Cart Ecommerce Php Website Script'; //page title $taxout='0';//leave as is $shipout='';//leave as is $cartLogo ='th2.jpg'; //other cart variables $tax_rate='6'; $taxstate='WV'; $currency='USD'; //base handling added to shipping $handling='2';//2 percent of order total $ship_rate='';//percent of order total. NOTE: LEAVE EMPTY TO USE PER ITEM SHIPPING FEE FROM PRODUCT FILE $disc_ship='75'; //more than 2 same items shipping 75% of combined item shipping from product file function flock_utf8_contents($filename){ $return = FALSE; if(file_exists($filename) and is_readable($filename)){ if($handle = @fopen($filename, 'r')){ while(!$return){ if(flock($handle, LOCK_SH)){ if($return = file_get_contents($filename)){ flock($handle, LOCK_UN); }}}fclose($handle);}} return mb_convert_encoding($return, 'UTF-8', mb_detect_encoding($return, 'UTF-8, ISO-8859-1', true));} $str=flock_utf8_contents($fl); function parse_file($str) { global $str; global $fields; $res=array(); $lines=array(); $output = array(); $output = explode("\n", $str); $output=array_filter($output); $output=array_map('trim', $output); foreach ($output as $key=>$data) { $lines = explode(';', $data); $res[]=array_combine($fields,$lines); } return $res; } $current_url = base64_encode("http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $res=parse_file($str); function find($string, $array){ foreach ($array as $key => $value) { unset ($array[$key]); if (in_array($string, $value)) { $array[$key] = $value;}} return $array;} ?> php simple PayPal ecommerce website cms with shopping cart just one page of code remarkable and free <?php echo $shopTitle;?>

 

$val) { echo '
'; echo "
"; // echo '
'; echo '
'; echo ""; echo '
'; echo '

'.$val["product_name"].'

'; echo '
'.$val["product_desc"].'
'; echo '
Price '.$currency.$val["price"]; echo '
'; echo '
Ship to state(PA,WV,NY etc):
'; //echo ''; echo '
'; echo ''; echo ''; echo ''; echo '
'; echo '
'; } ?>
"; ?> Shopping Cart '; $total = 0; echo "
"; print ''; echo ' '; echo ''; print ''; if (! empty($settings['handling_cart'])) { echo ' ';} echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
    '; $cnt = 1; $shipping_sum = '0'; $subtotal = '0'; foreach ($_SESSION["products"] as $cart_itm) { $product_code = $cart_itm["code"]; //$res=parse_file(); for($i=0; $i$rs) { ////////////////////////////////////////////////////////////////////////////////////////////////// echo '
    "; } echo '
    '; echo "\n"; echo ''.$rs['product_name'].' (Item # :'.$rs['product_code'].') '; echo "\n"; echo '
    Qty : '.$cart_itm['qty'].'
    '; echo "\n"; echo ''; echo "\n"; echo '
    '.$rs['product_desc'].'
    '; echo "\n"; echo '
    '.$currency.$rs['price'].'
    '; echo "\n"; echo '
    '; echo '× Delete'; echo ''; $subtotal += ($cart_itm['price']*$cart_itm['qty']); if($cart_itm["qty"] >1){ //exit; if (! $ship_rate) { $rs['shipping'] = $cart_itm['qty'] * $rs['shipping']; $rs['shipping'] = $rs['shipping'] * $disc_ship / 100; //exit; } $shipping_sum+= $rs['shipping']; }else{ $rs['shipping'] = $rs['shipping']; $shipping_sum +=$rs['shipping']; } //$rs['shipping'] = number_format($rs['shipping'],2); //$shipping_sum =$rs['shipping']; //$total = ($total + $subtotal); $total = $subtotal; echo ''; echo "\n"; echo ''; echo "\n"; // echo ''; //echo "\n"; echo ''; echo "\n"; if (! $ship_rate) { echo '';} $cnt ++; echo "\n"; }} echo '
'; echo ''; $tax =''; if($tax_rate && $_SESSION['ship_state'] == $taxstate){ $tax = $total * $tax_rate / 100; $tax=substr($tax,0,-1); //$total=$total+$tax; $taxout= "$taxstate tax: $tax_rate% $tax"; } $handling_out='0'; if ($handling && empty($settings['handling_cart'])) { $handling_out = $total * $handling / 100; $handling_out = number_format($handling_out,2); } if($ship_rate){ $shipping = $total * $ship_rate / 100; echo ''; $shipout= 'Shipping: '.$currency.number_format($shipping,2); $total=$total+$tax+$shipping+$handling_out; }elseif (!$ship_rate) {// combined shipping from cart // echo ''; echo "\n"; $shipout= 'Shipping: '.$currency.number_format($shipping_sum,2); $total=$total+$tax+$shipping_sum+$handling_out; } if($tax_rate && $_SESSION['ship_state'] == $taxstate){ echo ''; echo "\n"; echo 'Tax: '.$taxout.'
'; echo "\n"; } if($handling_out!='0' && empty($settings['handling_cart'])){ echo ''; echo "\n"; echo 'Handling: '.$handling_out.'
'; echo "\n"; }elseif(!empty($settings['handling_cart'])){ echo 'Handling: '.$settings['handling_cart'].'
'; echo "\n"; } echo $shipout.'
'; echo 'Sub Total. : '.$currency.number_format($subtotal,2); echo "\n"; echo '
Total. : '.$currency.number_format($total,2); echo '
'; if($subtotal>=0){ echo '

'; echo "\n"; } echo '
'; }else{ echo 'Cart is empty add something.'; } require_once 'bitcoin.php'; ?>
"; } if(isset($_POST["type"]) && $_POST["type"]=='add'){ $product_code = filter_var($_POST["product_code"], FILTER_SANITIZE_STRING); $product_qty = filter_var($_POST["product_qty"], FILTER_SANITIZE_NUMBER_INT); $return_url = base64_decode($_POST["return_url"]); //return url if($product_qty > 10){ die("
Maximum quantity of 10 reached.
"); } $res=parse_file($str); for($i=0; $i$rs) {///$cart_itm["qty"] $new_product = array(array('name'=>$rs['product_name'], 'code'=>$rs['product_code'], 'qty'=>$product_qty , 'price'=>$rs['price'])); if(isset($_SESSION["products"])){ $found = false; // echo 'found false'; // exit; foreach ($_SESSION["products"] as $cart_itm){ if($cart_itm["code"] == $product_code){ $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$product_qty, 'price'=>$cart_itm["price"]); //echo 'found true'; // exit; $found = true; }else{ $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$cart_itm["qty"], 'price'=>$cart_itm["price"]); } // var_dump($product); //exit; } if($found == false) { $_SESSION["products"] = array_merge($product, $new_product); }else{ $_SESSION["products"] = $product; } }else{ $_SESSION["products"] = $new_product; } } } // header('Location:'.$return_url); echo ""; } if(isset($_GET["removep"]) && isset($_GET["return_url"]) && isset($_SESSION["products"])){ $product_code = $_GET["removep"]; //get the product code to remove $return_url = base64_decode($_GET["return_url"]); //get return url foreach ($_SESSION["products"] as $cart_itm){ if($cart_itm["code"]!=$product_code){ $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$cart_itm["qty"], 'price'=>$cart_itm["price"]); } // if(isset($product)){ $_SESSION["products"] = @$product; //} } // header('Location:'.$return_url); echo ""; } ?>
  

";?>

"; ?>