Jump to content

shopping cart


jagguy

Recommended Posts

yes i know this as i said i already found a php free cart which failed.

 

The reason i asked is that searhcing through dozens of links I didn't find 1!

I spent over an hour looking and getting nowhere.

 

Just putting 'php free shopping cart etc ' gives you free as in download cost or trial or some other rubbish. Most tags put free to attract hits as you should no this.

 

Rarely free means free and i think it is wise to ask a place where you might find 1 from someone's experience, and also i might still find 1 on google.

 

This is a forum where we can ask these questions so we don't end up spending hours on google.

 

 

 

Link to comment
Share on other sites

ZenCart, wordpress has a cart also

 

The thing I want was to have a shopping cart to ad onto an existing website with tables of information. Like an extra link on a table.

The ones i see are for a few products but a shop can have tables of information which can require a link for further information.

Link to comment
Share on other sites

I want to add a function to allow an online purchase from an existing php website. eg I have a table of value i just want to click a link and we get to some purchase option.

 

What i am finding is a free shopping cart has an all in 1 solution where the whole website is created from scratch. After a lot of setups and confusion I am after a add-on simple system.

I looked at paypal but that just takes a link to paypal which I really didn't like.

 

I am still trying to set up oscommerce and it uses php.Set is a little messy so far.

Link to comment
Share on other sites

I think I get what you mean, with the PayPal system the customer does not have to sign up to PayPal at all, they can just enter in there payment details as they would other sites, registering with PayPal is optional for a customer.

 

But the PayPal developer center does cover this as well.

Link to comment
Share on other sites

//Create a mysql database for the ipn reponse so you get all the users information,
this will also let you no that the user has payed you.

// make sure to put this in the same database as you need to get payments.

CREATE TABLE paypal_table (
  id int(11) NOT NULL auto_increment,
  payer_id varchar(60) default NULL,
  payment_date varchar(50) default NULL,
  txn_id varchar(50) default NULL,
  first_name varchar(50) default NULL,
  last_name varchar(50) default NULL,
  payer_email varchar(75) default NULL,
  payer_status varchar(50) default NULL,
  payment_type varchar(50) default NULL,
  memo tinytext,
  item_name varchar(127) default NULL,
  item_number varchar(127) default NULL,
  quantity int(11) NOT NULL default '0',
  mc_gross decimal(9,2) default NULL,
  mc_currency char(3) default NULL,
  address_name varchar(255) NOT NULL default '',
  address_street varchar(255) NOT NULL default '',
  address_city varchar(255) NOT NULL default '',
  address_state varchar(255) NOT NULL default '',
  address_zip varchar(255) NOT NULL default '',
  address_country varchar(255) NOT NULL default '',
  address_status varchar(255) NOT NULL default '',
  payer_business_name varchar(255) NOT NULL default '',
  payment_status varchar(255) NOT NULL default '',
  pending_reason varchar(255) NOT NULL default '',
  reason_code varchar(255) NOT NULL default '',
  txn_type varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  UNIQUE KEY txn_id (txn_id),
  KEY txn_id_2 (txn_id)
) TYPE=MyISAM;


// use this for the insert of the above mysql table.
// this inserts the information into the above table as adove.

// example in the working script below.

$qry="INSERT INTO paypal_table VALUES (0 , '$payer_id', '$payment_date', '$txn_id', '$first_name', '$last_name', '$payer_email', '$payer_status', '$payment_type', '$memo', '$item_name', '$item_number', $quantity, $mc_gross, '$mc_currency', '$address_name', '".nl2br($address_street)."', '$address_city', '$address_state', '$address_zip', '$address_country', '$address_status', '$payer_business_name', '$payment_status', '$pending_reason', '$reason_code', '$txn_type')";

$result=mysql_query($qry);




//make a form to get payments.

// sandbox is for testing and paypal is for live transaction.

//example this is setup for testing the code within sandbox and sandbox is a mirrow site for paypal and has got to be setup
via the sandbox url.

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

// example this is setup to take a live payment from your live paypal account.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

//example this is to setup the account to send a payment to you, when you setup sandbox to test the code you also need to set this to the testing email address.

<input type="hidden" name="business" value="admin@whatever.com">

// example these are for paypal to return to the ipn code to valadate payment.

<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="return" value="http://whatever.com/ipn.php">


---------------the form prpoer format for ipn ------------------------------------------------------
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="admin@hotmail.com">
<input type="hidden" name="item_name" value='<? echo"Freelance Programming Advert From $added_date to $exspire_date"?>'>
<input type="hidden" name="item_number" value='<?php echo $record['id'] ?>'>
<input type="hidden" name="amount" value='<?php echo $price ?>'>
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="return" value="http://freelanceprogrammers.ath.cx/test.php">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cancel_return" value=" ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

--------------------end----------------------------------------------------------------


//php working ipn code

this is a fully working version of ipn in php format follow above example.

<?php session_start();


// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';

foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}

// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.sandbox.paypal.com', 80, $errno, $errstr, 30);




// assign posted variables to local variables

$item_name = $_POST['item_name'];
$item_number =$_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email= $_POST['receiver_email'];
$payer_email= $_POST['payer_email'];


if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {


$qry="INSERT INTO paypal_table VALUES (0 , '$payer_id', '$payment_date', '$txn_id', '$first_name', '$last_name', '$payer_email', '$payer_status', '$payment_type', '$memo', '$item_name', '$item_number', $quantity, $mc_gross, '$mc_currency', '$address_name', '".nl2br($address_street)."', '$address_city', '$address_state', '$address_zip', '$address_country', '$address_status', '$payer_business_name', '$payment_status', '$pending_reason', '$reason_code', '$txn_type')";

$result=mysql_query($qry);

echo 'payment tacken';
}
else if (strcmp ($res, "INVALID") == 0) {

echo 'no payment sorry';
}
}
fclose ($fp);
}

?>

//////////// end//////////////

Link to comment
Share on other sites

Hi,

Thanks for the information, and can i ask where did you get this. Is this common script or did you make it yourself?

 

how does a bank get this information?

 

i see scripts from zencart ,oscommerce that process payments on own site but you still somehow have to get a bank involved?

Link to comment
Share on other sites

I posted you a paypal code to get payments from paypal customers from your website ok.

 

it's free unless you want to pay for a monthly subcription.

 

 

and of course you need a method to get money from a reconised source and paypal works fine for all.

 

an exmaple of that is ebay owns paypal we all no ebay so we all deal with payapl so therefore we can all use money transfers from paypal.

 

 

I have been down the road of setting up a privert paying gateway for payments but becouse the fact paypal is a reconised name it give's more encourgement for the users to buy services or products using the payment method named paypal ok.

 

Now as time goes on and your doing well and getting lots and lots of orders and cash is comming in you then will of course get your self a privert credit card payment dedecated to your bussiness but untill then paypal is a good payment gateway ok.

 

you will only use a privert payment gateway throw your bank or 3rd part service gateway provider for the purpose of lower intrest rate then paypal.

 

good luck.

 

 

 

Link to comment
Share on other sites

Ok I see that if you have an existing  site with php then all you do is add a 3rd party tool like paypal to items to buy. Other wise use a shopping cart program eg zencart which dictates how a website will be.

 

The paypal buttons eg view cart goto the paypal website. What i want to do is have all the fields on site as script given here on the thread. Using php to do this.

 

Where can i get information on having all the forms for online purhcasing on my website then click on a paypal button to goto the merchant?

Link to comment
Share on other sites

I didn't know whether to start a new thread, and you can ignore the previuos posts by me.

 

 

Can you get a ecommerce system that allows you to add your own php code.

The reason I asked is that eg zencart are systems that are programmed in php. They don't allow extra php code to fit in easily , if at all. Zencart/oscommerce are systems that only let you have a certain layout and functionality.

 

I wanted a package to add links to my own pages with php/flash etc.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.