Jump to content


[Snippet] Plaincart: Free E-Shop


  • You cannot reply to this topic
18 replies to this topic

#1 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 14 February 2008 - 02:31 AM

File Name: Plaincart: Free E-Shop
File Submitter: Cris D.
File Submitted: 14 Feb 2008
File Updated: 21 Mar 2008
File Category: 3rd Party Integration

Module: Plaincart for Etomite.
Originally created by http://www.phpwebcommerce.com/contact.php, etomised by Cris D.
Use: Creates an online shop with many features, separate admin back-end and front-end. Set categories, Products, currency, shipping and handling costs, your site-based shopping cart and checkout. Instant Payment Notification script for paypal payments, automatic order tracking. Order placed email notification. The front-end is fully complatible with Etomite 0.1.6.4. so it takes on your etomite template (well... as far as a table-based layout will take on a template anyway).

This is an advanced module requiring knowledge of paypal and the paypal sandbox to process payments.

This is an ALPHA release, meaning that I would NOT be using it on a commercial site just yet until any of the bugs (if there are any lol) are ironed out :)

See the readme file for more detail on installation and configuring instructions.

See in action here.

Click here to download this file

#2 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 25 February 2008 - 11:59 AM

If anyone has actually persevered beyond just downloading this module and actually tried to install it, I would be greatful for any feedback regarding errors on installation or whether it all operated as expected.

I would like to release this as a beta self-extracting installation if there is no obvious omissions.

#3 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 25 February 2008 - 02:12 PM

I haven't downloaded and installed the package but have tested it on your site and it looks quite promising... If you'd like me to do an install before you go beta just let me know...

#4 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 25 February 2008 - 04:10 PM

do you want feedback here?

when your in the cart and click on the thumbnail or item title, you get a 404 message - the link is missing the ? before c=...
i'm very interested in using this - good job and I will be testing it out.

#5 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 25 February 2008 - 09:00 PM

spent about .5 hour installing this, including the tables and snippets.

so far so good until i try to go to /admin/index.php and I have to add my server root in the config file... must have overlooked that, then i get error:

Notice: Undefined index: D:\Domains\...\wwwroot/ in D:\Domains\...\wwwroot\thelab\etomite0614\plaincart\library\config.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at D:\Domains\...\wwwroot\thelab\etomite0614\plaincart\library\config.php:21) in D:\Domains\...\wwwroot\thelab\etomite0614\plaincart\admin\library\functions.php on line 12


I overlooked something?

#6 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 26 February 2008 - 04:47 AM

server path settings were one of my main issues due to the adhoc way they are defined, I tested on localhost and a LAMP, but it obviously needs work. I'll look into it, but it looks like the server path settings in the config file are incorrect for your server. I'll get back to you..

#7 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 26 February 2008 - 09:57 AM

OK, the plaincart config file uses $docRoot = $_SERVER['DOCUMENT_ROOT']; to define the web path to the plaincart files.

You don't have your installation in the web root of your server with your etomite installation so you will need to change the docRoot path to your plaincart installation by adding your extra folders between the www root and your plaincart root folder:

$docRoot=$_SERVER['DOCUMENT_ROOT']."/thelab/etomite0614";

I don't know if this will effect other aspects of the site for the code inside etomite, (I had a look over and can't see any paths that should carry over, but there is a lot of code). I'm guessing that if everything worked before, it should still work after the change.

Quote

when your in the cart and click on the thumbnail or item title, you get a 404 message - the link is missing the ? before c=...

The missing "?" is in the shop_cart.php snippet line 48.

[edit- fixed typo (doc root to web root)]

Edited by Cris D., 26 February 2008 - 10:06 AM.


#8 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 28 February 2008 - 12:17 PM

Hi Darren, I found this article that mentions a possible work around $_SERVER'[DOCUMENT_ROOT'] paths on IIS, perhaps this will get your shop working...

Quote

I tried a simpler solution and it seems to work OK. I just added some two dots before the "/" like a would for a realtive path in windows. i.e. $path = $_SERVER['DOCUMENT_ROOT'] . "../XXXX" ;
http://www.phpbuilder.com/board/showthread.php?t=10288451

#9 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 28 February 2008 - 04:58 PM

Naw, that didn't do it. this is just another reason not to use IIS. <_< Only took a few minutes but got it installed and working on another server, including the admin area.

I don't have the paypal settings set so i havn't checked the checkout process, but the installation works fine. that will be another day.

as far as integrating it into an existing template, it'd take a little work. the tables have borders defined in the html- some of this stuff should be done with styles/id's. You'd also have 2 navigation areas - one for the main site and another for plaincart, unless you set up some weblinks to direct to the plaincart pages, and then figured out how to not display the plaincart nav. With a little digging around this is very useful. thanks Cris.

:Applause: :Applause: :Applause: :Applause: :Applause: :Applause: :Applause:

#10 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 28 February 2008 - 09:19 PM

I realise the table layout is old and I have been adapting it to my needs using divs but it takes time, but i'm also integrating the code to my data model so it is not going to be useful for very many when I've finished. Also the modular way the snippets are separated, ones like the miniCart are pretty much stand-alone and can be added anywhere in the template... Glad you got it working.

#11 vitalis

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 02 March 2008 - 01:03 PM

Hi,
i installed this shop, and i like it, so thank you Cris D.
But i have some problems.
I edit my config file and write correct DataBase login information. But when i try see my shop in action, i get error:
« Error »
Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error: 	mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO)	 
  Error type/ Nr.: 	Warning - 2	 
  File: 	C:\xampp\htdocs\etomite0614\plaincart\library\database.php	 
  Line: 	4	 
  Line 4 source: 	$dbConn = mysql_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error());

When i try to logon into the admin panel it's work corectly.

So, I tryed to edit file "database.php" and edit this lines:
$dbConn = mysql_connect ('localhost', 'user', 'pass') or die ('MySQL connect failed. ' . mysql_error());
mysql_select_db('etomite') or die('Cannot select database. ' . mysql_error());

after this corrections (i write login information manualy) the shop working like it should.
Do have somebody ideas where is the problem?

#12 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 02 March 2008 - 08:17 PM

Quote

I edit my config file and write correct DataBase login information. But when i try see my shop in action, i get error:
My guess is the localhost settings. When you view the admin, it is a direct connection, when you view the shop within etomite, there are two separate database connections happening. Thanks for posting an answer to your "problem". If it works for you I'd keep it, you shouldn't have an other connectivity issues once the link is established.

Both Darren's and your problems have been caused by standard php code (not the etomite class) which just goes to show how well written and tested Etomite is, but you have given me an idea. I really think I have opened up myself to a whole range of support issues by only part-way integrating it into the etomite code base and will have another look at how much of the config I can take from the etomite class.

@Ralph, do you know a way to import the etomite class into an external file without getting errors when the external file is then imported back into etomite?

#13 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 02 March 2008 - 08:50 PM

View PostCris D., on Mar 2 2008, 03:17 PM, said:

@Ralph, do you know a way to import the etomite class into an external file without getting errors when the external file is then imported back into etomite?

I have never attempted to use the Etomite class in an external script so I can't comment on that concept... I haven't looked at the code you are usig yet, because I have been working on some other code, but wonder how difficult it might be to simply integrate into Etomite...

#14 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 03 March 2008 - 03:01 AM

I did start going down that road and actually have the authenticate visitor snippet and plaincart admin authentication set as options for an etomite-based plaincart admin. However there is quite a lot of customising required to get the admin side of things to work within Etomite due to non-prefixed tables used, sessions, redirection headers, hardcoded javascript redirections etc. If it was easy I would have done it already, it will also blow out the number of snippet from 15 to over 30! Not a lightweight solution. I honestly believe it would be easier to re-write the admin side of things with etomite code than adapt the existing code to run inside of etomite. The admin also includes all the category and product entry forms, order reports etc. The admin is bigger than the front-end and seeing that I will never use it (I have written my own custom version with forms particular to my shop application), I'm hesitant to re-write it if it works in the main. I guess 2 problem installs in 15 so far ain't too bad.

For the record, this plaincart module was developed and tested on 2 environments:
1) localhost Windows XP running XAMPP for Windows 1.6.0a with PHP 4.4.5
2) A live LAMP (Linux, Apache, MySQL, PHP) running PHP 4.4.8
both under Etomite 0.6.1.4.


[edit: re-read post and clarified some points, added the testing environment and edited]

Edited by Cris D., 03 March 2008 - 07:06 AM.


#15 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 03 March 2008 - 02:14 PM

Either way you go, Cris, you're probably gonna spend more time converting and debugging than it would take to do a re-write within Etomite based on the logic in those external scripts... That's the main reason why you don't see me integrating more third-party applications... I don't have time to sort someone elses stand-alone code... It's easier to figure out the business logic and then just make Etomite go through the same motions...

Don't be daunted by the number of snippets and chunks a module can take... I have a few that use about a dozen of each and have a project now that will far surpass those figures... The nice part is that each resource is relatively small and easy to maintain without destabilizing the entire module...

#16 vitalis

    Etomite Forum Newbie

  • Member
  • 16 posts

Posted 03 March 2008 - 05:33 PM

View PostCris D., on Mar 2 2008, 10:17 PM, said:

My guess is the localhost settings. When you view the admin, it is a direct connection, when you view the shop within etomite, there are two separate database connections happening.

I am forgot to say, that there is no separate databases. I use same database like etomite. I does not create the new datebase for shop. I am just created new tables in etomite database.
So exactly this thing is strange for me, because etomite works, but shop within etomite doesnt. Only when i edit file located in plaincart/library/database.php and write login information directly in this file, everything start work i.e. etomite site and shop within etomite.

Edited by vitalis, 03 March 2008 - 05:34 PM.


#17 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 03 March 2008 - 08:16 PM

Quote

I am just created new tables in etomite database.
Yeah, I got that, it's just that your error message

Quote

Access denied for user 'ODBC'@'localhost' (using password: NO)
looks like you are being denied access via an ODBC connection. I have played with ODBC connections a lot and the main problem with them is server settings. Even though you have one database, the plaincart shop code queries the database via etomite config settings AND via plaincart config settings. When you view plaincart inside etomite, BOTH connections are being used. I think your server might be blocking the second attempt to connect (plaincart). That's what I mean by 2 connections (not 2 databases).

#18 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 27 August 2008 - 12:09 PM

Looking at my submitted files...This snippet (or module) has had the greatest number of downloads of all snippets I have submitted to Etomite so far. This record has beaten etogal_multigals3.1 (my first snippet submitted in April 2007 - 16 months ago) in just 6 months. Given that this has been my greatest downloaded snippet, and the fact that this support thread has only 3 members that have posted questions, I think that it has been tested enough to go to beta.

If anyone has any tweaks that would benefit the module, post it here before I package it up into a self-installing module. I will endeavour to remove much of the table layout and replace it with divs and a list of id's and classes used. Other than that, I have no plans to change it unless there are any worthwhile contributions to be added... (And before anyone asks...no, I won't be integrating the back-end admin with etomite :) ).

#19 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 27 August 2008 - 03:18 PM

View PostCris D., on Aug 27 2008, 06:09 AM, said:

I will endeavour to remove much of the table layout and replace it with divs and a list of id's and classes used.

my only issue :D

is anyone using this on a production site? I've kept this in the back of my mind but not used it on a live/public site. Also, I never set up a paypal account to test transactions, so that's as far as I got. With the removal of the tables it will be much easier to integrate into a site layout - and I'll probably do another install and test with the new version.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users