Archive

Posts Tagged ‘code that’

Php Code That Checks Date

July 29th, 2009 Comments off

I have a non CMS driven website on which my customer wants every few days an other bit of text showing. Because I can’t be available each time he want changes I would like to have a small piece of php that checks if the current date is between 2 given parameters which are the beginning and end date. When it is between the given dates the part of html is sown. When it is outsides it ignores the piece of html.

In one page I would like to enter a few of these date shown pieces of html so I can make changing weeks in front.

See attached html doc that makes more clear what I want

Amazon Devpay Int. Template

July 9th, 2009 Comments off

I would like to implement future projects using Amazon DevPay, but need an easy-to-reuse template built in PHP to connect with DevPay.

Two steps:

1. Customer signup on DevPay, which transmits customer data (including unique ID) to my server. I would like code that is easily used in many situations that would allow me to use the data sent in a DB for customer ID.

2. Connecting to DevPay using customer information to properly charge customers for their files. Upload, Download & Delete functions required. Code that I can embed in my current scripts is what I need.

I currently use Amazon S3, and DevPay is very similar but requires a few extra steps, of which there is no PHP documentation, although they say it can be done using PHP.

Again, I’m not looking for a “finished product”, but rather snippets of code that can be universally used in multiple projects, simply for connecting and using DevPay.

Add-on For Magento

March 16th, 2009 No comments

Please read everything before writing or asking!!!
This is a code that makes the admin of a Magento shop able to connect a bunch of sellers to his shop and check how much they refere to his shop. He can check how much they have referred and how much they have on their account. The deal is that you can sign up for a seller yourself and they when you refere someone to the shop, they get x% of the total sale. When they have reached xx,- admin will transfer the money himself to their bank account.
This is an addon to a magento shop, but only the bonuscode script needs to be integrated in the shop.
Here is how it works: When each seller signs up on the site, he gets a bonus code. That bonus code gives some %’s to the user who types it in when he makes a purchase, and it also gives some %’s to the seller. That way the user who uses it gets some discount and the seller gets some money on his account.

Step by step:
A seller goes to the shop and clicks ‘sign up as seller’. Then he types in his name, bank information (admin needs this when he wants to transfer money, but its just some form data), and some more information. He clicks ‘signup’. Admin now gets an e-mail saying: ‘a seller has signed up’. Then there is a link to a list where all sellers are listed. On that list admin can see the ballance of each sellers account. In the top of that list, all the sellers admin did not accept are. Admin choses how much discount the users this seller is reffering should get (its a drop down menu sayin: 1/2/3/4/5/6/7/8/9/10). Then he selects how many %’s the seller should get (its a drop down menu sayin: 1/2/3/4/5/6/7/8/9/10). Admin clicks ‘accept seller’. Now a mail is sent to the seller who signed up. In that mail there is a randomly generated bonus code that the seller will give to the users he is referring. Also there is a randomy generated login/username to a site where he can check his balance on his account. Now the seller will give this bonus code to users, and in the checkout process they will write the bonus code to get discount. when that code is used the seller who referred will get the %’s on his account and the seller/admin can follow the balance.

The seller will get %’s of the amount AFTER the user gets his discount. So if a user makes a purchase of 100$ and gets 5% discount, the seller will get his %’s from 95%.

As I said. The list with the accounts and the sellers own account does not have to be on the shop.

What needs to be on the shop is: a link saying ‘signup as a seller’ and the sign in forms for the seller to fill out. Also the bonuscode should be in the checkout process.

And remember. This is all for a magento shop.

Bear