shoppingcart integration done

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Hi guys,
lovely looking cart system (I have seen the rugby ball demo)

I am wondering if there are any payment gateways in place?

I would like to see a 'buy now' / 'straight to checkout' button displayed for each item IF the cart currently has 0 items within it. Clicking the 'straight to checkout' the script assumes this is the only item you wish to buy and would then take you straight to the payment area skipping the cart area all together.
this button would also be good for sites where people are only likley to buy just 1 of the items listed such as a service that comes in 4 flavours etc.

just a thought.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi pSouper,

Sorry I did not reply earlier...have been off the boards and email notification got buried....just noticed it today. To respond:
I am wondering if there are any payment gateways in place?
No, not really. The rugby ball demo was created without this aspect in place. It is my understanding that OliG plans to implement within Wcms, but having said that...(since this is a hack).....I am guessing implementation of a SSL payemnt gateway is doable even in this scheme. Only problem is, I am completely green at this (never done). some say it is tricky, others say relatively straightforward. I have put this project on the backburner and thus have not researched it.
I would like to see a 'buy now' / 'straight to checkout' button displayed for each item...
This would be quite easy to implement. Since shopping items data vary, I designed the system to allow custom templates (not unlike artilcle list and summary) that are called by unique repTags. The templates are relatively easy to modify....in a app such as Dreamweaver....just a matter of redesigning a given table and placing the appropriate </php echo $whatever ?> in a given table cell.

I do have a couple of regex bugs/ issues (as described earlier in this thread) to resolve. Will likely get around to it relatively soon. I am also hoping to complete an orders database (seems to be needed).

I guess the real issue is the payment gateway...and thus this is one of the reasons I posted. Anybody with some experience / pointers willing to add comments, much appreciated. I do plan to release at some point. if you feel you have a handle or strategy to implement the SSL aspect, would be happy to provide you the source, even at this stage.

All best,
John

Addendum: Seems the client has changed mind and wants to scrap the present scheme on the rugby ball demo site...so it is likely that I will have to take it down in the next few weeks.....bummer...since I spent a wee bit of time on it. Nonetheless the code is reusable for future projects. BTW, 'cart items' are implemented by adding one line of code to any given article, so in this respect it is indigenous to Wcms.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Thanks for the reply John,
your origonal cart system got me thinking about my own needs, although some what different from yours i think they may be two side of the same coin.
I have developed a repTag for payapl payements. This tag has a very specific nature resolving my issues but I fully intend to release a trimmed down verision that would enable 'buynow' for single Items (no cart) through paypal.
the repTag {PAYPAL:ItemName/description,Price,ShipCost,TaxPercentage} has configurable settings for your paypal acocunt and website as well as return page and database sales ledger. All code works seamlessly within phpwcms and uses a template file for the succesfull purchase page.

as this is a repTag I am sure you would be able to utilise this witihn your cart system without a strugle.

the script is in alpha currently and a beta will be release through this site imminently (anytime short of a year ;) )

speak soon pSouper

ps: as a complete payment greenie myself I doubt if any other payment sytems will be incorporated unless I find need for them.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi pSouper,

Sounds great.

Guessing that the existing session-based cart could be added/integrated with your paypal system...as long as the right parameters are passed to paypal system itself...so this is starting to sound interesting. My system uses simlilar repTag syntax which includes optional support for two sets of options ie color,size...

Keep us posted on your progress.

Cheers,
:)
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Source Files - Cart - In Progress

Post by jsw_nz »

OK, Marcus asked me about the cart,
so I finally zipped it and documented it.

Not really finished at the moment, since the payment aspect has not been implemented. I am 'green' as far as SSL. Marcus mentioned he may try to get a Paypal version working. Others who have SSL strategy welcome to try to extend it.

I have documentation, both a word doc and pdf in this zip, thus a size of 600KB. Would really invite others to try to get a payment section working. Hope someone finds this useful:

http://www.designjournal.co.nz/wcms/wcm ... cation.zip
(updated)
Cheers,
John
:D
Last edited by jsw_nz on Mon 25. Dec 2006, 20:58, edited 2 times in total.
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

thanks to john!!!!!!!!

:-) try it out tomorrow...
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

just have to say: wow great thing and well dokumenation.

I'll try it and give some feedback.

may be later be able to generate a pdf invoice at all....?
but payment will be much urgent and other stuff you mentioned above.

thanx to both who digged this out!!!
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

hi john,

I've implemented the cart as test and after 2 hours I've got only one question and some found "bugs"

The {SHOW_CONFIRMATION_INFO} Tag will not rendered and I found nothing about it in the cart_render.php

there is an include (confirmation.php) on line 135-143 of the SHOW_SUBMISSION_INFO Tag
that I don't understand.

no confirm email send at the moment - maybe it depends on that tag.

BUG:
default {ADD_TO_CART:ID} throws an error of false include

just need to copy all variables from top of the add_to_cart_ball.php the it works - or rename add_to_cart_ball.php to add_to_cart.php

where is the customerinfo stored (for second order without filling out all fields)?

SUMMARY:

that is a really great enhanced version of my simple suggestion of including a cart.
needs some time to cusomize it, but anyway - there is no need to touch core files of phpwcms.

that must be really a hard work to enhance it. thanks for that!

edit: customer infos are not stored at the moment, right?
Receive Promotionals: box - is it possible to combine it with internal newsletter?
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Marcus,
Thanks for trying it out. Sorry about the confusion that you raised. I will try to answer those questions.

{SHOW_CONFIRMATION_INFO}
I forgot to mention this is a suggested tag for future use.....
Right now the system uses {SUBMIT_ORDER} , and just emails the customer and the site administrator. This function uses some hard coded settings for html email and uses images in a template that is specific for the particular client. The comments in cart_render.php and the documents provided are a wee bit confusing (I will fix). Ideally the email settings should be declared in cart.conf.php -- so if you wnat to clean up and make more standardized, especailly if you get paypal to work, then go ahead.

there is an include (confirmation.php) on line 135-143....
This is basically the file that gets emailed to customer and administrator.
Uses ob_buffer() and concatenates the full message, using header and footer. As mentined there is hard coded stuff there

{ADD_TO_CART:ID}
Sorry, should not have included this in zip, since it represents earlier version and in the deving I used relied on add_to_cart_ball.php. Glad you figured it out.

Where is the customer info stored...
That aspect is still under contruction and would require additional table. So technically if you dont plan to use it right now, then delete those rows from the html template.

Receive Promotionals: box
That too is still under construction as well. Would need to connect to wcms newsletter table and automaically set approved flag to true.

Thanks for trying it out. If you can suggest even better stardardization, then please go ahead. Remember is was you that started the cart_mod concept. Your files really helped me alot. If you do make modifications...perhaps you can update the word doc provided and post. I think everyone would love to see a clean version working with paypal, which you mentined that you are considering.

All best Marcus,
You da man
John
:D

btw: I have updated the zip,
after having reviewed the stuff you discovered....
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

You are the man too :-)!!!

oke, thanks for your comments!
Your code and the project is really well documented!!
and basic php/html knowlege is needed in any case.

about paypal, got no idea at the moment :oops:
will do some more next week.
best
marcus
fnord
Posts: 17
Joined: Sat 20. Nov 2004, 06:39

Shopping Cart update...

Post by fnord »

I just tried the shopping cart mod. The docs are great and the cart (and small cart) are very clean looking with the existing templates. The install was pretty easy as well.

A couple of things I've noticed and I'm hoping someone else has encountered them and/or made a fix:

1) I can't seem to get past the error checking on the customer information page during the checkout process. I read through the code that redirects back to the customer info page if there are any errors but I can't seem to figure out what's tripping the error. I am trying to us a US address and I did change the default country to USA so I suspected a bug along those lines.

2) It looks like the checkout system is very sensitive to problems introduced by hitting the "back" and "forward" buttons in the browser. Since it seems to use the referrer field a lot to verify what has been done already, using those in the browser sends you back to an empty shopping cart a lot. I think this will probably confuse some users.

If I get a few minor glitches worked out, I plan to add paypal integration and share that version.

Thanks-

-Rob
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Fnord,

Sorry I have not visited the forum that much, just came across your post. To respond,

the error checking still has issues, at least with some characters (French) and I have not fixed. The error you are having I am unfamilar with, but do look into the error checking functions in top part of page. You may need to adjust the regex expressions...eregi() functions..or completely bypass this strategy and replace with another. strlen() or other simpler calls for example.

The back" and "forward" issue I am unaware of and did not encounter the probs you mentioned. So if you have a fix of this, would be appreciated. Kind of busy atm, so little time to offer more than these comments. It would be great to see the kinks ironed out and a paypal version up and working.

Cheers,
john
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi,

a friend of mine has the requirement for a shopping cart and I tried this one.

It's a great work and exactly what he wanted.

Installation was done quickly.

But after customizing I'd some little problems.

1) for a german shop, I added some more number_format statements and changed the used ones with added parameter ',', '.' to get the european format.
2) In one table there was a fixed table cell background (I've to look where it was exactly)
3) The biggest issue is the customer info form. I can't find the place where you've set required fields. I want to delete the password fields and the country fields.
Can you give me hint, how to change this?

Cheers
KiWiX
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Kiwix,

Take a look at customer_info_input.php for the required fields code. It uses a set of eregi functions, lines 22-39, which are called from

if($_POST['customer_information']) { // line 41

Others have noticed that the expressions need some tweaking to accomodate non-english characters. In your case, you can comment out required fields logic a a per item basis, basically not setting $error=1.

The redirect logic hinges around lines 146 - 149

if ($error==0){
header ("location: $on_success_url");
}

With regards to eliminating the fields themselves, open up the page in a decent wysiwyg editor and remove. In Dreamweaver, relatively easy to do, since I designed the templates to be viewable as table structure with mini php icons showing in repective cells. Do remember that if you take out these fields, related code in page will need to be modified as well.


Hope this helps,
John
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi John,

after sleeping a night, yesterday evening (night :-( ) I found the places and get everything changed.

Now I found another little tweak. You are usind

$repostAddress="http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

That I will change to something different, 'cause sometimes I open my firewall to give my "customer" access to the current development state.

But when they tried the shopping it didn't work.

Here I will use the global vars from phpwcms.

Another issue was the redirect links, when changing/editing the shopping carts. Here I had to fix, 'cause I'm working with rewrite_url and then you have to use a ? instead of & for the additional redirect parameter.

So far, no big modifications and a great
base for starting :-)

Cheers
KiWiX
Post Reply