• [MOD] Paypal Mod (Shop Mod Lite) 5 0 5 1
Currently:  

Author Topic: [MOD] Paypal Mod (Shop Mod Lite)  (Read 107007 times)

0 Members and 1 Guest are viewing this topic.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
[MOD] Paypal Mod (Shop Mod Lite)
« on: March 21, 2006, 10:36:38 PM »
[ Introduction ]
With this mod you are able, to set for each image a different price,
and when set, on the details site, there will be an small link to the paypal site.

[ Features ]
- Price can be set individually for each image different
- if no price is set, no link will be shown

Demo can be seen here: Demo Link

[ Changed Files ]
lang/<your language>/main.php
details.php
includes/db_field_definitions.php
templates/details.html

[ New Files ]
templates/details_paypal.html
templatesdetails_paypal_cart.html


[ Installation ]
Download the rar archive.
unpack the files.
follow the installation note.

Download here: Download Link
You can register your own account (no email verification is needed)
or login in with 4images/4images.


Step 1:
Open includes/db_field_definitions.php
add before ?>
Code: [Select]
$additional_image_fields['price'] = array($lang['image_price'], "text", 0);

Step 2:
open templates/details.html
search for
Code: [Select]
    <br />{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
  </div>
  <br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
and add below
Code: [Select]
{if price} {details_paypal} {endif price}
you can place this code everywhere you want in the details.html,
where the link should be displayed.


Step 3:
open details.php
search for:
Code: [Select]
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);
add below:
Code: [Select]
//-----------------------------------------------------
//--- Shop Mod Lite -----------------------------------
//-----------------------------------------------------

if (isset($image_row['price'])) {
        $site_template->register_vars(array(
            "email_business" => "mymail@here.com",  // enter your email adress/paypal account here
            "buyer_email" => ($user_info['user_email']) ? $user_info['user_email'] : '',
            "url_paypal" => "www.paypal.com",    // enter www.sandbox.paypal.com to test the sandbox function
        ));

  $details_paypal = $site_template->parse_template("details_paypal");
  $details_paypal .= $site_template->parse_template("details_paypal_cart");
  $site_template->register_vars("details_paypal",$details_paypal);
}


Step 4:
execute the installer.
and place all templates from the rar archive to your templates folder.

[ Notes ]
You have to edit from step 3 this line:
Code: [Select]
"email_business" => "mymail@here.com",  // enter your email adress/paypal account heredon't forget to set your email adress here.

If you want, that an other image should be displayed, just edit the template files.
In the template files (details_paypal.html/details_paypal_cart.html) edit the following lines:
Code: [Select]
             <input type="hidden" name="shipping" value="1.00">
             <input type="hidden" name="shipping2" value="0.50">
             <input type="hidden" name="handling" value="2.00">
here you can set additional costs for shipping and/or handling.

All values must be entered in following format with a dot "." as seperator for prices.
The price can be set in control panel by editing the images.

done.

Have Phun.

This is not really a shop mod, it's just to play around with it.


« Last Edit: November 17, 2008, 03:26:42 PM by V@no »
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #1 on: March 22, 2006, 02:57:50 AM »
Nice, this is exactly what I did Sunday night. I was going to post it sometime this week when I got time but you have beat me to it.

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #2 on: March 22, 2006, 03:02:21 AM »
Oh and one thing, your download link does not work.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #3 on: March 22, 2006, 09:39:25 AM »
the download link works, but the site is sometimes a little bit slow or down,
then you have wait some minutes.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #4 on: March 23, 2006, 07:39:29 AM »
that link takes me to microsoft

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #5 on: March 23, 2006, 02:59:29 PM »
fixed
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #6 on: March 23, 2006, 10:12:15 PM »
ok i got to the mods page, but now there is no where to click for the actual download

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #7 on: March 23, 2006, 11:38:23 PM »
the download link takes you directly to the mod site & download.
If neccessary you must only login with your own account or the account login is described above.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #8 on: March 24, 2006, 03:18:08 AM »
ah sorry i missed that part, thanks

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #9 on: March 24, 2006, 06:00:01 AM »
Ok, so I tried installing yours on a old gallery site and it did not work. It told me some bad sql query run line crap. Any ideas? It seems like not very much code you know?

Offline up23

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #10 on: March 25, 2006, 12:39:00 AM »
Installed this mod with 1.7.2. I had to make some changes to get it to work. In the .php file, the new column added was named "price2" instead of "price". Also default value of 0.00 should be added. Fixed by installing as normal, and then using phpmyadmin. Changed the column name of price2 to price. Added default value = 0.00 by editing the structure of column from structure tab. Updated all price values with query: update `4images_images` set `price`=0.00 WHERE `image_active`=1. It might have been eaiser to update the query to alter table in the .php file.

This is probably not hard, but does anyone know how to return the user_email variable (like it was used in members.php) onto the details.php? I want to use {user_email} on the details template page as the paypal payment email. Please give the codes needed to be changed. Thanks.

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #11 on: March 25, 2006, 08:26:50 AM »
UP23 -

I see what you are saying. I think for this to maybe 'take off' with more people that you should go into detail with code exacmples for him to edit the first message on this board so people do not have to go hunting for the fixes and what not.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #12 on: March 25, 2006, 03:32:08 PM »
Installed this mod with 1.7.2. I had to make some changes to get it to work. In the .php file, the new column added was named "price2" instead of "price". Also default value of 0.00 should be added. Fixed by installing as normal, and then using phpmyadmin. Changed the column name of price2 to price. Added default value = 0.00 by editing the structure of column from structure tab. Updated all price values with query: update `4images_images` set `price`=0.00 WHERE `image_active`=1. It might have been eaiser to update the query to alter table in the .php file.

Sorry, my fault, i updated the installer,
now the created column is price instead of price2.
And default value shouldn't be set, cause if you set per phpmyadmin an default price,
this paypal button does appear on every image, which should only appear if an price is set.

Quote
This is probably not hard, but does anyone know how to return the user_email variable (like it was used in members.php) onto the details.php? I want to use {user_email} on the details template page as the paypal payment email. Please give the codes needed to be changed. Thanks.

what do you mean?
You mean the email from the user who want to buy the image?
if yes, the users email is already been parsed (if set) in the {buyer_emall} tag

@sau4scr:
I thought you already have coded your own?
You spaming this thread with a lot of unnecessary posts & comments.

Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline sau4scr

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #13 on: March 25, 2006, 07:50:25 PM »
I'm not spamming. Yes I do already have my own, its a little different from yours though because I have a base value set instead of a value from a database. I am more trying to help this post out for the use of others.
www.photographybyweston.com/gallery and you can see mine. It is a little more messy you could say though. I am not the greatest at PHP, I am really good with Coldfusion.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Paypal Mod (Shop Mod Lite)
« Reply #14 on: March 25, 2006, 07:54:32 PM »
ok, that getting to offtopic.

the reason why i said, you were spamming,
that mainly all of your posts above,
could be answered themself, if you had read my first post correctly.
cause everything where and how to download was described there.

and also to say, "it doesn't work for me" is not very helpful,
if you were not more specifc what kind of error messages you get,
or what exactly doesn't work.

Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump