Shopping cart - Page 9 Shopping cart - Page 9
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Shopping cart

Started by Stramm, June 04, 2006, 09:02:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Riser

Hi Stramm,

first I wanna say thanks for this nice plugin and thanks to the great support here on board!

Next I must come up with my first question: Would it be possible to show the photo-shop feature only to registered users? As for now any user (reg. or not) can fill up the photo-basked and order directly. Of course, if not registered, users have to register first but will get logged in anyway. What I want is the possiblity to first validate the user-registration as I do in the normal registration procedure. So best would be when users have to register first, BEFORE even seeing the photo-basked and order-buttons.

Any suggestions would make me more than happy! ;-)

Thanks in advance, Rich

Stramm

codebase.php... after
function photoshop_add_item($pic_data){
global $CONFIG, $SHOP_CONFIG, $lang_photoshop;

$html = "";
$added = "";
$event = isset($_POST['event']) ? $_POST['event'] : null;

add
if(!USER_ID) return $pic_data;

after
function photoshop_user_menu(&$html){
    global $template_sys_menu_spacer, $lang_photoshop;

add
if(!USER_ID) return $html;


the first addition won't let the shop plugin show the add item part above the intermediate image to not logged in users
the second takes care of the '# images in basket' and 'checkout' buttons

Riser

Hey Stramm,

i'm in a hurry, godda run now but will get back to it later. Thanks very mucho for your reply so far, I'll post my result later the day!

Rich

Riser

Okydoky, I did the changes in codebase.php as you mentioned and I must say: YOU ARE SO COOL! ;-))

I'm honestly impressed about the support given for a free software. Chapeau, guys!

At the end I've edited the register.php in CPM-root more than I did with the PS-codebase but I think these changes could be of interest for many users of Stramms PS-plugin as well, so I'll post them here.

If users have to register anyhow when ordering prints etc, why shouldn't they register first and THEN have the shopping option?! Anyhow I changed my register.php, giving it some more required fields to get the full name and full address of the registering user, so I'd already know where to send the stuff that they will possibly order in future. According to Sami's Post in cpg1.4.x Support (see http://forum.coppermine-gallery.net/index.php?topic=37086.msg175000#msg175000) I've added/changed the Profile-Fields 1-5 in register.php for Fullname, Street, Zip, City and Country, now required. With the modification of the codebase.php in PS-Plugin (mentioned above) I don't need two registration-forms anymore and I don't have to deal with people just clicking and adding to the photo-basked for fun without filling ie their full name and address in the registration-form before the ps-checkout. Perfect to my needs!

My configuration in admin-panel is set so users can register but get an automatic email with the activation-code. As soon as they confirm the regsitration they can log in and if they want: order somethin'! ;-)

Once it's finished my Gallery will be filled only by one user/admin, people can browse the gallery and if they want to get prints or high-res-data they can register and order (but not upload or manage anything more than their profile though). Not now, maybe in the future. I'm still working on it so I can't post a link yet but I will soon and if possible I'll try to contribute here, as far as I can.

Kind regards and thanks again,

Rich

CGPhotos

Hi Stramm!!  This looks like an awesome plug-in!!  Thank you!  I have installed your latest version and in following the directions, I do not have an "admin" under the "shop".  I only have the empty order information.  Do I need to re-install?

Stramm

nope. you just haven't found the config yet ;)
click shop in the admin toolbar, then look below the 'shop' button, in the table's header below you'll see on the right side 'config' -> click

CGPhotos

I have a screenshot to show you that there isnt an admin under shop.  I do not know how to insert it here, can you tell me?  Or would you like a link instead?

Stramm

PM me a link and an admin account login please

Stramm

you need to have the plugin installed

CGPhotos

Ok, Yesterday when I was working with it I had it there.  Unfortunately I installed some sef_url plugin to test why I could not locate the photo shop when I uploaded it from the plugin mgr.  The serf thing shut down my gallery for over 5 hours while I researched a fix which included deleting all my uploads.  Today when I uploaded the photo shop and the one with the paypal fix they are showing on my server but cant be found in coppermine.  The sample one is in the plugin file along with the photo shops and I can view it in Copp mgr.  Should I upload the with ftp?

Stramm

The photo shop plugin needs to be in coppermine's plugin folder. Of course you use FTP to upload the files.

To disable the sef plugin it's not necessary to delete all uploads.

CGPhotos

I removed them from my server, uploaded them again with ftp and they still dont show up in my plugin manager.  I have spent too much time already and very much appreciate your time.  I am looking for a different gallery.

zac

#172
 ??? help..  I am now getting a
Quoteerror while processing dabatase query
when I try to view my cart.  I have installed and uninstalled the plugin, and when doing so it asked if I wanted to remove the table that was used to store shop data, I said yes. 

When I reinstall it says ok on all updates, however it says this is already done:

CREATE TABLE `cpg149_shop_prices` ( `id` int(11) NOT NULL auto_increment, `aid` int(11) NOT NULL default '0', `gid` int(11) NOT NULL default '0', `price` dec(9,2) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1

After the reinstall the ..x.. images in cart link reappears with the 5 images in it. 

How do I delete this table and start fresh?  How can I clear the cart?  Any ideas?

... I ran debug for more info..

error message

While executing query "SELECT * FROM cpg149_shop_prices WHERE aid=" on 0

mySQL error: 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 '' at line 1


Debug info

USER:
------------------
Array
(
    [ID] => 553056f4e1724e14bbfef239a190a6d7
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 32
            [1] => 41
            [2] => 25
            [3] => 26
            [4] => 31
        )

    [lap] => 3
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 0
    [user_name] => Guest
    [groups] => Array
        (
            [0] => 3
        )

    [group_quota] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 0
    [can_post_comments] => 0
    [can_upload_pictures] => 0
    [can_create_albums] => 0
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 1
    [upload_form_config] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [custom_user_upload] => 0
    [disk_max] => 0
    [disk_min] => 0
    [ufc_max] => 0
    [ufc_min] => 0
    [has_admin_access] => 0
    [group_name] => Anonymous
    [can_see_all_albums] => 0
    [group_id] => 3
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg149_filetypes; (0s)
    [1] => select * from cpg149_plugins order by priority asc; (0s)
    [2] => delete from `zacfolk_printshop`.cpg149_sessions where time<1167421966 and remember=0; (0s)
    [3] => delete from `zacfolk_printshop`.cpg149_sessions where time<1166215966; (0s)
    [4] => select user_id from `zacfolk_printshop`.cpg149_sessions where session_id=md5("f37936f2c25365de4776fe77fad54ad48351297330e7e2998285dc874fdcbe43"); (0.001s)
    [5] => select user_id as id, user_password as password from `zacfolk_printshop`.cpg149_users where user_id=0 (0s)
    [6] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg149_usergroups WHERE group_id in (3) (0s)
    [7] => SELECT group_name FROM  cpg149_usergroups WHERE group_id= 3 (0s)
    [8] => update `zacfolk_printshop`.cpg149_sessions set time='1167425566' where session_id=md5('f37936f2c25365de4776fe77fad54ad48351297330e7e2998285dc874fdcbe43'); (0s)
    [9] => SELECT * FROM cpg149_final_extract_config (0s)
    [10] => SELECT * FROM cpg149_shop_config ORDER BY 'priority' (0s)
    [11] => DELETE FROM cpg149_banned WHERE expiry < '2006-12-29 20:52:46' (0s)
    [12] => SELECT * FROM cpg149_banned WHERE (ip_addr='67.40.196.59' OR ip_addr='67.40.196.59' OR user_id=0) AND brute_force=0 (0s)
    [13] => SELECT aid FROM cpg149_albums WHERE visibility != '0' AND visibility !='10000' AND visibility NOT IN (3) (0s)
    [14] => SELECT filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, title, aid from cpg149_pictures WHERE pid='822' LIMIT 1 (0s)
    [15] => SELECT * FROM cpg149_shop_prices WHERE aid= (0s)
)

==========================
GET :
------------------
Array
(
    [file] => photo_shop/photo_shop_cart
)

==========================
POST :
------------------
Array
(
)

==========================
Page generated in 0.12 seconds - 16 queries in 0.001 seconds - Album set : ; Meta set: ;


Notices

/bridge/udb_base.inc.php

    * Notice line 114: Undefined variable: row

/themes/zstyle/theme.php

    * Notice line 86: Undefined index: album
    * Notice line 87: Undefined index: pos

/include/themes.inc.php

    * Notice line 791: Undefined variable: pm_link
    * Notice line 2724: Undefined variable: loginFormHtml

/plugins/final_extract/include/init2.inc.php

    * Warning line 30: mysql_free_result(): supplied argument is not a valid MySQL result resource

/plugins/photo_shop/codebase.php

    * Notice line 185: Undefined index: cd
    * Notice line 187: Undefined index: photo

/plugins/photo_shop/include/functions.inc.php

    * Notice line 77: Undefined index: cd
    * Notice line 79: Undefined index: photo

/include/media.functions.inc.php

    * Notice line 56: Undefined index:

/include/functions.inc.php

    * Warning line 1983: array_merge() [function.array-merge]: Argument #1 is not an array
    * Warning line 1983: array_merge() [function.array-merge]: Argument #2 is not an array
    * Notice line 1995: Undefined index:

/plugins/photo_shop/photo_shop_cart.php

    * Notice line 161: Undefined index: CD
    * Notice line 162: Undefined index: CD
    * Notice line 165: Undefined index: aid



Thanks for any help with this.

Stramm

try to clear your cookies

zac

 :-[ err.. umm.. oops.. guess you didnt need that debug info.  Sorry about that and thanks Stramm.

chican0

Hello Stramm,

First off... Great plugin. Thank you for making it available to us.

I haven't been able to get it working though. I get the following error when I enable debugging.

Quote
While executing query "SELECT *,
user_name AS user_name,
user_email AS user_email,
user_join AS user_regdate,
'' AS user_location,
'' AS user_website,
user_id AS user_id,
AS notify,
AS avatar_url
FROM  `db_e107`.e107_user WHERE user_id = '1'" on 0

mySQL error: 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 'AS notify, AS avatar_url' at line 7

I believe it has to do with the necessary custom fields that are required but unfortunately I am using an e107 bridge. Since I am using bb integration, I am unable to configure custom fields.

Can you provide any advice or solution? It would be much appreciated. I am anxious to get this plugin to work.

Stramm

I'm afaraid I can't help you much... but I can tell you that the problem isn't the shopping cart plugin b ut the modpack. You'll need an adapted bridge file for it to work. Till now bridge files are available for smf, phpbb and punbb. Making the bridge files work together with the modpack isn't that difficult. Read more about that on the modpack support thread and the modpack forum here on this board.

chican0

Thank you very much Stramm. I appreciate the response. Again, it looks like a wonderful and useful plugin

I am actually using your mod pack so I will head over to your other thread and read the entire thing.

Again, thank you for the guidance.

colin911

Sorry about the last post but I just wrote a long post and got told that I could not post here so wanted to know that I could before i retype the whole thing.

first thanks for the great plugin Stramm.

I am experiencing an error on a specific computer.  I can add pics to the cart but cannot view the cart or checkout.  When i try to do that i get the 'critical error': There was an error while processing a database query

I have tried the following with no avail
Logged in and out of several users
have tried in user and admin mode
Emptied ALL Browsing history and cookies etc
rebooted many times
Uninstalled and reinstalled shopping cart optionally deleting the table data.
Uninstalled every other plugin.

I have tried using another computer on the same local LAN and everything works fine so I am not giving you a demo user since i don;t think taht the problem can be replicated eleswhere..

Any suggestions?

Nibbler

Enable debug mode in config and post the mysql error message you get (not the entire debug output) when you replicate the error.