Page 1 of 4

1.4.1 shop_module WITH PAYPAL...

Posted: Sun 1. Mar 2009, 22:08
by nebenaube
My enhancements for the shop module (i.e. adding paypal gateway) are complete and have been tested. The first person with that can provide me the most recent copy of phalanc's Forum CP gets a copy. Good day.

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 2. Mar 2009, 08:06
by juergen
Oh, this looks like the birth of a new licence ? NAGL ?

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 2. Mar 2009, 10:51
by update
You have asked for - here it is:
(but this is really an old one.... still the latest I think)

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 2. Mar 2009, 15:23
by nebenaube
custom shop_field_1, etc. fields are disabled in this example, also the code points to paypal sandbox added order_phone to orders table, adds transactions table.
mod_shop_paypal.zip
(85.4 KiB) Downloaded 588 times

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 2. Mar 2009, 19:09
by nebenaube
bummer, no he (phalancs) had fixed the notify

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Thu 12. Mar 2009, 17:24
by antonumia

Code: Select all

Fatal error: Call to undefined function _dbquery() in ...\inc_module\mod_shop\setup\setup.php on line 155
I assume there should be an include...?

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Fri 13. Mar 2009, 14:25
by nebenaube
Actually, if I forgot anything it was the

Code: Select all

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
   die("You Cannot Access This Script Directly, Have a Nice Day.");
}
try it from inside the back end... :)

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Wed 22. Apr 2009, 20:45
by nebenaube
there is a typo in the setup.php on line: 97

the line:
$sql[7] = "CREATE TABLE ".DB_PREPEND."phpwcms_shop_transactions` (

should be:
$sql[7] = "CREATE TABLE ".DB_PREPEND."phpwcms_shop_transactions (

Also: line 146

echo $sql[9]."<br />\n"

should be:

echo $sql[9]."<br />\n";

Also, the system is setup to use the paypal sandbox and you will have to change the hard-coded url when you go live...
in front.order_process.inc.php on line: 34. (comment out line 34 and uncomment line 35)

//$p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url
$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 27. Apr 2009, 16:28
by nebenaube
Another note: one might experience problems with the custom fields and that will take some troubleshooting.

Major oversight: this module also requires changes in /config/phpwcms/conf.inc.php where I replaced the $phpwcms['site'] variable and introduced two additional (new) variables. See example below:

Code: Select all

$phpwcms['machine_alias']	  = 'www';
$phpwcms['site_domain']	  = 'hugosdyes.com';
$phpwcms['site']                  = 'http://'.$phpwcms['machine_alias'].'.'.$phpwcms['site_domain'].'/';
They are required by the paypal class when validating the referrer. If these are not populated; the script will bail out when submitting to paypal .

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Wed 10. Jun 2009, 21:33
by rosemckay
Hi, I made the changes to the setup file. There were two other code fixes but I'm not clear what to do with them. I'm talking about the one to the config file and one from another post that I can't seem to figure out which file is changed. When I click on Shop/Products under modules in the backend I get what looks like a disply of an sql dump and then WOW this at the bottom:

Code: Select all

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 100

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 106

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 100

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 106

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 100

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 106

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 100

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 106

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 100

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/calif19/public_html/include/inc_lib/dbcon.inc.php on line 106

All inital db tables and values were created.

Edit .../config/phpwcms/conf.inc.php change Code:
$phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend
Add: $phpwcms['Login_IPcheck'] = 0;
Looks like some major errors but I'm clueless about fixing them. I also don't seem to be able to use the module but it's not clear how to implement it anyway. I can't seem to find any instructions or tutorials. Please help! Thank you.

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Wed 10. Jun 2009, 22:57
by nebenaube
the warnings are not important, the db tables were created.
now in the config file:

Edit .../config/phpwcms/conf.inc.php change Code:
change: $phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend
Add: $phpwcms['Login_IPcheck'] = 0;

also you need the site and machine alias changes (also in conf.inc.php) as referred to in earlier post...

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Wed 1. Jul 2009, 19:03
by nebenaube
FYI update note to whom it may concern... I've integrated the other enhancements (moo-tools & sizes/colors) for the paypal enabled shop but....

It got very messy when applying the options (sizes & colors) once processing enters the paypal portion of the code and begs for a better solution... (like changing the products table) Then I had to drop coding and actually go out to make some income elsewhere for a while. I've managed to picked up a new project now and will resume coding on my variant of the paypal enhanced shop module in about two weeks (that is, if the project requires it, as requirements have not been settled yet).

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 24. Aug 2009, 14:31
by smoke
I installed the paypal shop but I am having a weird problem.
I am not quite a mysql geek and I hope you can help me:

I am using mysql 4.0 and getting errors in every table where "latin1_bin" exists
I tried latin_general_ci and german_1_ci too, but same error:

Code: Select all

 SQL-Befehl:

CREATE TABLE IF NOT EXISTS `phpwcms_shop_orders` (
`order_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`order_number` varchar( 20 ) NOT NULL default '',
`order_date` datetime NOT NULL default '0000-00-00 00:00:00',
`order_name` varchar( 255 ) NOT NULL default '',
`order_firstname` varchar( 255 ) NOT NULL default '',
`order_email` varchar( 255 ) NOT NULL default '',
`order_phone` varchar(50) collate latin1_bin default NULL,
`order_net` float NOT NULL default '0',
`order_gross` float NOT NULL default '0',
`order_payment` varchar( 255 ) NOT NULL default '',
`order_data` mediumtext NOT NULL ,
`order_status` varchar( 100 ) NOT NULL default '',
PRIMARY KEY ( `order_id` ) ,
KEY `order_number` ( `order_number` , `order_status` )
) TYPE = MYISAM

MySQL meldet: Dokumentation
#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate latin1 NULL,
  `order_net` float NOT NULL default '0', 
can someone help me?

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 24. Aug 2009, 15:07
by flip-flop
There is no collation available in mySQL < V4.1.

Please edit the sql text file from e.g.

Code: Select all

order_phone` varchar(50) collate latin1_bin default NULL,
to

Code: Select all

order_phone` varchar(50) default NULL,
Knut

Re: 1.4.1 shop_module WITH PAYPAL...

Posted: Mon 24. Aug 2009, 15:50
by smoke
thank you for the quick answer,
I tried that before, and it worked.
but when the data has been delivered to paypal, its said that the current language was not supported.

I updated the database to 5.0 now. everything works now.

but after ordering another paypal error message occured:

Code: Select all

Sorry — your last action could not be completed

If you were making a purchase or sending money, we recommend that you check both your PayPal account and your email for a transaction confirmation after 30 minutes.

If you came to this page from another website, please return to that site (don't use your browser's Back button) and restart your activity.

If you came from PayPal's website, click the PayPal logo in the upper-left corner to return to our home page and restart your activity. You might have to log in again.
current paypal url is:

Code: Select all

	$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';     // paypal url
I am lost :(