forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Stramm on June 04, 2006, 09:02:32 am

Title: Shopping cart
Post by: Stramm on June 04, 2006, 09:02:32 am
outdated
new version: http://forum.coppermine-gallery.net/index.php/topic,57206.0.html

demo: http://stramm.st.funpic.org
supported languages atm: english, german, dutch, italian, polish


This plugin adds a shopping cart to CPG. Users can add single pictures to their shopping carts or bundle a CD.
You can set different price levels for CDs (eg 25 images for USD 50.- , 50 images for USD 40.-) and different sizes prices for the print sizes (5x7 for USD 3.- , 8x10 for USD 5.- etc)

In the shopping basket users can delete items and modify amounts. When checking out and the user isn't logged in he gets redirected to a combined login/ registration page (registration possible even if disabled in admin cause it's necessary for the plugin to work). If the user has to register he doesn't get sent a confirmation email but gets logged in automatically. Now he needs to confirm his order and then receives an email with his bought items and payment details.


Installation:
Go to your config and enable plugins (if not already). Then open the plugin manager (from config too) and install the 'photo shop' plugin. That's it...
have a llok at photo_shop/images_to_move/css_changes.txt - that file describes the additional css the shop is using (add it to your themes style.css)
(Please read this entire text and the version changes as it describes all the new features)

Now goto config -> Custom fields for user profile
change these to the necessary fields users should enter when ordering. Address, zip, phone etc

SQL should be updated automatically. There'll be some sample config as well. In the admin menu click 'Shop'. You'll see the shop admin. It's empty cause there are no orders yet. Click 'Config' (top, right side... just below 'Shop' in admin menu). Here you set up prices and names for your items. You can sort as well here for the display in the dropdown above each picture.

You should modify the confirmation email template in the plugins lang file.
You can use placeholders
{USER_NAME}
{SITE_NAME}
{ORDER_ID}
{PRICE}
{ADMIN}

Finally move the images from the archive (folder images_to_move) to your themes images directory

Testing:
Try to add some items to your basket. Delete them, increase/ decrease amounts etc.. Just get familiar with it. As guest checkout (only possible when items are in your cart). You'll get to a combined signup/ login form. Enter a new username/ pwd etc. and submit. The user'll get automatically logged in and directed back to the checkout. Here he sees an overview of his items. If he confirms the stuff is added to the SQL and emails sent to the user and you.

Now open the shop admin again (link 'Shop' in admin menu)
You'll see the new order in an overview. Icons in front.. meaning (order) viewed, paid, (items) sent (to user). When clicking the order you'll see the detail view. Thumbs of the items etc, pid, price, amounts, cd or photo (and size). In the header user name-> link to profile, email, total price. Just have a look. You can mark the checkboxes and do certain actions (delete, mark paid/ sent, mark unpaid, unsent). If you mark all as sent or paid this'll then gets changed in the overview as well. In detail view click an item to go back to the overview. When order has been processed you can here move the order to the archive.

I've added a new version of the archive including the fixes and improvements of this thread to date 06/11/2006

New version (1.1 uploaded on 08/09/2006)
 - added shipping costs
 - added support for a tag in template.html {CART_MENU}, either add that to your template or the cart will be inserted after the sub menu
- fixed all known bugs


New version (1.2 uploaded on 10/03/2006)
 - added bridge compatibility (should work without the need to configure anything, beta status)
 - added a paypal gateway (configure and enable it in include/gateway.inc.php, beta status)
 - fixed 2 bugs related to the shipping costs addition

New version (1.3 uploaded 10/07/2006)
 - added per album settings, in the shop config you can browse through the existing albums and set different prices. These override the global configuration. Also you can disable to show the shop for a certain album (checkbox).
 - If you set in the per album settings the price for a item to 0, then it won't display anymore in the shop
 - the order admin shows now the filename too

New version (1.3.1 uploaded 10/25/2006)
-fixed: under certain circumstances only one order got shown in admin ( http://forum.coppermine-gallery.net/index.php?topic=32231.msg177562#msg177562 )
-fixed: displays now the correct total next to the tabs (xx orders on xx page(s))
-added: possibility to download a zip of all pics in an order ( http://forum.coppermine-gallery.net/index.php?topic=32231.msg177214#msg177214 )
-added: german lang file, thanks to mikyma (changed it a lil bit to use german umlauts in utf-8, if you use iso, you'll have to modify it)

New version (1.3.3 uploaded 1/17/2007)
-fixed: finally wrong calculation of totals if sum > 1000
-added: support for google checkout (this is just a theoretical implementation. Utterly untested, enable it only for testing purposes and to report back here. I'm from Europe and didn't want to sign up with google using fake info)  --- (and sorry, have forgotten to upload the version 1.3.2. That one should contain already the fix for the wrong total)

New version (1.3.4 uploaded 5/12/2007)
-added invoices (plain text) that get send to the user (and the admin) with the order confirmation (and another time the user will see what he purcheased after he ordered with the thank you message, so he can save that page). More info http://forum.coppermine-gallery.net/index.php?topic=32231.msg207871#msg207871
-added support for discounts. Default off. There's no gui where you can set the discounts. You'll have to open functions.inc.php in the plugins include dir, scroll down to the bottom and find function calculate_discount. It's pretty easy to do. I've already added there two examples. You just need to uncomment one to enable it. The two examples are:
1. 10% discount if user orders more than 10 pics for print
2. 10% discount if order volume is >= 100 USD
-added a MyOrders page. Users can view their orders (history). It's a stripped down version of the shop admin. User of course can't change or delete stuff. If the admin deletes an order, moves it to the archive or marks an order as paid/ sent, then the user will see these changes. The link can be removed in codebase.php function photoshop_user_menu
-if you use the modpack you may like that one. If enbabled, minithumbs get used

New version (1.3.5 uploaded 6/8/2007)
Download Photo Shop Plugin 1.3.5 here (http://stramm.st.funpic.org/albums/userpics/10001/photo_shop_1_3_5.zip)

- added global shipping/ shipping per item
Now you can set as usual a global shipping (in the shop admin set as type not cd or photo but shipping) and one per item. As with the discount you can easily change (in the code functions.inc.php, function calculate_shipping()) the beahaviour of the shipping calculation. Out of the box it's doing the following. Using the global shipping. If a user buys an item where you specified a different shipping than the global and it's higher than the global then the new (per item) shipping is used. You have nearly unlimited possibilities to customize that.
- fixed some bugs (total calculation, my orders function, google checkout... thanks to all users who helped to find them)
- added all user contributed languages

The pricelist reflects the per item prices if these are set.

6/9/2007 reuploaded the 1.3.5
- fixed colspan in photo_shop_config.php
- removed en echo command used for debugging
- added in photo_shop/images_to_move a txt file (css_changes.txt) that describes what additional css the shop is using (add it to your themes style.css)

6/11/2007 fixed missing user ids in admin



New (maintenance) version (1.3.6 uploaded 3/25/2008)
- Paypal: it's possible now to send a detailed item list to Paypal checkout, possible to define return URL and cancel return URL
- added a 'continue shopping' and checkout button to the cart
- new placeholders for the confirmation email sent to users ({USER_PROFILE1} - {USER_PROFILE6} , all custom user fields)
- in the shops config for the per album settings. A checkbox allows to set prices for all albums in a (sub)category
- fixed: if unlogged users weren't allowed to view the gallery, the shop hasn't had a check for that
- fixed: when refreshing sites, a copy of the current site shows on bottom
- fixed: user name and email show now in admin when bridged
- fixed: when using the modpack, minithumbs show with correct aspect in the cart
- fixed: total sum calculation
- fixed: some hardcoded language
- fixed: zip download has changed in the main app... now that reflects in the admin, too
- fixed: when using MySQL 5, it wasn't possible to change item order

Installation and upgrading to 1.3.6:
from 1.3.5:
Upload all files from the 1.3.6 archive overwriting the existing ones on your server. Keep the folder structure intact
Installation as usual (described above).

upgrading from 1.0 - 1.3.4 to 1.3.6
Upgrading: Before you upgrade uninstall the shop plugin (in the plugin manager) but opt not to 'remove the table that was used to store shop data'. Then upload the new version replacing the old one.
In the plugin manager install the shop again. Done. It's important to do so cause sql changed.
It is recommended to change your cookie name (config -> cookie settings -> cookie name). The shop config data is stored in a session/ cookie. The new per item shipping changed the config data and therefore already set cookies hold out of date info. With changing the cookie name the script saves a new cookie with up to date info.


Please always have actual backups of your database/ files!

demo of the new function available on my testbed http://stramm.st.funpic.org (version 1.3.4) (discount, if you order 10 or more items for print)

Title: Re: Shopping cart
Post by: Stramm on June 04, 2006, 09:08:35 am
some screenshots

1. how the (not logged in) user sees the plugin (add dropdown, checkout and shopping basket button)
2. the shopping basket
Title: Re: Shopping cart
Post by: Stramm on June 04, 2006, 09:10:26 am
3. order overview (admin)
4. displaying an order (admin)
5. the configuration of the plugin (prices, print sizes etc)
Title: Re: Shopping cart
Post by: Dr Preacox on June 04, 2006, 09:20:44 am
Now this is a handy handy plugin! one thing which I would love is to be able to select an album / category that the image shop option is available, err what I mean is say I have my normal cats, albs, but I want to create a cat called shop and albums within that, so I only want the  "Add image to shopping basket: {FORM} " to show up within my shop cat and albums.

Does that make sense? I cant explain things well when im tired.

other than that its awesome, some people might be a little dumb trying to find the shop config, it took me a while.

Oh and one more thing, sorry to rant, but would it ever be possible to create it so you can set up a seperate pricing structure for each picture?
Title: Re: Shopping cart
Post by: Stramm on June 04, 2006, 09:24:57 am
that would mean rewriting the entire plugin

I've forgotten to say that this is written for a client. He doesn't want to get named but agreed to publish the plugin here. Therefore the plugin exactly fits the need of one person and may not be exactly what you're looking for. In that case you of course can modify the code to your needs but it's not possible for me to give much support.
Title: Re: Shopping cart
Post by: Paver on June 07, 2006, 12:31:22 am
Possibly Useful Disclaimer (before more posts start to clutter this thread):

Some of the plugin threads on this board became quickly bloated with feature requests which some people (myself included) implemented, which encouraged the requests to continue.

The intent of threads on this board (like any of the contributions boards) is to merely announce the contribution and for the contributor to make updates, as they come along.

Support for any contributions should be posted on the parent board, in this case the cpg1.4 plugins board (http://forum.coppermine-gallery.net/index.php?board=53.0), with reference to the contribution on this board.  That way, all support requests can be easily handled in an organized way.

In general, you shouldn't ask for new features to contributions, just like you shouldn't ask for mods or themes to get converted.  You should consider what would be required for such a new feature, then ask questions if you are having trouble implementing the new feature.  But we all know that plugin coders often like to consider new uses for their plugins, so carefully thought-out feature requests, with relevant suggestions and full details, may be acceptable even if they strain the boundaries of asking for free coding.
Title: Re: Shopping cart
Post by: Dr Preacox on June 07, 2006, 08:34:29 am
Hmm I never thought that wasn't allowed, but now I know, Im code myself one then :)

Thank you for something to work off stramm, much appreciated  :D
Title: Re: Shopping cart
Post by: julala on June 10, 2006, 04:11:16 am
Another great mod /plugin from Straam  ;D

One small thing.  When there is no CD option for buyers to purchase, for example you only offer photo prints - there seems to be a totals calculation error.

Screen shot:

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.smileonthetiles.com%2Fimages%2Fphoto_shop_bug.jpg&hash=7d8fc5c5caa57cd620f8db6b74031a79)

Notice that the individual price of the photo is 4.49 but the total shows 4.00.  Interestingly if I do add a CD purchase option in the config this error does not occur at all.




Title: Re: Shopping cart
Post by: Stramm on June 10, 2006, 10:08:27 am
Thanks, I'll check that later today
Title: Re: Shopping cart
Post by: Stramm on June 10, 2006, 09:07:10 pm
open photo_shop_cart.php
on bottom find
Code: [Select]
$price[0] = $photo_price;
$price[1] = $cd_price;
photoshop_format_price($price, $counter, $error);
and replace with
Code: [Select]
$price_t[0] = $photo_price;
$price_t[1] = $cd_price;
photoshop_format_price($price_t, $counter, $error);
Title: Re: Shopping cart
Post by: julala on June 11, 2006, 02:04:41 pm
Great - many thanks Straam  ;D
Title: Re: Shopping cart
Post by: depach on June 12, 2006, 05:02:30 pm
ok 5 words: you and your client rocks

This is 100% what i am looking for i am able to take it from here and integrate my CC
processor

thanks again! :)

Jared
Title: Re: Shopping cart
Post by: Pascal YAP on June 18, 2006, 12:15:06 am
Stramm,

waouh ! Très fort !!!!
Je vais faire une traduction de ton super MOD en Français  ;D
Je vais aussi créer un nouveau sujet dans notre Forum CPG Français.

From french :
WoW ! So strong !
I will be translate your powerfull MOD in french  ;)
And a new topic in our French Board ! Is it possible ? Are you OK with me ?
[edit by PYAP]This SHOPPING CART Topic in French Board (http://forum.coppermine-gallery.net/index.php?topic=32809.0)[/edit]

I found a breaking picture near line 191 and 218 in photo_shop_cart.php (themes/eagle/images/delete_small.gif) and need this images in order on the right place  ;)

  But only one Question : have you a solution to choice an other language by one click on a "radio-button" ?

TEST SHOPPING CART IN MY CPG (partially translated in french) NO ORDER ALLOWED. BUT YOU CAN TEST, FOR MY PERSONNAL FEEDBACK. (http://www.pays-dignois.com/galerie/index.php)
(plugin disable)


PYAP
Title: Re: Shopping cart
Post by: Stramm on June 18, 2006, 09:16:59 am
of course you may translate the plugin to french  ;D and I don't see any reason why not to have a topic on the french board.

The missing image has been added and the code fixed so that the shop always grabs that delete button from the themes images dir.

The radio button thingie... I don't understand it. The shop switches its language as coppermine does. Do you want coppermine and shop be able to run different langs? Or should the radio buttons replace coppermines lang selector?

Your personal gallery looks good. Just an additonal linebreak is necessary in template.html between menu and gallery
Title: Re: Shopping cart
Post by: Pascal YAP on June 18, 2006, 11:50:10 am
Mornin' Stramm,

Quote
Your personal gallery looks good.
Merci  ;D
Quote
The shop switches its language as coppermine does.
Really !
I do'nt see that  ???
I'd created a FRENCH.PHP file in photo_shop/lang, and do not see any change.
I need to rename my FRENCH.PHP to ENGLISH.PHP, it's not clean enought  ;)
Then, how to install an other language ?

PYAP
Title: Re: Shopping cart
Post by: Stramm on June 18, 2006, 11:59:47 am
you should use the latest version (todays contains the missing button fix and independancy of a specific theme)
the one from 11/06/2006 allows to select a different language, you do as within the regular CPG, copy the contents of plugins/photo_shop/lang/english.php to a new file french.php and start translating.

hmm, but on your gallery the lang changes for me  ... so you seem to use an actual version of the cart
0 images dans le panier :: Vérifiez votre sélection
Ajoutez cette image à votre panier :
    
Titre :   INFOS : 7 jours sur la planète
Nom de fichier :   titre1.asx
Dimensions :   580 x 435
   10 x 15 cm    Montant :    Euros2.70 Chaque


edit: the cart menu still overlays the menu in your theme. To fix that you should open codebase.php, find
Code: [Select]
$cart_menu = " and after add a <br>
Title: Re: Shopping cart
Post by: Pascal YAP on June 18, 2006, 01:39:50 pm
Stramm,

Quote
copy the contents of plugins/photo_shop/lang/english.php to a new file french.php and start translating.
Done... since some hours.

Quote
so you seem to use an actual version of the cart.
Yes. absolutly.

Quote
hmm, but on your gallery the lang changes for me
You see my Galery in French !???!
Normal, original ENGLISH.PHP is fully translating.
Anyway, your core code work fine. The rest is only poesy !

Quote
the cart menu still overlays the menu in your theme. To fix that you should open codebase.php, find...
In my case (Hack Theme) i edited THEME.PHP with this <br \>

Thanx for all.

PYAP
Title: Re: Shopping cart
Post by: Pascal YAP on June 20, 2006, 03:38:47 pm
Hello Stramm,

I found a mystake in your icons  ???
There's an invertion between two images PAID and NON-PAID-YET
See attached img...

PYAP
Title: Re: Shopping cart
Post by: Pascal YAP on June 21, 2006, 11:20:47 am
Stramm, All French Bodymen,

Here is a Photo_Shop plugin in FRENCH.
Read carefully (in french) before install, because you need to replace some original files by those french files.

PYAP
Download FRENCH attached ZIP below :
Title: Re: Shopping cart
Post by: Pascal YAP on June 22, 2006, 12:17:45 pm
Mormin Stramm,

Issue !
When someone make choice on some pictures and validate this choice, in my ADMIN Shop i can not see any detail !
See below on my two screenshots.

I'm seeing very well 8 items (nombres articles : 8) but after click on, i can'nt view what sort of items they are  ??? I see only one item ! (only the lhe last one maybe)
Do you know this issue ?

Thank's

PYAP
Title: Re: Shopping cart
Post by: Stramm on June 22, 2006, 07:31:48 pm
I know about the switched icons. Will change this in the next update. Also I'm going to replace all hardcoded text so that the plugin offers full multi language support. Btw, thanks for the french translation :thumbs up:

But I have problems understanding your last problem. Do you say you're not able to see any details when a user has made an order in your shop admin? Till now I haven't had such a problem. Can you exclude a connection to your lang hacks?

I'm attaching screenshots how it looks for me on my test machines

Title: Re: Shopping cart
Post by: Pascal YAP on June 22, 2006, 10:47:37 pm
Stramm,

Quote
I know about the switched icons. Will change this in the next update. Also I'm going to replace all hardcoded text so that the plugin offers full multi language support.
Thanx for all about your plugin. Thanx by advance to work on Multilanguage support.  Because when i worked on translation, i saw many infos in Admin interface whos was in english. I need to replace many Words in your code? You understood that !
[/quote]
Quote
But I have problems understanding your last problem.
Quote
Do you say you're not able to see any details when a user has made an order in your shop admin?
yes it's exactly that. I no control on User's choice  ???
Maybe, can i send to you a Full ADMIN account to see my issue by yourself ?

Quote
I'm attaching screenshots how it looks for me on my test machines
I do not see this one on my config. Certainly i make a mystake on my translation  :-\

PYAP
Title: Re: Shopping cart
Post by: Stramm on July 01, 2006, 03:02:58 pm
new version online... the shop now fully supports the lang files

ahmm, edit: the switched icons have been fixed too
Title: Re: Shopping cart
Post by: Sjon vd Hoek on July 03, 2006, 10:13:35 pm
I hope i have read enough to post in a Good Way  :-\

I must give a big compliment to the Photo Shop plugin, i was trilled when i saw the new Update.

After struggling with my knowledge in installing this plugin i finaly succeed in a perfectly working Copperminewith Photo shop.

Finaly i have found a small question :

If the ADMIN is looking at an order which just has been placed, it does not display the image names in the total overview list.
only the thumbs and the amount.

Is there any possibillity in showing the names of the foto's too for the admin?

Thanks alot

Keep up the Good things

I have zozo succeed in translating a Dutch language file for Photo shop plugin, i will post it within this message.
( i have looked so long for a dutch translation file for photo shop so maybe i can make somebody hapy)

Title: Re: Shopping cart
Post by: Stramm on July 04, 2006, 08:36:31 pm
No, in the overview the script doesn't read all entries of an order, it reads just some header file. Here the total number of pics and the price is stored. If you want to display the pic names and/ or pids in the overview you'll have to do another query
Title: Re: Shopping cart
Post by: depach on July 08, 2006, 11:55:52 pm
thx again for the script, i am going to try mod it to add shipping costs

eg:

Please select your shipping option:
(radio button) Local Shipping (South Africa) R20
(radio button) International R100

Regards
Jared
Title: Re: Shopping cart
Post by: JimmyLee on July 14, 2006, 10:18:28 am
brilliant!

how can I change the currency to Australian dollars (AUD) ? Do I edit english.php? which sections...

great work!
Title: Re: Shopping cart
Post by: Stramm on July 14, 2006, 10:26:54 am
yep, that's all in the lang file (except one USD occurance... but that's in the admin and shouldn't hurt -> photoshop_admin.php ~line 394), nevertheless you can fix it (and this will go into the next release as well)

replace
Code: [Select]
{$lang_photoshop_admin['volume']}: {$price[$k]}USDwith
Code: [Select]
{$lang_photoshop_admin['volume']}: {$price[$k]}{$lang_photoshop_admin['usd']}
with that change the currency should be fully changeable with the lang file
Title: Re: Shopping cart
Post by: JimmyLee on July 14, 2006, 10:52:07 am
so in the lang file I change all the USD to AUD ? (all of them?)

Eg:

change:

 'USD' => 'USD',

to

'AUD' => 'AUD',

and so on?

I see there are lots, eg 'usd_total' => 'USD Total',

I already changed my photoshop_admin.php to:
{$lang_photoshop_admin['volume']}: {$price[$k]}{$lang_photoshop_admin['usd']}

but should I have put:
{$lang_photoshop_admin['volume']}: {$price[$k]}{$lang_photoshop_admin['aud']}

? sorry, I'm not so good at this stuff...
Title: Re: Shopping cart
Post by: Stramm on July 14, 2006, 11:04:59 am
Code: [Select]
'USD' => 'USD',you change into
Code: [Select]
'USD' => 'AUD',the name before the arrow is something like an identifier, the name after the arrow what is used to replace the identifier

the above replacement for the photoshop_admin.php is correct, don't change it.

and eg.
Code: [Select]
'usd_total' => 'USD Total'needs to be
Code: [Select]
'usd_total' => 'AUD Total'
Title: Re: Shopping cart
Post by: JimmyLee on July 14, 2006, 12:20:53 pm
thanks, all working!
Title: Re: Shopping cart
Post by: fovsports on July 17, 2006, 06:22:26 am
Once again you have created a plugin thats is so perfect for my site. I have installed it and everything works as described, however one slight request on how to relocate the buttons cart and checkout. See image below. The buttons shift the sub sys menu lower causing a few layout problems..I looked in photo_shop_checkout.php thought that might be the file to edit right? Help me please I love the plug-in.(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.shoiecast.com%2Fstramm%2Fcart.jpg&hash=d866ae943e19f62d181ac6f38f635247)


Thank you for your continued support.
Title: Re: Shopping cart
Post by: Joachim Müller on July 17, 2006, 07:48:27 am
This is a matter of theming, not of this plugin. Shouldn't be discussed on this thread.
Title: Re: Shopping cart
Post by: fovsports on July 17, 2006, 05:39:53 pm
Sorry for the incorrect post/reply on this thread. I thought it would be better here than starting a whole new topic in the location you suggested. I know if any body knows how confusing it is to know where things go here you should know. What I mean by that is you see this all day long right? and you cant believe we cant figure it out. Well maybe we are wrong in not reading/understanding the system like you, but you also should understand that the user friendlyness use this site is or has become a complex matter right? I have read this forum over and over and have seen this complaint by you all over the place. Once again I appologize for my mistake.

Stramm if you are reading this please suggest where you would like this question, and that is where it will go.

I understand that there has to be people like yourself to maintain some sence of order here and then there people like stramm,nibbler,and a few others  who actually help in getting answers out to us ( many thanks ).
Title: Re: Shopping cart
Post by: Stramm on July 18, 2006, 08:13:45 pm
best would be a new thread on the plugin or the themes board

edit... on the other hand this might be pretty useful for some other people too

in the plugins codebase.php find
Code: [Select]
$html = str_replace('{SUB_MENU}','{SUB_MENU} <br /> {CART_MENU}',$html);and comment it out (with adding a double slash in front of the line // )
now open your template.html and add {CART_MENU} where you want the basket buttons to appeare.

Note: if you use more than one theme you need to modify all themes. Editing out the mentioned line will stop the pülugin from auto adding the buttons
Title: Re: Shopping cart
Post by: dad6b on July 31, 2006, 10:01:44 pm
What happens when you delete an order?  Does the user get a message saying their order was deleted or canceled?
Title: Re: Shopping cart
Post by: Stramm on July 31, 2006, 10:13:22 pm
if you need to get in conmtact with a customer there's his email addy listed in the order overview and in the order. Click it and write your message.
If you want it to be more automatic... the email function is already written. You just need to add a line or two to the code and some text to the lang file
Title: Re: Shopping cart
Post by: dad6b on August 01, 2006, 02:59:21 am
You just need to add a line or two to the code
Easier said than done... ;)
Title: Re: Shopping cart
Post by: Manolito on August 05, 2006, 02:25:07 pm
A very good plugin but I have this problem...

I've tried to make the shop work through a bridge inside joomla (this bridge; http://www.mehdiplugins.com/misc/index.htm), and it doesn't reload/show the cart amount in the button when I add to cart, it shows a blank page instead. But when I click at it to view the contents it's all there. Besides, as an guest I can checkout, when I shouldn't even though nothing happens, just a blank page again. In admin the orders are listed without customers account name and emailaddress. Everything works when I turn the bridge off, but I really want this excellent plugin to work with joomla. Coppermine works fine btw. Check my page http://www.daynight.dk/gallery/index.php. Hope someone can help.
Title: Re: Shopping cart
Post by: Stramm on August 05, 2006, 03:20:38 pm
that would mean rewriting the entire plugin

I've forgotten to say that this is written for a client. He doesn't want to get named but agreed to publish the plugin here. Therefore the plugin exactly fits the need of one person and may not be exactly what you're looking for. In that case you of course can modify the code to your needs but it's not possible for me to give much support.

as already written... this was an order and my customer agreed to make this plugin available to the CPG community. The plugin hasn't been written with bridging in mind. That'll need some modifications

eg. the query
Code: [Select]
$result = cpg_db_query("SELECT s.*, u.user_name, u.user_email  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$CONFIG['TABLE_USERS']} as u ON u.user_id = s.uid WHERE aktive=".$box." AND cd=1 ORDER BY ". $sort_codes[$sort] ." LIMIT $lower_limit, $orders_per_page;");
either one needs to add that to the bridgefile(s) -> silly cause then this wouldn't be a plugin anymore
or you need to run several queries and rewrite some functionality of the plugin... whatever, every query that accesses the usertable needs to be done via the bridge. That's exactly two queries in the admin and some in  registration/ logging in

I'd really appreciate if you come up with a solution
Title: Re: Shopping cart
Post by: Manolito on August 05, 2006, 07:20:26 pm
Alright, I understand that the plugin is programmed only for coppermine in mind and that you don't have time to support different versions of it. However I'm not a programmer so I don't know how to write the code for the bridge file (which would be joomla.inc.php file I think from Mehdi). Those query's you talking about, I've found these in your code, are they all? If they are I 'll try to ask Mehdi about it...

photo_shop_admin.php
Code: [Select]
$result = cpg_db_query("SELECT s.*, u.user_name, u.user_email  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$CONFIG['TABLE_USERS']} as u ON u.user_id = s.uid WHERE aktive=".$box." AND cd=1 ORDER BY ". $sort_codes[$sort] ." LIMIT $lower_limit, $orders_per_page;");
$result = cpg_db_query("SELECT s.*, u.user_name, u.user_email  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$CONFIG['TABLE_USERS']} as u ON u.user_id = s.uid WHERE oid=".$oid." AND cd=1 LIMIT 1;");

photo_shop_register.php
Code: [Select]
$sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_name = '" . addslashes($user_name) . "'";
$sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_email = '" . addslashes($email) . "'";

// Are you sure I'll need those below?
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
       "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
       "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";
$sql = "SELECT user_active user_active, user_email, user_name, user_password " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_actkey = '$act_key' " . "LIMIT 1";
$sql = "UPDATE {$CONFIG['TABLE_USERS']} " . "SET user_active = 'YES' " . "WHERE user_actkey = '$act_key' " . "LIMIT 1";
Title: Re: Shopping cart
Post by: nico59 on August 21, 2006, 12:52:04 pm
When I click the checkout button these warnings appear at the top of the page. How can I avoid this? (I have no idea of coding)

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /mnt/cr1/07/547/00000013/htdocs/coppermine/plugins/photo_shop/photo_shop_checkout.php on line 50

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /mnt/cr1/07/547/00000013/htdocs/coppermine/plugins/photo_shop/photo_shop_checkout.php on line 83
Title: Re: Shopping cart
Post by: Stramm on August 21, 2006, 02:20:35 pm
http://forum.coppermine-gallery.net/index.php?topic=33877.0
Title: Re: Shopping cart
Post by: nico59 on August 21, 2006, 03:58:56 pm
Thank you, "speedy" stramm  ;)
Title: Re: Shopping cart - Shopping Basket after Checkout ?
Post by: TT on September 07, 2006, 02:55:26 pm
I have integrated your plugin, which I really like.

When testing, I found that the shopping basket still contains the images after checking out. Will the shopping basket be emptied eventually ?
Title: Re: Shopping cart
Post by: Stramm on September 07, 2006, 06:53:18 pm
it'll empty the basket. However it sometimes happens that a cookie gets somehow 'corrupted' and the script isn't able to delete the shopping basket parts. Clearing the cookie should do the trick
Title: Re: Shopping cart
Post by: Stramm on September 08, 2006, 08:34:22 pm
Photo Shop updated to v1.1
Title: Re: Shopping cart
Post by: Manolito on September 15, 2006, 12:14:20 am
It's me again I spent the past month to find a solution to make the plugin work with mehdi's bridge and I still haven't come up with a solution. I'm kind of desperate for some help. Could you Stramm, help me modify the bridge file you think? (Look at my previous questions).
Title: Re: Shopping cart
Post by: Stramm on September 16, 2006, 07:18:56 pm
you're not supposed to modify the bridge files... modify the two calls in the photo shop files I showed you
Title: Re: Shopping cart
Post by: Manolito on September 18, 2006, 11:13:19 pm
Alright, I thought it was the bridge files I should modify, but that doesn't change the fact that I don't know how. I really need help how to write the code for it. I would appreciate any help...
Title: Help with "modify the confirmation email template"
Post by: BikiniPhotoBank on September 21, 2006, 12:01:25 am
Hello, first of all i want to thank the folks at coppermine and specifically Stramm this shopping cart solution is perfect! I have installed this and it works great except for my lack of know how on editing the fields below. Do i have to modify the actual file in GoLive? then reupload this to the server? Does anyone have a sample code that i could look at?
Also how do i configure this to my paypal account?
Then last, i dont understand the last line "move images" what images? I have one image folder that I uploaded to test the shopping cart and it works fine, so do i move these images now?
I am new to all this programming stuff!

Next Mod is the watermarking that I would like to install, does anyone have a plugin for that?
Thank you for all your help!!

You should modify the confirmation email template in the plugins lang file.
You can use placeholders
{USER_NAME}
{SITE_NAME}
{ORDER_ID}
{PRICE}
{ADMIN}

Finally move the images from the archive (folder images_to_move) to your themes images directory
Title: Re: Shopping cart
Post by: Stramm on September 21, 2006, 05:41:08 pm
You use a texteditor to edit php files

paypal account... this is not implemented. You'll have to modify photo_shop_checkout.php and add the billing solution of cour choice. PHP knowledge is necessary to do that

images to move... as said in the install howto (first post in this thread)
Quote
Finally move the images from the archive (folder images_to_move) to your themes images directory

Watermarking... not related to the photo shop plugin.

Next time please stick to the one question per thread policy. Don't clutter this thread but start an own in the cpg1.4 plugins forum
Title: Re: Shopping cart
Post by: BikiniPhotoBank on September 21, 2006, 07:23:07 pm
Thanks for the reply.
This shopping cart cannot be made to take paypal?
Is there a shopping cart that does?

Thanks for your help, I will try not to clutter the boards
Title: Re: Shopping cart
Post by: Stramm on September 21, 2006, 07:27:38 pm
As said, you'll need to edit the mentioned file and send the checkout data to paypal. I have no clue about paypal shopping system etc. so you're on your own with that.

There are paypal mods on the mods/ hacks board http://forum.coppermine-gallery.net/index.php?board=73.0
Title: Re: Shopping cart
Post by: BikiniPhotoBank on September 21, 2006, 08:01:01 pm
Thank you
Title: Re: Shopping cart return link
Post by: mrbaddis on September 23, 2006, 02:42:09 am
With cart is it possible to set different return link for each item. I wish to see on demand video. After payment buyer will be send to url to watch
Title: Re: Shopping cart
Post by: Stramm on September 23, 2006, 06:51:00 am
possible, in config set a 'custom field for image description' eg. URL. In here you store thze url to your on demand movie

that URL you read in the checkout and redirect the user there... find and replace index.php
Code: [Select]
msg_box('', $lang_photoshop['email_sent'], $lang_continue, 'index.php');
}

However you'd need to modify more I'd say. What happens if the user adds more than one movie to the cart? 
Title: Re: Shopping cart
Post by: tareone on September 25, 2006, 07:49:52 pm
Shipping costs are excellent addon. I have one problem though:

- when customer removes picture from shopping cart and then adds picture in shopping cart, the already removed picture is still in the cart (amount is 0 though) and i see those removed pictures when i handle orders. Amounts and total payment amounts are right, but it's confusing.
Title: Re: Shopping cart
Post by: Stramm on September 25, 2006, 08:02:19 pm
Can't reproduce this problem. Please clear your cookies and retry... looks like an out of control cookie
Title: Re: Shopping cart
Post by: tareone on September 25, 2006, 08:24:23 pm
Can't reproduce this problem. Please clear your cookies and retry... looks like an out of control cookie

Thanks for fast reply. It was a corrupted cookie, now it's working beautifully!
Title: Re: Shopping cart
Post by: daviddubree on September 28, 2006, 04:25:28 am
The cart sounds great..but... I am willing to pay to have PayPal support if that is a project you can take on.  I can program but who has time! ;)
Title: Re: Shopping cart
Post by: KlausH on September 28, 2006, 01:02:43 pm
Wonderful stuff! Thanks a lot!

Would it b e possible to select only one or two categories for using this shop?

My idea ist to select one for high resolution pics which could ordered.
Title: Re: Shopping cart
Post by: Stramm on September 28, 2006, 08:16:23 pm
Wonderful stuff! Thanks a lot!

Would it b e possible to select only one or two categories for using this shop?

My idea ist to select one for high resolution pics which could ordered.

easy to do if you don't require a backend and if it's OK to block/ show albums and not categories
then find
Code: [Select]
$event = isset($_POST['event']) ? $_POST['event'] : null;and after insert
Code: [Select]
$albums_to_show = array(1,2,3,4,5,6,10,20);
if (!in_array($pic_data['aid'], $albums_to_show)) return $pic_data;
if you want to show the shop for the albums in the albums_to_show array (edit it to your needs)
use that to block certain albums
Code: [Select]
$albums_to_block = array(1,2,3,4,5,6,10,20);
if (in_array($pic_data['aid'], $albums_to_block)) return $pic_data;
Title: Re: Shopping cart
Post by: Stramm on September 28, 2006, 08:18:45 pm
The cart sounds great..but... I am willing to pay to have PayPal support if that is a project you can take on.  I can program but who has time! ;)

PayPal support... where should that be added?
after
Quote
Thanks for your order.
We have sent you a confirmation email!
and there a paypal button?
Title: Re: Shopping cart
Post by: daviddubree on September 29, 2006, 04:00:35 am
In an earlier post you said "paypal account... this is not implemented. You'll have to modify photo_shop_checkout.php and add the billing solution of cour choice. PHP knowledge is necessary to do that"

I understand that, but I want to know if you or another can be nudged to add paypal support in a way that lets the buyer click on a 'Purchase' button under the intermediate pic and take them right into the Paypal checkout screen.  I only need it to support a single item purchase.  But each item in coppermine may have a different price.

If this is already available as a plugin, then my bad, but I couldn't find a paypal plugin (not a mod/hack) with unique prices for every item.

Like I said I (my client) is willing to pay for someone to add this.

Thanks!

Title: Re: Shopping cart
Post by: Paver on September 29, 2006, 04:56:15 am
@daviddubree: All the contributed plugins are on the plugin contributions board.  I believe this is the only shopping cart plugin contributed so far.  If it is close to what you want, you should look into modifying it for your use.

If you are asking for paid support, please post on the "Looking for Freelancers" board (after reading the Sticky thread on that board).  Support on all the other boards is volunteered by the supporters for free.
Title: Re: Shopping cart
Post by: Stramm on September 29, 2006, 08:18:58 am
This is a shopping cart solution not targeted to PayPal. It should support adding several items to a basket and store that after checking out in the db. A backend shall help the webmaster to send the pics and see the total amounts. What you want to have is totally different and therefore this plugin is not for you. It's not difficult to add a paypal button somewhere in/ after the checkout. That would be for all items in the basket.

You should check the mods board and search for 'PayPal'. There are 2 mods I think that do what you need.
Title: Re: Shopping cart
Post by: KlausH on September 29, 2006, 12:05:10 pm
easy to do if you don't require a backend and if it's OK to block/ show albums and not categories
then find
Code: [Select]
$event = isset($_POST['event']) ? $_POST['event'] : null;and after insert
Code: [Select]
$albums_to_show = array(1,2,3,4,5,6,10,20);
if (!in_array($pic_data['aid'], $albums_to_show)) return $pic_data;
if you want to show the shop for the albums in the albums_to_show array (edit it to your needs)
use that to block certain albums
Code: [Select]
$albums_to_block = array(1,2,3,4,5,6,10,20);
if (in_array($pic_data['aid'], $albums_to_block)) return $pic_data;

Thanks for your fast reply; i´ll give your solution a try and of course feedback.

We have only albums on our site, so this could the one i need!
Title: Re: Shopping cart
Post by: KlausH on September 29, 2006, 02:00:56 pm
Works like a charm! Thanks!
Title: Re: Shopping cart
Post by: tareone on September 30, 2006, 05:55:17 pm
easy to do if you don't require a backend and if it's OK to block/ show albums and not categories
then find
Code: [Select]
$event = isset($_POST['event']) ? $_POST['event'] : null;and after insert
Code: [Select]
$albums_to_show = array(1,2,3,4,5,6,10,20);
if (!in_array($pic_data['aid'], $albums_to_show)) return $pic_data;
if you want to show the shop for the albums in the albums_to_show array (edit it to your needs)
use that to block certain albums
Code: [Select]
$albums_to_block = array(1,2,3,4,5,6,10,20);
if (in_array($pic_data['aid'], $albums_to_block)) return $pic_data;

This was really nice feature and easy to add (codebase.php). Thanks again!
Title: Re: Shopping cart
Post by: Stramm on October 03, 2006, 07:57:03 pm
Announcement:
New version Photo Shop v1.2 available

-supports paypal and adds wire info after checkout (configurable in include/gateway.inc.php)
-bridge compatible
-bug fixes
Title: Re: Shopping cart
Post by: fareforce on October 03, 2006, 11:04:03 pm
**Nevermind**  Just figured it out.. I think.. LOL

Stramm,
  I uninstalled the old one, and installed the new one, and I can't find where to do shipping, or paypal info.. Help!!

http://www.alaskastudio.com

Thanks,
Travis
Title: Re: Shopping cart
Post by: daviddubree on October 04, 2006, 12:36:57 am
Paypal support.....Excellent!

Thanks
Title: Re: Shopping cart
Post by: joost on October 05, 2006, 04:28:24 pm
After carefull consideration I decided to add this feature request in this thread because I believe it is important to a lot of people. Also, I think the changes/addons I propose should be in- or be part of your plugin, otherwise future updating is going to be a nightmare. For me, this is an (out of control) hobby project, so my funds are limited, but I am willing to pay (some) for (some) programming. I wouldn't be surprised if we find more contributors in this forum. In sequence of importance (to me):

1) in the cart you see the (foto)filename. Please add that to the database and show this filename when reviewing/processing the order. So many pictures are alike..... This was mentioned before and you responded to it, but I cannot make it work. While we are at it - maybe aling with the album name???

2) I would like in my confirmation email to my client to be able to use more placeholders, specifically for the customer field (the ones the client fills when making a profile). Is that hard to do?

3) multiple pricing sets. This can be real simply accomplished by having an extra field at the same place where you specify the prices right now. Per line you enter an code/ID (e.g. 1, 2, A, B or A1 etc. etc.) In the albums you need just one admin option, namely this code. No code means no shop, and listing a code means showing the appropriate types that can be ordered.

4) allow for a printout per order in the active orders list

If you feel this item needs to be discussed off-forum than please email me privatly (joost@skygliders.nl). Thank you in advance for your consideration.
Title: Re: Shopping cart
Post by: Stramm on October 05, 2006, 05:44:40 pm
1. The filename is not unique, but the picture ID is. The cart shows exactly that ID and links to the picture in question (click the thumb)

2. Possible

3. The shop isn't made with that in mind. Not that easy to do -> currently I'd say no, If you find someone else who's willing to change the code, perfect

4. Can't you use the browsers print function?
Title: Re: Shopping cart
Post by: joost on October 05, 2006, 07:47:11 pm
Thank you for your reply.

Sub 1) you are of course correct on this one, but that's a matter of planning. A combination album and filename is also unique though. Right clicking is kind of tedious and does not work for printing or speedy processing. We need to do small order reprints for very little money and therefore automation is helpfull. Since the client cart shows filenames I was hoping to be able to forward that info.

Sub 2) ok - hopefully we will see that in an update. As stated, I am willing to contribute for you/someone to compensate for programming hours

Sub 3) no comment

Sub 4) see sub 1. It is not a very clean solution, I am used (in client/server db apllications) to make it nice, with client data and repeating headers etc. I guess I could dive into this, but my PHP experience is limited to hacking some existing code, this is a little more involved.

I will keep an eye on this board - who knows we will get some more reactions.
Title: Re: Shopping cart
Post by: Stramm on October 05, 2006, 08:40:14 pm
Thank you for your reply.

Sub 1) ... Right clicking is kind of tedious ...

try shift left
Title: Re: Shopping cart
Post by: Stramm on October 06, 2006, 09:35:25 pm
3) multiple pricing sets. This can be real simply accomplished by having an extra field at the same place where you specify the prices right now. Per line you enter an code/ID (e.g. 1, 2, A, B or A1 etc. etc.) In the albums you need just one admin option, namely this code. No code means no shop, and listing a code means showing the appropriate types that can be ordered.

I did some coding today and came up with a per album solution. In the shop config you can browse through a list of all existing albums and disable the shop for that album or you can define different prices for the items in this album.

PM me your email and I send you the plugin to test
Title: Re: Shopping cart
Post by: joost on October 06, 2006, 09:55:13 pm
I am getting confused between the 2 threads - one in the 'looking for support' forum and one here. Until I hear otherwise I will keep on posting in this thread. I placed the following in the other thread - I am repeating it here for the sake of clarity (I was wondering myself whether I had gone nuts - I knew I had posted something this afternoon).

For those following this thread: I have yet to test any new code and Stramm or I will report back later.

http://forum.coppermine-gallery.net/index.php?topic=37021.msg174382#msg174382 (http://forum.coppermine-gallery.net/index.php?topic=37021.msg174382#msg174382)
Quote
am not going to argue, you have put much more thought into this than I did. I will be happy with any additional feature over the current shop anyway.

Let me make sure I understand what you just said in the listing above:
- you agree with the switch in the albums
- in the pricing structure, there are default prices to be used if the shop switch is on  and
  you can specify prices that only show in a specified album - in this case the default prices (including default add to cd and default shipping) don't show

I would be perfectly happy with this.

For the sake of clarity, let me explain what my idee was, because it is not so silly as you might think (it might be more complicated and therefore not worth it...)

In the pricing setup you ad a code to every line item, like A or B or C or .... You can have 5 prices with code A, 3 with code B, and so on. In the album setup, you tell the album which code goes with the album, no code means no shop, code A means only the pricelist items with an A are shown, and so on. With just a couple of pricing sets you could serve hundreds of albums, certainly a nice feature. Specifically for commercial phototgraphers, they can have a setup for weddings, a setup for schools, one for a sporting event, a showcase album without any pictures for sale.

Maybe you got my point right away, but I just wanted to make sure.
Title: Re: Shopping cart
Post by: Stramm on October 07, 2006, 10:20:55 am
Announcement:
New version Photo Shop v1.3 available
Title: Re: Shopping cart
Post by: joost on October 07, 2006, 12:07:08 pm
I was fortunate to be the first one to 'test-drive' this new version and YES, all of sudden the basic shopping cart is a much more usefull instrument. Over the past month I have checked many different solutions. Since I have used Coppermine for quite a couple of years, you tend to measure everything against this (great) package. But, even when you take an objective standpoint, one realises that the flexibility and expendibility of Coppermine is hard to match.

For the project on hand I really need some shopping capabilities and I felt I had to look around. After checking I don't know how many packages most promising looked to me the EOS (eostemplate.com) plugin for JAlbum/IMatch/IView/BreezeBrowser or PhotoStore from KTOOLS.net. The big problem with EOS (imho) is that you create the albums off-line, which means that you probably have to work from the same location all the time. It is also a bit tedious what you need to go through to adjust existing albums. Fine for occasional use. but for everyday additions/changes??? From the way I understood the concept you also need to organise another website with links to every album you create. There are some other issues as well.
KTools has a pretty nice solution, but it is completely in English and you have to go through the entire source to translate into another language. Imagine future updates.... Also, I don't like the way subalbums are handled. Lastly, I believe the layout can only be adapted so much, I looked at all the modified templates and they pretty much looked like the base template with only different background pictures and colours, but not true makeovers.

The incredible flexibility offered in Coppermine, the ease of creating add hoc categories and albums, the ease to handle either 10 or 1000 pictures, it all made me come back and trying to find a way to make this (coppermine) work for my purpose. The basic photoshop from Stramm did just not cut it for me, but version 1.3 makes the difference. For me, and I believe for many others, this will work right out of the box. At first glance there are just some minor changes, but when you think about the implications, you realize that suddenly this is a package with enormous potential.

I certainly hope there will be someday a version 1.x, but already: thumbs up for this great plugin.

THANK YOU STRAMM
Title: Re: Shopping cart
Post by: fovsports on October 10, 2006, 06:32:18 pm
Installed the plugin yesterday.  The only thing so far I need help with is the order manager. I see that I have 8 orders but the manager is only showing one order at a time. I rearranged the order/orders to sort in a different fashion ie. order date,order id and I can see that the other orders pop up but only one at a time. The complete list of orders do not show up, but are in the system? I should mention that the version I installed is 1.3 the newest right? I did install a long time ago 1.0 and yes I did uninstall it could that have something to do with it?
Title: Re: Shopping cart
Post by: Stramm on October 10, 2006, 06:53:05 pm
8 orders or 8 items for that order?? Verify with a tool like phpmyadmin... open the shop table and browse it. Can you see 8 different order ids (oid)??
Title: Re: Shopping cart
Post by: fovsports on October 10, 2006, 10:06:06 pm
see below
Title: Re: Shopping cart
Post by: fovsports on October 10, 2006, 10:19:51 pm
Stramm , Here is the data from shop table.

INSERT INTO `cpg148_shop` VALUES (1, 1, 1, 1518, 0, 1, '4x6', 2.00, 1160437327, 0, 2);
INSERT INTO `cpg148_shop` VALUES (2, 1, 1, 0, 1, 1, '0', 2.00, 1160437327, 1, 2);
INSERT INTO `cpg148_shop` VALUES (3, 2, 1, 43, 0, 1, '4x6', 5.00, 1160438133, 0, 2);
INSERT INTO `cpg148_shop` VALUES (4, 2, 1, 0, 1, 1, '0', 5.00, 1160438133, 0, 2);
INSERT INTO `cpg148_shop` VALUES (5, 3, 1, 1717, 0, 1, '4x6', 5.00, 1160438514, 0, 2);
INSERT INTO `cpg148_shop` VALUES (6, 3, 1, 0, 1, 1, '0', 5.00, 1160438514, 0, 2);
INSERT INTO `cpg148_shop` VALUES (7, 4, 1, 1717, 0, 1, '4x6', 5.00, 1160438935, 0, 2);
INSERT INTO `cpg148_shop` VALUES (8, 4, 1, 0, 1, 1, '0', 5.00, 1160438935, 0, 2);
INSERT INTO `cpg148_shop` VALUES (9, 5, 1, 43, 0, 1, '4x6', 5.00, 1160440323, 0, 2);
INSERT INTO `cpg148_shop` VALUES (10, 5, 1, 0, 1, 1, '0', 5.00, 1160440323, 0, 2);
INSERT INTO `cpg148_shop` VALUES (11, 6, 1, 43, 0, 1, '4x6', 5.00, 1160440485, 0, 2);
INSERT INTO `cpg148_shop` VALUES (12, 6, 1, 0, 1, 1, '0', 5.00, 1160440485, 1, 2);
INSERT INTO `cpg148_shop` VALUES (13, 7, 245, 1518, 0, 1, '5x7', 7.00, 1160455742, 0, 2);
INSERT INTO `cpg148_shop` VALUES (14, 7, 245, 1518, 0, 1, '4x6', 5.00, 1160455742, 0, 2);
INSERT INTO `cpg148_shop` VALUES (15, 7, 245, 0, 1, 2, '0', 12.00, 1160455742, 0, 2);
INSERT INTO `cpg148_shop` VALUES (16, 8, 245, 1518, 0, 1, '5x7', 7.00, 1160455900, 0, 2);
INSERT INTO `cpg148_shop` VALUES (17, 8, 245, 1518, 0, 1, '4x6', 5.00, 1160455900, 0, 2);
INSERT INTO `cpg148_shop` VALUES (18, 8, 245, 0, 1, 2, '0', 12.00, 1160455900, 0, 2);
INSERT INTO `cpg148_shop` VALUES (19, 9, 245, 1518, 0, 1, '5x7', 7.00, 1160455905, 0, 2);
INSERT INTO `cpg148_shop` VALUES (20, 9, 245, 1518, 0, 1, '4x6', 5.00, 1160455905, 0, 2);
INSERT INTO `cpg148_shop` VALUES (21, 9, 245, 0, 1, 2, '0', 12.00, 1160455905, 1, 2);
INSERT INTO `cpg148_shop` VALUES (22, 10, 1, 43, 0, 1, '4x6', 5.00, 1160497236, 0, 2);
INSERT INTO `cpg148_shop` VALUES (23, 10, 1, 0, 1, 1, '0', 5.00, 1160497236, 1, 2);
INSERT INTO `cpg148_shop` VALUES (24, 11, 1, 1461, 0, 1, '4x6', 5.00, 1160510912, 0, 0);
INSERT INTO `cpg148_shop` VALUES (25, 11, 1, 0, 1, 1, '0', 5.00, 1160510912, 0, 0);
INSERT INTO `cpg148_shop` VALUES (26, 12, 1, 1102, 0, 1, '4x6', 5.00, 1160510948, 0, 0);
INSERT INTO `cpg148_shop` VALUES (27, 12, 1, 0, 1, 1, '0', 5.00, 1160510948, 0, 0);
INSERT INTO `cpg148_shop` VALUES (28, 13, 2, 829, 0, 1, '4x6', 5.00, 1160511048, 0, 0);
INSERT INTO `cpg148_shop` VALUES (29, 13, 2, 0, 1, 1, '0', 5.00, 1160511048, 0, 0);

as the vaules show I have deleted some and not others. My userid = 1 and my partners is 245 and a test user is 2.  So cuurrently there are order id's 11,12,13 and my photo_shop_admin is stating that there is 3 which is correct but only showing one, see attached image.

I use the paypal gateway, and I have also commented out the line
$html = str_replace('{SUB_MENU}','{SUB_MENU} <br /> {CART_MENU}',$html);
in the file codebase.php. for design purposes.
And placed {CART MENU} in my template.html per your suggestion.
Title: Re: Shopping cart
Post by: joost on October 11, 2006, 12:57:27 am
To Fovsports: just for the sake of testing, switch to another thema and see what happens. It almost looks like the orders are there but that there is not enough room to list all of them...
Title: Re: Shopping cart
Post by: fovsports on October 11, 2006, 04:42:11 am
I wish I could change to another theme for testing but, when I started using coppermine a year ago I messed/modded to many things and have learned a very important lesson, never mod certain files. Now I'm stuck with one and only one theme. Thanks for the help as you can tell I really need it.
Title: Re: Shopping cart
Post by: Stramm on October 11, 2006, 07:15:26 am
I restored your SQL dump on my local install. All working as expected. I see your three orders (the last ones you did with USER ID 1 and 2). My suggestion would also have been to upload the classic theme and test again. Just with uploading a folder into the themes dir you can't mess up anything. Swithcing between themes you do with adding ?theme=classic to your URL eg. mydomain.com/cpg/index.php?theme=classic
Title: Re: Shopping cart
Post by: Dirk on October 12, 2006, 02:07:36 pm
Hello Stramm,

great MOD!

Is it possible to use the plugin wihtout a registration? Perhaps it´s possible fill out a form with the Adress (where sent the Photos)?

Thanx!

Dirk
Title: Re: Shopping cart
Post by: Stramm on October 12, 2006, 03:40:33 pm
possible... but you'd have to change some code... but why??

you need the customers data... if you save it in a new table or in the cpg_user table, who cares??? If you do not like the customers to be a regular registered user then create a new group 'customers' and when they register using the shops login form they automatically get put into that group.
Title: Re: Shopping cart
Post by: Dirk on October 12, 2006, 04:36:57 pm
At the moment you can download the files if you´re login (i need this function). And i don´t want give shop user the possebility for the file download.

Thanx for fast answer!

Dirk
Title: Re: Shopping cart
Post by: Stramm on October 12, 2006, 04:55:21 pm
there's a plugin that controls file access for certain groups... have a look into it. Should be exactly what you need to fine tune permissions
Title: Re: Shopping cart
Post by: Dirk on October 13, 2006, 01:18:12 am
Great idea it function. Last problem the without permisson are not able to select the picture they want buy (see the jpg). I use Full-Size Photos Access Control v1.4. Perhaps the drop down can be place otherwise.
Title: Re: Shopping cart
Post by: Paver on October 13, 2006, 01:44:17 am
It looks like the "Full-Size Photos Access Control" is at fault.  I need to look at this sometime (and will post on that plugin's thread (http://forum.coppermine-gallery.net/index.php?topic=25010.0) when ready).

For now, you can fix this by putting the Shop plugin below the Access Control plugin (using the arrows on the plugin manager page).  With the Access Control plugin on top, things seem to work fine.
Title: Re: Shopping cart
Post by: jesperd on October 15, 2006, 03:02:33 pm
Hi, thanks for a great plugin.

When I open a picture based on the result of a search, I can't add to the shopping cart. But as soon I click the URL listed in the file info section and clikc the "Add to shopping cart" from there, it works fine. Actually it works fine regardless of how I came to the picture except from searches.

Sometimes a little icon is shown between the "# images in cart" and "Checkout" button when images are added to the cart.

Have I done something wrong, and if so, can anybody point me in the right direction?

Thanks a lot. I hope I have posted the right place.

Jesper
Title: Re: Shopping cart
Post by: Stramm on October 16, 2006, 08:18:23 am
search works with cookies... and therefore the URL for all searches is the same -> adding the items to the shop db won't work. Only practical solution would be to blend out the shop for searches
Title: Re: Shopping cart
Post by: ralfs on October 16, 2006, 12:07:18 pm
Announcement:
New version Photo Shop v1.3 available

Hi,

Where do i get this plugin? In cpg149_plugin_pack.zip I can only find the version 1.0
The cpg149_modpack_stramm_3.zip contains other stuff.

I am too silly - or it has been forgotten to state somewhere ...

Regards,
Ralf
Title: Re: Shopping cart
Post by: Stramm on October 16, 2006, 12:12:36 pm
attatchment in the first post of this thread
Title: Re: Shopping cart
Post by: ralfs on October 16, 2006, 01:17:47 pm
 :-[  sometimes, it is so easy ...

Thanks!
Title: Re: Shopping cart
Post by: fareforce on October 18, 2006, 07:33:29 am
Stramm,

  Is there a way to streamline the paypal option a little? Maybe when the user is viewing their cart, and click on checkout, it takes them directly to paypal, and then have paypal return them to the confirrmation page. Paypal can send all of the info back to the website, via a token. If you could point me in the right direction I will see what I can work up..

Also, how hard would it be to add a different shipping amount for each item, or assign each item a weight, and then calculate the shipping.. Unfortunatly, I sell everything from postcards, to large framed pictures. Once again, maybe if you can point me in the right direction...

Kinda like mixing oscommerse with this.

Thanks,

I have attached the files I use for oscommerse for the 3 types of payment I do, and the shipping stuff..  It might help..
Title: Re: Shopping cart
Post by: fareforce on October 18, 2006, 07:44:31 am
Here is the shipping script
Title: Re: Shopping cart
Post by: Stramm on October 19, 2006, 09:14:06 am
you'll have to modify photo_shop_checkout.php
the checkout button ---> you'll need to send paypal not only the total and the shipping amount, but info about every item. If paypal can't return all that info ... bad luck. Then it's not possible to go this way (cause you can't add the items to the shop db). I haven't looked into this and the paypal functionality. However I decided against that solution. A lil glitch in the users internet connection and he has paid but the purchease info doesn't get back to your shop.
As it is now... he orders and gets presented a bunch of payment possibilities, pays and when payment arrives you mark the order paid and deliver.... cool, and if paypal cvan return back... then the shop can automatically mark the order paid for you (not yet implemented)

The shop doesn't save info about each item in your pictures db. So it's not possible to have shipping depending on items. Would be possible to have different shipping costs for each album. The most expensive overrides all others.
If you don't hesitate to rewrite, then you'd assign shipping to the cart items and not the items in the pictures db., if no shipping is set, then the default is taken into account

eg. 
Photo books  - shipping USD 10.-
Greeting cards - shipping standard

If the guy orders greeting cards... then what you've set in config rules. If he orders a photo book... then you override the standard shipping with the USD 10.-

Haven't looked into this yet, but I think it's doable without to much problems
Title: Re: Shopping cart
Post by: fareforce on October 19, 2006, 05:12:21 pm
One other thing that would be nice is a CAPTCHA on the checkout page. I have had spiders (i think) submitting orders. It is usually from an email address simular to test@testuser.com. I have had 3 in the the last 2 days.. 

I will play with the coding a little bit for the cart and see what I can break!  ;D
Title: Re: Shopping cart
Post by: mikyma on October 22, 2006, 12:10:54 am
Hallo

just one more question to this great plugin  :D

How does the admin get the pictures to send them to a foto service ?
I think the best way is to dowload all pics like the favorites zip download.
is there such function ?

Greets Michael

Title: Re: Shopping cart
Post by: Stramm on October 22, 2006, 08:05:48 am
no, not yet
Title: Re: Shopping cart
Post by: mikyma on October 22, 2006, 03:40:13 pm
Thanks for the fast reply

so i have to try a bit coding  ;D
It can t be that difficult,
the function to write zip files already exists.

Greets Michael
Title: Re: Shopping cart
Post by: Stramm on October 22, 2006, 04:02:18 pm
should be pretty easy... maybe I do some coding regarding zip downloads too
Title: Re: Shopping cart
Post by: Stramm on October 22, 2006, 05:04:29 pm
zip download addon:

open photo_shop_admin.php and find
Code: [Select]
<span style="float:right;"><a href="mailto:{$user_email[$k]}">{$user_email[$k]}</a></span>
above add
Code: [Select]
<span style="float:right;"><a href="index.php?file=photo_shop/photo_shop_zip&oid={$oid[$k]}">{$lang_photoshop_admin['download_zip']}</a></span><br>

in photoshops lang file english.php
find
Code: [Select]
  //1.3
  'filename' => 'Filename',
below add
Code: [Select]
  //1.4
  'download_zip' => 'Download zip'

place the attached file into the photo_shop directory (unpack first)
Title: Re: Shopping cart
Post by: mikyma on October 22, 2006, 10:31:25 pm
Super
That s it ! Saves a lot of time  :P

Thanks for solving this so fast

Greets Michael
Title: Re: Shopping cart
Post by: julala on October 23, 2006, 05:14:04 pm
Thanks for the paypal integration - thats saved alot of time  :)

One small issue - having used the shop plugin with no problems for several months, I just upgraded to version 1.3 in order to have the added paypal function and now I am having a display problem in the admin page.  This was highlighted by a previous poster but no solution mentioned.  Only one order shows when in fact there are lots more.  The orders are there but they are not showing.  From the pevious response I am assuming this may be a theme problem with the plugin but I have had no problems using my current theme until now.  I am wondering if the theme independace was missed in the latest version.

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.smileonthetiles.com%2Fimages%2Fphoto_shop_bug_2.jpg&hash=24b3d8322ac8e5966c31d289cc3da437)

Your thoughts welcome.

Thanks

Julia
Title: Re: Shopping cart
Post by: Stramm on October 23, 2006, 07:27:59 pm
I wasn't able to offer a solution cause I wasn't able to replicate this problem

I've imporetd the dump of the prev poster and all worked smooth for me... no problem with the themes I tried
Title: Re: Shopping cart
Post by: mikyma on October 23, 2006, 10:21:41 pm
Here my little "give back" for this Plugin  ;)

german.php laguage file Version 0.9 Beta (photo_shop_version 1.3)
which means you should have an eye on the translation  8)
by try a bit before use produktive !

The e-mail notification text (admin and user) also have to be changed!
(line 26-30 and 38-40 of german.php)

simply copy attached file into lang folder of photo_ shop plugin,rename it to "german.php"
and make sure coppermine runs with german language.

Greets Michael
Title: Re: Shopping cart
Post by: Stramm on October 24, 2006, 12:35:01 pm
Thanks for your contribution, it'll be part of the next version of this plugin
Title: Re: Shopping cart
Post by: julala on October 24, 2006, 05:14:12 pm
I tried reverting to classic theme to see if the afore mentioned wobbly was restricted to my own theme and the problem remained.

Still investigating.

Title: Re: Shopping cart
Post by: Stramm on October 24, 2006, 06:09:55 pm
other mods/ plugins running??
can you dump your photo_shop mysql tables and attach them to your next post?
Title: Re: Shopping cart
Post by: julala on October 24, 2006, 06:37:53 pm
cpg 148

Plugins:

Onlinestats v1.2
CPG miniCMS v1.5
CPG MassImport v2.0
Photo Shop v1.3

Mods:

mod pack for 1.4.5 with bridge support (plus extra blacklisting and blocking features done by you - see post http://forum.coppermine-gallery.net/index.php?topic=31392.msg145323#msg145323 (http://forum.coppermine-gallery.net/index.php?topic=31392.msg145323#msg145323))

Nibblers category theme manager


SQL dumps:
Code: [Select]
--
-- Table structure for table `cpg_shop`
--

CREATE TABLE `cpg_shop` (
  `id` int(11) NOT NULL auto_increment,
  `oid` int(11) NOT NULL default '0',
  `uid` int(11) NOT NULL default '0',
  `pid` int(11) NOT NULL default '0',
  `cd` tinyint(2) NOT NULL default '0',
  `quantity` int(11) NOT NULL default '0',
  `size` varchar(40) NOT NULL default '0',
  `price` decimal(9,2) NOT NULL default '0.00',
  `otime` int(11) NOT NULL default '0',
  `status` tinyint(2) NOT NULL default '0',
  `aktive` tinyint(2) NOT NULL default '0',
  PRIMARY KEY  (`id`,`oid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=709 ;

Code: [Select]
--
-- Table structure for table `cpg_shop_config`
--

CREATE TABLE `cpg_shop_config` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(40) NOT NULL default '0',
  `name` varchar(40) NOT NULL default '0',
  `price` decimal(9,2) NOT NULL default '0.00',
  `max_items` varchar(40) NOT NULL default '0',
  `priority` int(5) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=38 ;

Code: [Select]
--
-- Table structure for table `cpg_shop_prices`
--

CREATE TABLE `cpg_shop_prices` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) NOT NULL default '0',
  `gid` int(11) NOT NULL default '0',
  `price` decimal(9,2) NOT NULL default '0.00',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Title: Re: Shopping cart
Post by: Stramm on October 24, 2006, 07:22:43 pm
have you tried disabling all plugins except the shop? I'd need the dumps incl. data, not only the structure, for testing
Title: Re: Shopping cart
Post by: julala on October 24, 2006, 07:50:42 pm
Yes I have tried disabling the other plugins and no difference.

Weirdly the wobbly occurred almost at a random moment.  I upgraded th plugin, it was fine for a day or so and then suddenly when I was moving some active orders to the archive the wobbly occurred and has remained thre ever since.


I have linked to sql dumps as they are too large to put here.

SQL dumps here as zip file (http://www.smileonthetiles.com/straam/sqldumpsforps13.zip)

[edit GauGau]Added hotlinked sql file as attachment.[/edit]
Title: Re: Shopping cart
Post by: Stramm on October 24, 2006, 08:06:04 pm
Okies, with your dumps I have the same probs as you. Will check into that the next days
Title: Re: Shopping cart
Post by: julala on October 24, 2006, 08:12:01 pm
Cool.  Thank you v much. x
Title: Re: Shopping cart
Post by: Stramm on October 25, 2006, 12:03:38 pm
fixed
Title: Re: Shopping cart
Post by: julala on October 25, 2006, 02:03:50 pm
Yay!  Works great again!  Many thanks Straam!   ;D

Title: Re: Shopping cart
Post by: mikyma on October 25, 2006, 10:28:55 pm
Hallo again

when use with bridge (joomla mehdi) the user e-mail and name isn't shown in admin panel.
The user id is shown correct and the e-mail notification (user and admin) is sent correctly too
Any idear ?

I took a look into the code but i don't see anything

Greets Michael
 
Title: Re: Shopping cart
Post by: Stramm on October 26, 2006, 09:33:51 am
I've tested the shop bridged to phpbb and smf. That's bridge files that come with Coppermine. Joomla I do not use so I can't tell you much. And cause it's using a user contributed bridge file (at least I think so) it's even harder to suggest something useful.

Do you use the latest version?? If that doesn't help, then you probably need to hardcode the table names and remove the class definition. If that works neither you'll have to run two queries instead of a join
Title: Re: Shopping cart
Post by: mikyma on October 26, 2006, 12:25:56 pm
Ok,thank you

I'll try to do so and post results  ;)

Greets Michael


Title: joomla bridging
Post by: mikyma on October 28, 2006, 06:01:59 pm
Hallo

Now  i have fixed the prob with the user name and e-mail in photo_shop_admin.php
when bridged with joomla! (Photo_shop vers.: 1.3)
 
This works only if the original Joomla Mysql-Tablenames are used,without prefix.
I have attached a comment at the changed codelines.

just replace photo_shop_admin.php with attached file (rename it into photo_shop_admin.php)


 
Title: joomla bridging
Post by: mikyma on October 28, 2006, 06:48:30 pm
Another problem when bridget to joomla is the
reload when ad a photo to basket:

The photo wil be added but the count inside the baket button is not increased.
when adding a pic the browser doesnt return to that pic.

I think i have to change codebase.php
Code: [Select]
<form action="{$REFERER}" method="post">
  {$added}{$lang_photoshop['buy']} {$html}
<input type="hidden" value="{$pic_data['pid']}" name="pid" />
<input type="hidden" value="add_item" name="event" />
    <input type="submit" value="{$lang_photoshop['send']}" class="comment_button" />
</form>

or / and the
function
photo _shop_refresh

Greets Michael
Title: Re: Shopping cart
Post by: germinus on November 12, 2006, 08:54:42 am
I have installed this but now all my images show the dreaded red x?
Title: Re: Shopping cart
Post by: mikyma on November 12, 2006, 02:20:33 pm
@germinus

you have to copy the images in photoshop plugin folder to your themes images folder i think.

Greets
Title: Re: Shopping cart
Post by: Stramm on November 13, 2006, 07:00:43 pm
no, no need to copy the pics into the plugins folder.

If it something doesn't work, post a link
Title: Re: Shopping cart
Post by: zac on November 15, 2006, 04:01:27 am
Hiya.. I probably already said this but fantastic contribution Stramm!  All of your stuff is great.  ANyways.. this is a quesiton about styling.  The # of images in cart and checkout button are currently styled within the admin_menu a.link style.  WHere can I find this in the code to put it into another div?
Title: Re: Shopping cart
Post by: Stramm on November 15, 2006, 07:35:16 am
you can edit that in the function photoshop_user_menu, codebase.php
Title: Re: Shopping cart
Post by: Sam Lantz on November 19, 2006, 11:54:33 pm
Photo Shop version: 1.3.1  is an awesome script, however I found two bugs, one is I can’t add an image to the shop from the search result form. And if the total sum in basket is over a 1000 it only shows 1.00  :)

Regards Sam
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 05:14:55 am
I have downloaded and installed photo shop 1.3.1
I finally enabled PayPal, but I'm most interested in the album settings to turn on/off pricing and set pricing for individual albums. I read in a previous post that this feature was added, but I can not find it my admin screen, config screen or shop screen. Should I udpate a php file first?

I am running CPG 1.4.10
www dot videocp dot org dot coppermine is the website.

Thanks in advance.
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 07:55:03 am
in the admin menu click 'shop', open now the shop config (top table header to the right side 'config'), now have a look below the main config, below the two submit buttons, there you'll see: Per Album Settings - Coppermine Photo Gallery 1.4.10 modpack v1 (stable)

select an album in the dropdown, the page reloads and you can chose new prices for that album or if the shop is visible for that album
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 07:56:42 am
Photo Shop version: 1.3.1  is an awesome script, however I found two bugs, one is I can’t add an image to the shop from the search result form. And if the total sum in basket is over a 1000 it only shows 1.00  :)

Regards Sam


first is known
second... I'll have to check

thanks
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 08:04:38 am
And if the total sum in basket is over a 1000 it only shows 1.00

confirmed, lil glitch
fix: open shop plugin dir include/functions.inc.php, find
Code: [Select]
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
$shipping = number_format(($SHOP_CONFIG['ship']),2);
$tot_price = number_format(($cd_price+$photo_price+$SHOP_CONFIG['ship']),2);

replace with
Code: [Select]
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$SHOP_CONFIG['ship']),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
$shipping = number_format(($SHOP_CONFIG['ship']),2);
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 11:46:34 am
in the admin menu click 'shop', open now the shop config (top table header to the right side 'config'), now have a look below the main config, below the two submit buttons, there you'll see: Per Album Settings - Coppermine Photo Gallery 1.4.10 modpack v1 (stable)

select an album in the dropdown, the page reloads and you can chose new prices for that album or if the shop is visible for that album

Thanks, I just did not look hard enough. One more thing. After I select an album and the screen refresh, I get the following error just above the Per Album Settings section
Warning: Invalid argument supplied for foreach() in 'web site'\plugins\photo_shop\photo_shop_config.php on line 201

Any thoughts? Thanks again for your support. I am really looking forward to putting this plugin to use.
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 12:42:33 pm
hmm.. seems to be a cookie hickup, try clearing the cookie
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 12:59:24 pm
hmm.. seems to be a cookie hickup, try clearing the cookie

I closed all browsers and deleted cookies and temp files (via control panel Internet Options icon). When I open CPG, login as admin, go to shop I get the following at the top also.

Warning: Division by zero in 'website'\plugins\photo_shop\photo_shop_admin.php on line 230

Warning: Division by zero in 'website'\plugins\photo_shop\photo_shop_admin.php on line 231
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 01:11:43 pm
something's messed up...

some data in the shop table is missing. If you don't have any sensible data already (if you're just testing the shop), then empty the shop table (CPG_shop). If there's already data in it you need, then we have to look what data exactly causes the troubles
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 01:19:49 pm
something's messed up...

some data in the shop table is missing. If you don't have any sensible data already (if you're just testing the shop), then empty the shop table (CPG_shop). If there's already data in it you need, then we have to look what data exactly causes the troubles

I have deleted all data in shop table and verified that temp_data, and config are empty also. I have turned off the shopping cart my albums at this time (individually). But I was getting the error for that.

Also, I would like to add a new type (DVD) to the shopping cart but can not figure it out. Perhaps this has been posted already, the thread(s) are long for me I guess.
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 01:57:45 pm
can you dump your shop tables and attach them to your next post???
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 02:30:15 pm
can you dump your shop tables and attach them to your next post???

Hope this helps.
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 02:51:11 pm
after a quick check I see that all the data in the table prices is invalid...

empty that table and restart (but don't ask me how you succeded to do that, I have no clue at all ;) )


also set the default prices to some value > 0  like USD 5.00. That price gets displayed if you don't set an exception for a specific album.
Title: Re: Shopping cart
Post by: videocp on November 20, 2006, 03:25:34 pm
after a quick check I see that all the data in the table prices is invalid...

empty that table and restart (but don't ask me how you succeded to do that, I have no clue at all ;) )


also set the default prices it to some value > 0  like USD 5.00. That price gets displayed if you don't set an exception for a specific album.


Thanks, I make the changes to the price in prices table.

Your last statement says that price will be shown if I do not set the exception for the album. Are your referring to a situation where I can select from the list of  and offer only selected pricing for a picture, or will the complete list be shown for each picture?


OK, I updated the price table with 5.00 and I still have the problem. I have attached the table again for our review. Thanks again.
Title: Re: Shopping cart
Post by: Stramm on November 20, 2006, 03:32:04 pm
the complete list will be shown... always. If you define an exception it gets displayed in red in the admin (so you know you fiddled with it). The exception just overrides the standard.

You can disable displaying the shop for certain albums though (in the per album settings too)
Title: Re: Shopping cart
Post by: Sam Lantz on November 24, 2006, 08:28:07 am
confirmed, lil glitch
fix: open shop plugin dir include/functions.inc.php, find
Code: [Select]
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
$shipping = number_format(($SHOP_CONFIG['ship']),2);
$tot_price = number_format(($cd_price+$photo_price+$SHOP_CONFIG['ship']),2);

replace with
Code: [Select]
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$SHOP_CONFIG['ship']),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
$shipping = number_format(($SHOP_CONFIG['ship']),2);

Thanks Stramm, now it works perfect.
About the other problem, I discovered that final extract doesn’t work properly on the search page neither; maybe the bug is on the search page and not in your script.

Regards Sam
Title: Re: Shopping cart
Post by: zac on November 27, 2006, 11:21:38 pm
I have another styling question.... How would one go about moving the drop down price menu that defaults directly above the image?   Thanks in advance.
Title: Re: Shopping cart
Post by: Stramm on November 28, 2006, 09:35:06 am
Without much code changes... you can move it below the image (if that's what you want)
Title: Re: Shopping cart
Post by: zac on November 29, 2006, 08:45:28 pm
yea that is what i am looking to do
Title: Re: Shopping cart
Post by: Stramm on December 01, 2006, 07:50:03 am
open codebase.php (the one in plugins/photo_shop) and find
Code: [Select]
$pic_data['html'] = $shop_data.$pic_data['html'];replace it with
Code: [Select]
$pic_data['html'] = $pic_data['html'].$shop_data;
Title: Re: Shopping cart
Post by: zac on December 01, 2006, 10:38:47 pm
great!  thanks!!
Title: Re: Shopping cart
Post by: mpwmedia on December 05, 2006, 08:47:39 pm
Novice user here, so please be gentle....

Firstly, thanks for the superb plugin.

I want to change the currency from the default USD to GBP. I assume I do this via either "photo_shop_config.php" or "photo_shop_admin.php" but each time I log onto these files through my browser, I get the error message:

"Not in Coppermine..."

Hope someone can help.

Thanks,

Mark
Title: Re: Shopping cart
Post by: Stramm on December 05, 2006, 09:31:31 pm
open the language file (plugins/photo_shop/lang/your_lang.php) and replace all occurances of USD with GBP
Title: Re: Shopping cart
Post by: bpatto on December 12, 2006, 07:06:08 am
Thanks for the great mod, been looking forward to it.

When I install the plugin, it installs without error, but when I go to 'Shop', 'Config' it does not display any items.  And when I try to 'create new item' it displays a critical error 'There was an error while processing a database query'.

Let me know what info you need from me to assist.
Title: Re: Shopping cart
Post by: Joachim Müller on December 12, 2006, 07:22:58 am
Turn debug_mode on, then post the actual error message (the query that fails, not the debug_output)
Title: Re: Shopping cart
Post by: bpatto on December 12, 2006, 07:26:33 am
This is the output from the debug.

While executing query "INSERT INTO cpg1410_shop_config (priority) VALUES ('')" on 0

mySQL error: Out of range value adjusted for column 'priority' at row 1
Title: Re: Shopping cart
Post by: Stramm on December 12, 2006, 09:25:09 pm
http://forum.coppermine-gallery.net/index.php?topic=39212.0
Title: Re: Shopping cart
Post by: bpatto on December 12, 2006, 10:23:31 pm
Thanks Stramm, problem solved. ;D
Title: Register first before seeing the photo-shop buttons?
Post by: Riser on December 14, 2006, 10:25:01 pm
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
Title: Re: Shopping cart
Post by: Stramm on December 15, 2006, 12:42:18 pm
codebase.php... after
Code: [Select]
function photoshop_add_item($pic_data){
global $CONFIG, $SHOP_CONFIG, $lang_photoshop;

$html = "";
$added = "";
$event = isset($_POST['event']) ? $_POST['event'] : null;
add
Code: [Select]
if(!USER_ID) return $pic_data;
after
Code: [Select]
function photoshop_user_menu(&$html){
    global $template_sys_menu_spacer, $lang_photoshop;
add
Code: [Select]
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
Title: Re: Shopping cart
Post by: Riser on December 15, 2006, 12:51:33 pm
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
Title: Re: Shopping cart
Post by: Riser on December 15, 2006, 06:16:45 pm
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
Title: Re: Shopping cart
Post by: CGPhotos on December 18, 2006, 05:28:27 pm
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?
Title: Re: Shopping cart
Post by: Stramm on December 18, 2006, 06:11:03 pm
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
Title: Re: Shopping cart
Post by: CGPhotos on December 19, 2006, 01:24:07 am
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?
Title: Re: Shopping cart
Post by: Stramm on December 19, 2006, 01:23:45 pm
PM me a link and an admin account login please
Title: Re: Shopping cart
Post by: Stramm on December 19, 2006, 04:08:35 pm
you need to have the plugin installed
Title: Re: Shopping cart
Post by: CGPhotos on December 19, 2006, 04:28:07 pm
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?
Title: Re: Shopping cart
Post by: Stramm on December 19, 2006, 04:37:14 pm
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.
Title: Re: Shopping cart
Post by: CGPhotos on December 19, 2006, 04:58:52 pm
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.
Title: Re: Shopping cart
Post by: zac on December 29, 2006, 09:46:06 pm
 ??? help..  I am now getting a
Quote
error 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:

 
Code: [Select]
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

Code: [Select]
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

Code: [Select]
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

Code: [Select]
/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.
Title: Re: Shopping cart
Post by: Stramm on December 29, 2006, 10:54:18 pm
try to clear your cookies
Title: Re: Shopping cart
Post by: zac on December 30, 2006, 12:52:15 am
 :-[ err.. umm.. oops.. guess you didnt need that debug info.  Sorry about that and thanks Stramm.
Title: Re: Shopping cart
Post by: chican0 on January 14, 2007, 05:22:16 am
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.
Title: Re: Shopping cart
Post by: Stramm on January 14, 2007, 08:51:24 am
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.
Title: Re: Shopping cart
Post by: chican0 on January 14, 2007, 08:24:52 pm
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.
Title: Re: Shopping cart
Post by: colin911 on January 15, 2007, 09:57:23 pm
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?
Title: Re: Shopping cart
Post by: Nibbler on January 15, 2007, 10:12:56 pm
Enable debug mode in config and post the mysql error message you get (not the entire debug output) when you replicate the error.
Title: Re: Shopping cart
Post by: colin911 on January 15, 2007, 10:17:05 pm
Here is what i got:

Quote
There was an error while processing a database query.

While executing query "SELECT * FROM cpg1410_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

File: /home/content/b/v/i/bviguides/html/Domains/Surfpic/coppermine/include/functions.inc.php - Line: 248

Under "notices" I got:

Quote
plugins/photo_shop/codebase.php
Notice line 187: Undefined index: photo
Notice line 191: Undefined index: cd
/plugins/photo_shop/include/functions.inc.php
Notice line 79: Undefined index: photo
/plugins/photo_shop/photo_shop_cart.php
Notice line 24: Undefined index: cd
Notice line 165: Undefined index: aid
/include/media.functions.inc.php
Notice line 56: Undefined index:
/include/functions.inc.php
Notice line 1995: Undefined index: url_prefix
Notice line 1995: Undefined index:
Notice line 1995: Undefined index: filepath
Notice line 1996: Undefined index: filename

Is this what you needed?
Title: Re: Shopping cart
Post by: affeee on January 16, 2007, 03:23:36 pm
Another great mod /plugin from Straam  ;D

One small thing.  When there is no CD option for buyers to purchase, for example you only offer photo prints - there seems to be a totals calculation error.

Screen shot:

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.smileonthetiles.com%2Fimages%2Fphoto_shop_bug.jpg&hash=7d8fc5c5caa57cd620f8db6b74031a79)

Notice that the individual price of the photo is 4.49 but the total shows 4.00.  Interestingly if I do add a CD purchase option in the config this error does not occur at all.

http://www.smileonthetiles.com (http://www.smileonthetiles.com)

Test account:

username: testuser
password: test123




I have the exactly same problem here. I am running latest version of photoshop.

See attached image

I noticed that when total price is over 1000.00 this problem occurs.
Title: Re: Shopping cart
Post by: Stramm on January 16, 2007, 04:09:26 pm
Here is what i got:

Under "notices" I got:

Is this what you needed?

try again clearing your cookies. It's a known problem and I'll adding a check in the next version.
Title: Re: Shopping cart
Post by: Stramm on January 16, 2007, 04:11:11 pm
I have the exactly same problem here. I am running latest version of photoshop.

See attached image

I noticed that when total price is over 1000.00 this problem occurs.

download again version 1.3.1 and replace your existing files. This problem has been fixed. If that doesn't help.... post a link please
Title: Re: Shopping cart
Post by: colin911 on January 16, 2007, 05:10:13 pm
Stramm, Strange, all of a suddeen everything is fine, without deleting more cookies.  Any way it's working.  Thanks.

Another question:  is there any way that through the admin of the shopping cart i would be able to see which member uploaded the photo? The idea is to have multiple photographers upload images then pay them a comission when the photo sells.
Title: Re: Shopping cart
Post by: Stramm on January 16, 2007, 05:26:34 pm
easy, in photo_shop_admin.php find
Code: [Select]
{$lang_photoshop_admin['size']}: {$size[$k]}<br />below add
Code: [Select]
<span style="float:right;" class="smallfont">Pic owner: <a href="profile.php?uid={$row_pic['owner_id']}">{$row_pic['owner_name']}</a></span>

find
Code: [Select]
$select_columns = 'filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, title';replace with
Code: [Select]
$select_columns = 'filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, title, owner_name, owner_id';
Title: Re: Shopping cart
Post by: colin911 on January 16, 2007, 10:56:46 pm
Thanks stramm, this is good, but can we put the info for each photographer on the main admin page for the cart?  IE, the pic owner is showing if you click for the details of the order but I was hoping to get it to show where all the orders are listed.  More importantly, I'd like itt to show up in the archives section too since i will be doing the accounting and commissions calculations after processing the order.

Many thanks for your great support on this.  You have lots of patience I can tell.  :-)
Title: Re: Shopping cart
Post by: Jeremy Rasmussen on January 17, 2007, 06:52:54 am
Maybe someone can help... I've scanned through the thread to see if i could find anyone with the same problem, if I missed it please let me know.

Anyway when ever an item is added to the cart or when changes are saved in the config section of the shop the browser doesn't redirect to the last page it was on.  However I tested it using the classic theme and I don't have this problem. Are there any suggestions on where to start looking to fix this problem?  I am using a custom made theme and it is possible that some code was inadvertently left out.

thanks for the help and as always great job Stramm!
Title: Re: Shopping cart
Post by: affeee on January 17, 2007, 08:34:42 am
download again version 1.3.1 and replace your existing files. This problem has been fixed. If that doesn't help.... post a link please

Done that, but i still cannot get it to work... Here is a link:

http://www.mbfoto.se/dam/

Title: Re: Shopping cart
Post by: Stramm on January 17, 2007, 09:52:16 am
you're right, I had forgotten to upload the version 1.3.2... my bad, now 1.3.3 is up
Title: Re: Shopping cart
Post by: affeee on January 17, 2007, 09:57:39 am
you're right, I had forgotten to upload the version 1.3.2... my bad, now 1.3.3 is up

Thx Stramm! Now it works great. You rock!
Title: Re: Shopping cart
Post by: angeldevil on January 22, 2007, 04:17:49 pm
Hi Stramm!

I've translated your  Shopping cart plugin in italian language.

I have made some modifications for italian users and italian site use only.

(I've modified a language file only)

USD ---> Euro

account ---> numero carta (card number)
routing  ---> scadenza carta gg.mm.aa. (expiration date dd.mm.yy)
swifth   ---> codice di controllo (check code - last 3 numbers in the back side of card)

like in italian system card payment.



Per gli utenti Italiani (for Italian users): le modifiche che ho apportato riguardano esclusivamente la valuta e i dati da inserire per effettuare la transazione con carta di credito. Vengono qui utilizzati i dati standard del nostro paese al posto di quelli internazionali come previsto nel MOD di Stramm

****************************************************************************************

Last added: italian language for international site (not italian site) use

Title: Re: Shopping cart
Post by: Stramm on January 22, 2007, 04:39:00 pm
Thanks, I've added your lang file to my archive. It'll be included in the next update (photo shop ver. > 1.3.3)
Title: Re: Shopping cart
Post by: angeldevil on January 22, 2007, 04:48:39 pm
Many thanks Stramm!
Title: Re: Shopping cart
Post by: shayphoto on January 26, 2007, 06:29:57 pm
Can I change all references from "CD" to "Other". This would, I think, allow me to offer picture packages containing different photos (rather than duplicates as can be done through the price list) or CD's - only the description would need to be changed.

i.e. CD - 25 photographs
Package 1 - (3) 4x6s of different photos

In which files would I change the references, if this would work?

Thanks
Title: Re: Shopping cart
Post by: Stramm on January 26, 2007, 07:11:05 pm
Should be enough to change that in the lang file. If it's still named 'CD' in the admin shouldn't matter at all (as long as the user won't see it).

so just find everything containing CD in the shop's lang file(s) plugins/photo_shop/lang/yourlang.php and modify it to your needs, eg.

change
Code: [Select]
  'CD' => 'Add to CD',to
Code: [Select]
  'CD' => 'Add to other',
Title: Re: Shopping cart
Post by: shayphoto on January 27, 2007, 09:34:46 pm
Thanks Stramm. I am still testing the plugin but will implement your suggestion when I can.

However, a strange problem is occurring when I try ordering prints as either a user or admin, but only with one or two of my image files.

In my test album (weddings), I choose the first image in the album, pick the 4x6 size print, click add then move on to the next print and do the same for the first four prints...always choosing the 4x6 print size. When I click on either the images in cart or checkout buttons, the first file displays with more than one print ordered. Some of the other files do not show up.

Yesterday,I deleted my original install of CPG 1.4.10 and the plugin Photo_Shop ver 1.3.3 and the image files. I also removed the database. Also cleared all cookies.

Today, I did a fresh install of CPG 1.4.10 and Photo_shop plugin. I am using the classic theme. I have only made modifications within Coppermine itself (site name, preferences, etc. - no changes in any files) and the Plugin (set up pricing for the prints). I copied Images from the archive to the Classic themes Images directory. Everything seems to be working except I can reproduce the same issue with the 4x6 prints. It also occurs when choosing the 5x7 prints and the 8x10 prints.

This only seems to happen with the first two prints in the gallery. I have deleted them and reinstalled them but get the same issue.

The installation of CPG with the plugin is at: www.shayphoto.ca/cpg1410

Any thoughts??
Title: Re: Shopping cart
Post by: Photocumbria on January 28, 2007, 04:17:51 am
Hi Stramm,

Thanks for the plugin it works a treat!

Would it be possible to add a couple of buttons to the page where you "confirm your order". This would be to add extra shipping costs to the order.

For example (I'm in the UK) so postage to the UK is auto added, but if the client is in europe they could click to add that extra shipping, or if they where international they click another button to add that particular shipping cost.

Thanks in advance.:)
Title: Re: Shopping cart
Post by: Stramm on January 28, 2007, 12:16:50 pm
However, a strange problem is occurring when I try ordering prints as either a user or admin, but only with one or two of my image files.

Indeed, really weird. I tried to replicate it on my loacl install with no success. But I've seen what you mean. The third pic in the mentioned album gets added to pic_id 1 if another pic is already in the cart. And that if the sort order is by filename. By date it acted normal.

Without the possibility to test a few things I only can guess. Find in codebase.php (in photo_shop plugin directory)
Code: [Select]
       else if(photoshop_deep_in_array($value, $value2, $item)) return true;and comment that line out
Code: [Select]
       //else if(photoshop_deep_in_array($value, $value2, $item)) return true;
please tell me if that helped
Title: Re: Shopping cart
Post by: shayphoto on January 28, 2007, 04:23:47 pm
Stramm

Have commented out the line as you suggested. Does not seem to help - same issue.

I have left the line commented out if you have time to give it a try.

Unfortunately I am totally unfamiliar with any type of coding so can't be of much help. If there is a way to let you test out a few things, let me know.

Thanks for your time.
Title: Re: Shopping cart
Post by: shayphoto on January 28, 2007, 05:00:23 pm
Stramm

I have uploaded a second album for testing. It does not appear to have the same issue as the one in weddings.

Thanks

P.S. I'll leave everything alone (codebase.php has line commented out as suggested) until you have a look.
Title: Re: Shopping cart
Post by: Photocumbria on January 29, 2007, 01:00:49 pm
I've tried adding 3 different levels of shipping cost for each of "Inland Uk", "European" and "International", with the intention of putting a dropdown shipping choice t the cart.

At the moment, when ordering a photo the mod picks the highest postage (or the last on the config list) and adds that and I cant seem to add the dropdown to the cart area so that clients can order which shipping they want before confirming. I'm assuming I need to add $shop_data to the checkout php but so far I'm having no luck.

Any help?

Title: Re: Shopping cart
Post by: Stramm on January 29, 2007, 01:03:17 pm
Stramm

I have uploaded a second album for testing. It does not appear to have the same issue as the one in weddings.

Thanks

P.S. I'll leave everything alone (codebase.php has line commented out as suggested) until you have a look.

No luck for me to reproduce that behaviour. Maybe you can make a db dump and send it to me??
Title: Re: Shopping cart
Post by: Stramm on January 29, 2007, 01:07:08 pm
I've tried adding 3 different levels of shipping cost for each of "Inland Uk", "European" and "International", with the intention of putting a dropdown shipping choice t the cart.

At the moment, when ordering a photo the mod picks the highest postage (or the last on the config list) and adds that and I cant seem to add the dropdown to the cart area so that clients can order which shipping they want before confirming. I'm assuming I need to add $shop_data to the checkout php but so far I'm having no luck.

Any help?



Yup, no support for different shipping levels so far. Simple solution would be to use paypal for that. Means you have to edit the paypal buy now button form. And not add the shopping cart shipping but your dropdown
Title: Re: Shopping cart
Post by: Photocumbria on January 29, 2007, 01:17:02 pm
Thanks Stramm for the reply, have you any plans to add a shipping choice to future versions of this plugin? As far as I can see, its the only thing missing from a great mod. And if its going to be added to a future release I will just wait for it and put my site temporarily on hold.

Thanks again!
Title: Re: Shopping cart
Post by: Stramm on January 29, 2007, 01:21:54 pm
I don't know... I'm pretty busy atm (offline) and therefore didn't do much programming lately. I know that another shipping solution would be smooth. Unfortunately it wasn't planned from the beginning. With all the new gimmicks added it'll be best to rewrite the plugin
Title: Re: Shopping cart
Post by: Photocumbria on January 29, 2007, 02:39:25 pm
Stramm, I'm going to have a play at creating a new dropdown with shipping options, see if I can somehow do this by c+p'ing your code, I've had success doing this in the past as I'm not a php writer.

To limit my search for the code I'll need can you let me know which of the php files I'll need to look through, so that I dont start looking in the wrong files.

Again, thanks a lot for the help and plugin
Title: Re: Shopping cart
Post by: Stramm on January 29, 2007, 03:14:48 pm
Not really sure what you're looking for...

the paypal code is in photo_shop_checkout.php
basically that's all you need. Just replace
Code: [Select]
<input type="hidden" name="shipping" value="{$shipping_price}">with something like
Code: [Select]
<select name="shipping">
<option value="4.00">GB</option>
<option value="8.00">Europe</option>
<option value="13.50">World</option>
</select>

Title: Re: Shopping cart
Post by: Photocumbria on January 29, 2007, 04:37:11 pm
Stramm....Superb!! I owe you a beer.;)
Title: Re: Shopping cart
Post by: shayphoto on January 30, 2007, 04:43:59 am
No luck for me to reproduce that behaviour. Maybe you can make a db dump and send it to me??

Went to make a db dump for you this AM and the database is missing - it no loner seems to exists. I'm waiting to hear from my ISP. Perhaps it was corrupted from its inception.

Anyway, will set up another database and if the same issue occurs I'll let you know,make a db dump, and send it to you.

Thanks again for your time. Your cart is perfect for my purposes.
Title: Re: Shopping cart
Post by: ermige on January 30, 2007, 02:01:22 pm
I can not see "# of items in cart" or "checkout" buttons after adding photos to my cart.  My only theory is that I am not displaying a sys_menu in my customized theme and the buttons are placed in the menu or in relation to it.  Could that be the issue,  if so how can I move the location of these two buttons.

Thanks!!!
Title: Re: Shopping cart
Post by: Stramm on January 30, 2007, 06:21:59 pm
if you're not using the sub menu, then a feature since version 1.1 may be from use for you (from the 1st post of this thread:)

Quote
New version (1.1 uploaded on 08/09/2006)
 - added shipping costs
 - added support for a tag in template.html {CART_MENU}, either add that to your template or the cart will be inserted after the sub menu
- fixed all known bugs
Title: Re: Shopping cart
Post by: ermige on January 30, 2007, 07:29:00 pm
Stramm,
got it set up perfectly now!  Thanks so much for the great plug-in, and all your help.
Title: Re: Shopping cart
Post by: affeee on January 31, 2007, 01:29:57 pm
Hi

Is it possible to add placeholders so you can include a copy of the order in the confirmation mail sent to the customer?
Title: Re: Shopping cart
Post by: Stramm on January 31, 2007, 01:44:42 pm
same as above... needs to be coded. Not difficult but more work than the last modification
Title: Re: Shopping cart
Post by: shayphoto on January 31, 2007, 02:32:39 pm
No luck for me to reproduce that behaviour. Maybe you can make a db dump and send it to me??

Stramm

Attached is a dump of a database (in .txt format) exhibiting the same problem. (The db is no longer installed.)

I thought I had posted a reply yesterday indicating it may be the order in which the new install of Coppermine and Photo_shop occurred however it is not.

I have installed at least five clean installs and all have the same problem with the first few files uploaded. I also tried different photos in case those files may have been corrupted.

Thanks again for your time.
Title: Re: Shopping cart
Post by: affeee on January 31, 2007, 07:22:08 pm
same as above... needs to be coded. Not difficult but more work than the last modification

Ok... could you just point me in the right direction?... Please  ;D
Title: Re: Shopping cart
Post by: Stramm on February 01, 2007, 12:01:25 am
ahh.. sorry, that was in a different thread. I got confused :)
http://forum.coppermine-gallery.net/index.php?topic=40728.0
Title: Re: Shopping cart
Post by: wuschel_lux on February 03, 2007, 07:06:09 pm
Hi Stramm,

thanks for this great plugin.

It works realy fine, but I have a problem, when I try too download as ZIP an order in the Shopping cart Admin area.
I got an error message, that the ZIP archive is corrupt. The same problem occures when I try to download 'my favorites'.

Here a screenshot:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.volleyball.lu%2Ffotogallery%2Falbums%2Fuserpics%2F10001%2Fnormal_zip_PB.jpg&hash=433a3a394556c78a545ffb23e1fca22f)

Gallery is under:
http://www.volleyball.lu/fotogallery/

Server config:
zlib
ZLib Support    enabled
Compiled Version    1.2.2
Linked Version    1.2.2

Directive   Local Value   Master Value
zlib.output_compression   Off   Off
zlib.output_compression_level   -1   -1
zlib.output_handler   no value   no value

Best regards,
Francis
Title: Re: Shopping cart
Post by: Stramm on February 03, 2007, 09:32:33 pm
that 'problem' not related to the plugin cause it uses the coppermine zip class. That's what you recognized too, fav download doesn't work as well.

Reason for that usually is no enough (php) memory. Default is 8mb. If you have more pics, php can't hold them in mem and zip them. Result is a damaged zip file.
Title: Re: Shopping cart
Post by: wuschel_lux on February 05, 2007, 05:34:01 pm
that 'problem' not related to the plugin cause it uses the coppermine zip class. That's what you recognized too, fav download doesn't work as well.

Reason for that usually is no enough (php) memory. Default is 8mb. If you have more pics, php can't hold them in mem and zip them. Result is a damaged zip file.

Hi Stramm,

Thanks for the reply. I found the problem. It wasn't a coppermine, or Shop problem. It was a ZIP included Windows XP SP2 problem. I installed now the WinRAR programme and from this time on it works perfect.

Regards
Title: Re: Shopping cart
Post by: foxxx on February 06, 2007, 02:12:48 pm
Hi,

How can I put the shopping select box on the thumbnails page?
I'd rather have it over there so visitors can easily click several photo's at the same time.

Anyone?

Regards,
Foxxx
Title: Re: Shopping cart
Post by: Stramm on February 06, 2007, 02:25:32 pm
that's not how it works -> you'll have to code that if you want to have this feature
Title: Re: Shopping cart
Post by: foxxx on February 06, 2007, 02:31:59 pm
Ok,

Thanks for your answer. I'm not much of a coder myself. If you can give me a nice price, I'am willing to pay for it

Regards,
Foxxx
Title: Re: Shopping cart
Post by: foxxx on February 07, 2007, 11:51:21 am
Hi Stramm,

I posted a question about the shop select box and button on the thumbnails page. You aswered that this only can be done by recoding. I was wondering if you can do this for me if it's not to much work. The select box on the imagepage can stay, this is in addition on that page.

I hope you can (and are aible to) help me, I looked into the source and I find it to difficult.

Regards,
foxxx
Title: Re: Shopping cart
Post by: pcp20us on February 08, 2007, 09:48:45 am
Hi All and cart man stramma.

I am using paypal on my website. On the photo_shop_checkout page. I want to remove the continue button down the bottom so it will not confuse the user on where to click

See example here
Title: Re: Shopping cart
Post by: Stramm on February 08, 2007, 08:19:04 pm
Hi All and cart man stramma.

I am using paypal on my website. On the photo_shop_checkout page. I want to remove the continue button down the bottom so it will not confuse the user on where to click

See example here

in photo_shop_checkout.php find
Code: [Select]
msg_box('', $msg_box_txt, $lang_continue, 'index.php');and comment it out
Title: Re: Shopping cart
Post by: Stramm on February 08, 2007, 08:20:41 pm
Hi Stramm,

I posted a question about the shop select box and button on the thumbnails page. You aswered that this only can be done by recoding. I was wondering if you can do this for me if it's not to much work. The select box on the imagepage can stay, this is in addition on that page.

I hope you can (and are aible to) help me, I looked into the source and I find it to difficult.

Regards,
foxxx

I'm pretty busy atm (offline) and that's why I'm at the computer only a few mins each day. That's just enough to answer some questions here but for sure not enough to do bigger modifications or new stuff
Title: Re: Shopping cart
Post by: pcp20us on February 08, 2007, 11:11:30 pm
Hi Stramm

Yep i thought that was was i needed to comment out , tried this yesterday and all you get is the checkout page and nothing else. ?? There are 2 lines with this code i tried commenting out both of them individual.
any other options.

Thanks

Pete


Title: Re: Shopping cart
Post by: Stramm on February 09, 2007, 07:35:06 pm
in the file mentioned it's only once... but shame upon my head, don't comment it out just change it to
Code: [Select]
msg_box('', $msg_box_txt, '', 'index.php');
Title: Re: Shopping cart
Post by: pcp20us on February 10, 2007, 11:08:53 am
Very Nice

Thanks stramm worked a treat.!!!
Title: Re: Shopping cart
Post by: pullbuoysteve on February 11, 2007, 01:36:00 pm
Stramm

Firstly let me say that the plugin is excellent and extremely easy to install.  I went from having no install of CPG to a fully operational cart with paypal integration in about 15 minutes. Thanks!

While testing everything out, I've found one small buggette (possibly - it may be my misunderstanding of the system!) - I've had a look on the board and can't find any other reference to it so apologies if it's been posted before.

On the admin screen and order view, the volume is shown as the sum of the unit costs of the photos added to the order rather than the order total - I think this may be because of a small error in photo_shop_checkout.php:

Code: [Select]
$picture_total = ($picture_total+$price);
might be supposed to be:

Code: [Select]
$picture_total = ($picture_total+$price*$amount);
which would then store the order total in the table.  However, while I've tried this and it seems to work fine I don't know if it will affect other functions in the plugin which I haven't explored, so probably best to wait for Stramm before changing this :) - elsewhere the order total is shown correctly, most importantly in the checkout itself; indeed everyone who has used the system has paid the correct amount!
Title: Re: Shopping cart
Post by: Stramm on February 12, 2007, 08:07:06 pm
yep, you found a lil glitch. Reason is a newly introduced feature (prices settable per album).
You're close with your fix :) but you'd have problems with the cd feature (when adding pics to a cd)

this bug only shows to the admin when he's viewing the order overview. No user will see wrong prices


move the line you edited above the bracket and all's smooth

Code: [Select]
}
$picture_total = ($picture_total+$price);
should be
Code: [Select]
$picture_total = ($picture_total+$price*$amount);
}

the main reason for that way to add the total to the db was to avoid extensive mysql queries when showing the overview. I thought the total is an important detail and should be shown.
Title: Re: Shopping cart
Post by: cdidic on February 13, 2007, 02:27:49 pm
Hi all,

Before i continue, let me thanks Stramm for this nice plugin. (that's done  ;D)

I have two question, is there a solution to automatically resize a picture in the good size  of the user choice? I mean if someone buy the same picture in 4x6 or 8x10, did i have to resize it manually before i send it to him ?

My second question, is there a solution to automatically send the zip file made bye the checkout to the email of the consumer when paypal receive the payment ?

Thanks for all the response :)

Title: Re: Shopping cart
Post by: Stramm on February 13, 2007, 03:44:12 pm
The purpose of that plugin is somehow different to what you expect.

Users add pics to the cart, order. You print these pics (or a printing service will do that for you) and you'll send the printed photos to your customer. So there's no need to resize pics. That's the print resolution. Instead of sending photos the user can order the pics on CD.
To make it easier for the webmaster he can download the ordered pics as zip and send the included pics to the printing service (or print them himself) without the need to search for these pics.

To automate the paypal order would mean to implement the paypal talkback feature. It's not 100% cheatprof. So I hesitate to add that as a feature. Webmasters won't check the orders anymore and rely on the system. With some spoofing however some user could order and fake the Paypal answer (that he's paid).

Search the board. I've told some other guy the basics of the paypal talkback.
Title: Re: Shopping cart
Post by: cdidic on February 13, 2007, 04:43:23 pm
Ok thanks for the response,

So one thing else, when you chose the same picture twice in different 'size' how can we have the information on witch size the customer needs?

I do it for a picture and in the zip file there are the same file twice ? could it be possible to show the information of the order some where?

It's only a question not a request for feature :)
Title: Re: Shopping cart
Post by: Stramm on February 13, 2007, 06:07:03 pm
That info is in the shop admin
Title: Re: Shopping cart
Post by: cdidic on February 14, 2007, 08:28:42 am
 :-[ Sorry i don't see that i can click on an order to have the detail, thanks a lot  :-*
Title: Re: Shopping cart
Post by: Coolapix on February 15, 2007, 09:52:50 pm
Hi Stramm  :)

Thank's a lot for sharing your plugin.

I can't imagine the hard job it was, to make it.

However, i have some questions about the plugin :

- It seems that, in the orders window, the signs and indicators for "paid / shipped" and "Unpaid / Unshipped" are inverted. I saw the "unpaid" icon and the "paid / shipped" indication together. I think that's not a big problem for someone who knows php and programming, but for me (who doesn't know that), it's very hard to find the source of the problem.

- In the Photo_shop_cart.php file, I removed the line <tr><td>{$lang_photoshop['size']}</td><td>{$row['pwidth']} x {$row['pheight']}</td></tr> because in the cart window, the dimensions indicated were those of the image uploaded int the cpg album (and not the original size), so it was strange to see a 750x500px photo to be ordered in 30x45 cm wide. It took me at least 2 hours to find the "problem", but i'm happy to have solved it  ;D

- Is it easily possible (i don't think so but....) to have more than 3 "categories" of products ("photos", "CD", and "Shipping") ?


Think i'll stop for now  ;)

And last, excuse my poor english  :)
Title: Re: Shopping cart
Post by: Stramm on February 15, 2007, 10:42:04 pm
1. it displays correctly
2. on purpose... the uploaded file dimensions don't matter for the print resolution. That's what the user orders
3. you're right
Title: Re: Shopping cart
Post by: Jarrod on February 17, 2007, 02:31:33 am
Stramm, I've thought of yet ANOTHER reason why the further integration of paypal would be a good idea.
Imagine people wanting to buy a picture they like.
If they aren't registered on the site they first have to register.
After that, they have to pay.
If they haven't got a paypal account they'll either have to register a new one (entering all their details again) or use a credit card.
Either way they'll have to choose a delivery address.

If this delivery address is emailed to the webmaster/shop owner then surely it isn't necessary for them to register.

Additional:
If someone accidentally closes their browser before paying, there is no link to payment anymore.
Could the return address from a successful paypal payment take you to a page that empties the "cart" from your cookies, rather than the cart being empited as soon as you press "confirm order". This would be more helpful to customers AND webmasters as it would mean that all orders that go in the database have already been paid for (theoretically - although you mentioned above that someone could fake a cookie, the webmaster would not have been emailed from paypal).

I apologise if my post contains too many suggestions/ideas. I thought it best to type them out before I forgot them
Title: Re: Shopping cart
Post by: Jarrod on February 17, 2007, 12:12:03 pm
I forgot to mention, Stramm.
I have succesfully implemented a multiple packaging type alteration to this plugin.
Would you like me to tidy it up and send you a copy?
Title: Re: Shopping cart
Post by: kiwibloke on February 19, 2007, 05:14:32 pm
Hi,

Great plug-in... but having problems with clearing the cart.

Basically, I have no items in the cart yet it says I have 6 items. I have deleted then reloaded the plug-in and still teh same.

I have deleted cookies... and still the same.
I have deleted the database and re-created ... and still the same...

What am I doing wrong???

Only have this issue on my Dev PC... so must be a session or cookie issue???

When I click the cart I get this error:

While executing query "SELECT * FROM cpg1410_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


Cheers

KB
Title: Re: Shopping cart
Post by: Stramm on February 20, 2007, 07:33:02 pm
I forgot to mention, Stramm.
I have succesfully implemented a multiple packaging type alteration to this plugin.
Would you like me to tidy it up and send you a copy?

If you'd post your modifiacations here ... that would be awesome

your thoughts about paypal integration:
- with the current shop layout people necessarily have to register no matter what. The person ordering this shop wanted to print and send photos to his customers. So he's in need of the address. The shop admin makes use of the customer details. Without that no uid, customer user/ nick name, nothing you could use to connect an order to

- you could modify your email (language file) and include a 'paypal pay now button' -> something like 'if you haven't paid yet yadda yadda you can use paypal yadda'

As already mentioned... I don't consider the payapl talkback feature to be failsafe/ cheatproof. So I'm not going to implement it. For some 'advanced' webmasters it may be a great feature. Still others might come here and complain when they become a victim of some cheater.
Title: Re: Shopping cart
Post by: Stramm on February 20, 2007, 07:35:47 pm
Hi,

Great plug-in... but having problems with clearing the cart.

Basically, I have no items in the cart yet it says I have 6 items. I have deleted then reloaded the plug-in and still teh same.

I have deleted cookies... and still the same.
I have deleted the database and re-created ... and still the same...

What am I doing wrong???

Only have this issue on my Dev PC... so must be a session or cookie issue???

When I click the cart I get this error:

While executing query "SELECT * FROM cpg1410_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


Cheers

KB

Try again clearing cookies. That's usually the problem (eg when someone has a certain pic in his cart that got deleted in coppermine later on -> MySQL error -> an avoidable error message that I'll take care of the next weeks)
Title: Re: Shopping cart
Post by: Coolapix on February 21, 2007, 12:22:24 am
1. it displays correctly

Hem....

Excuse me Stramm but... I don't drink every day  ;D

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.pbase.com%2Fritchie63%2Fimage%2F74640408.jpg&hash=f4dcf01e7c62f14bac09b73102fa90b2)

If i knew how to "repare" that, i wouldn't come to ask the question...  :-[
Title: Re: Shopping cart
Post by: iphi63 on February 21, 2007, 01:41:14 am
Tu modifies l'inversion de la traduction dans le fichier french.php. Si c'est la question.
Title: Re: Shopping cart
Post by: kiwibloke on February 21, 2007, 02:52:29 am
Try again clearing cookies. That's usually the problem (eg when someone has a certain pic in his cart that got deleted in coppermine later on -> MySQL error -> an avoidable error message that I'll take care of the next weeks)

Cheers... it seems a bit hit or miss, would be great to have a cleaner method.

I notice on the logout.php script it has cookie killing commented out... should it be??? (latest build)
Title: Re: Shopping cart
Post by: dnsphoto on February 23, 2007, 02:29:15 am
Ok some how I missed it but how do I make paypal work. I have no clue about how to code or any of that stuff. So tal kto me like your telling a kid what to do. I am worst then a kid I am old and this is all new to me. Thanks
Title: Re: Shopping cart
Post by: jboeke on February 24, 2007, 10:31:11 am
Stramm!  Thank you so much not only for all the time and effort you put into this plugin, but also for keeping up with all the support and new feature requests found in this topic.

I was a bit lukewarm on Coppermine to start, but your plugin turned it into EXACTLY what I was looking for.

As a very small token of my appreciation, let me at least take one reply off your hands...

dnsphoto- - I just turned on PayPal for a site I am building.  Here is how to proceed:

1.  Navigate to: /plugins/photo_shop/include/
2.  Open the file: gateway.inc.php
3.  Go down about 33 lines or so until you get to this line:  //2. Add PayPal button
4.  Go down a couple more lines.
5.  Change this:  $CONFIG['photo_shop_paypal_enable'] = '0';
6.  To this:  $CONFIG['photo_shop_paypal_enable'] = '1';
7.  If you are in the US, you can skip the next few lines, otherwise read the fine comments.
8.  Finally, change this:  $CONFIG['photo_shop_paypal_email'] = '';
9.  To this: $CONFIG['photo_shop_paypal_email'] = 'you@aol.com';
10.  you@aol.com should really be your PayPal account email, of course.
11.  Save that file and load up your page again.  All good!


Title: Re: Shopping cart
Post by: colin911 on February 27, 2007, 12:11:26 am
Stramm.  I'm seeing a problem in the cart between logged in users and non logged in users.  If you are logged in the shopping cart works fine.   If not, then it just shows up in plain text like this:

Add image to shopping basket: 4x6 File - USD30.008x10 File - USD40.00Add to CD   

There is no drop down or "add" button. 

Where do you think the error lies? Thanks in advance.
Title: Re: Shopping cart
Post by: Stramm on February 27, 2007, 07:14:43 am
Works for me - and I think for most others too. So a link would be helpful
Title: Re: Shopping cart
Post by: colin911 on February 27, 2007, 01:42:29 pm
Sorry, here it is:  http://www.surfpic.net/gallery/displayimage.php?album=random&cat=0&pos=-34
Title: Re: Shopping cart
Post by: wuschel_lux on February 27, 2007, 01:49:12 pm
If you are logged in the shopping cart works fine.   If not, then it just shows up in plain text like this:

Add image to shopping basket: 4x6 File - USD30.008x10 File - USD40.00Add to CD   

There is no drop down or "add" button. 

Where do you think the error lies? Thanks in advance.

Hi colin,

I have had the same problem. The only thing I made, I changed the plugin order.
Here a list (order) of my plugins, with this order it works fine:
1. Full-Size Photos Access Control v1.4
2. Photo Shop v1.3.3
3. Onlinestats v1.7
.....

I hope it will help.

here my old post reply 70 -> http://forum.coppermine-gallery.net/index.php?topic=25010.msg194140#msg194140

Regards
Title: Re: Shopping cart
Post by: colin911 on February 27, 2007, 02:32:37 pm
That did the trick.  many thanks.
Title: Re: Shopping cart
Post by: jgalty on March 05, 2007, 05:06:23 pm
I have a little issue.  Everything works great up until i get to confirm my order.   When i click on "confirm your order"  it will sit for a bit then bring me to a blank page with nothing on it.  So the user doesn't think anything happened but......

If i log in as admin i can see the order that i just placed but i was wondering if any one had any suggestions for me.
Title: Re: Shopping cart
Post by: Stramm on March 05, 2007, 05:30:02 pm
link?
Title: Re: Shopping cart
Post by: jgalty on March 05, 2007, 05:36:42 pm
link?

Here's the link
http://www.paraphoto.com/usergallery/

Thanks
Title: Re: Shopping cart
Post by: Stramm on March 05, 2007, 05:40:27 pm
please enable something that allows to test emailing (like ecards)
Title: Re: Shopping cart
Post by: jgalty on March 05, 2007, 05:59:53 pm
Done....it doesn't send emails as well.
Title: Re: Shopping cart
Post by: Stramm on March 05, 2007, 07:36:30 pm
Then that's probably your problem. Get emailing going and the checkout works as well (sends an email to the user and the admin)

That's the right board to ask your question
http://forum.coppermine-gallery.net/index.php?board=52.0
Title: Re: Shopping cart
Post by: davebursey on March 08, 2007, 06:04:35 pm
Hello,
ive installed the shopping cart to my gallery, and its going great!
I have one question, relating to permissions. Is it possible to allow non admin accounts to access the "shop" menu item.
I want to be able to allow the effective shopkeeper to have access to this, without having access to the whole admin/config etc etc!!???

Many thanks

Dave
Title: Re: Shopping cart
Post by: Stramm on March 08, 2007, 07:27:10 pm
there's no nifty config setting for that, but if you edit photo_shop_admin.php you can achieve what you're up to. You need to know the user id of the user you'd like to have access to the shop admin. To find out view the memberlist and click the users nickname. In your browsers address bar you'll see the user id right after uid=
Then find
Code: [Select]
if (!(GALLERY_ADMIN_MODE)) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);replace with
Code: [Select]
if (!(GALLERY_ADMIN_MODE || (USER_ID == 'xxx' ))) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

and now replace the above xxx with the users id (eg. 3)

to add more users to the allowed list, extend the if clause with more conditions eg.
Code: [Select]
if (!(GALLERY_ADMIN_MODE || (USER_ID == '2' ) || (USER_ID == '5' ))) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
Title: Re: Shopping cart
Post by: zac on March 08, 2007, 11:35:01 pm
Hi again.. I have been tweaking this as explained in this post but it is mixing things up.

I wanted to move my shopping cart buttons out of the admin menu and did so as you explained here:
Quote
in the plugins codebase.php find
Code:

$html = str_replace('{SUB_MENU}','{SUB_MENU} <br /> {CART_MENU}',$html);

and comment it out (with adding a double slash in front of the line // )
now open your template.html and add {CART_MENU} where you want the basket buttons to appeare

I also wanted to have them gone if you are not logged in as you explained here:

http://forum.coppermine-gallery.net/index.php?topic=32231.msg186532#msg186532

However with both of these applied it now just shows the code {CART_MENU} when you are not logged in.  Can you show me the fix please? 
Title: Re: Shopping cart
Post by: davebursey on March 10, 2007, 02:47:39 pm
Aha, thanks for that quick response. that all worked well.
I am wondering if there is a way to enable discounts to be applied, if an order for multiple images is made for example!!?
Title: Re: Shopping cart
Post by: Stramm on March 10, 2007, 03:51:16 pm
Hi again.. I have been tweaking this as explained in this post but it is mixing things up.

I wanted to move my shopping cart buttons out of the admin menu and did so as you explained here:
I also wanted to have them gone if you are not logged in as you explained here:

http://forum.coppermine-gallery.net/index.php?topic=32231.msg186532#msg186532

However with both of these applied it now just shows the code {CART_MENU} when you are not logged in.  Can you show me the fix please? 

You do not need to comment out anything... Since ver 1.1 the script detects by itself if you added the placeholer to your template. If not, it's attaching the cart menu right after the sub menu

so following the instructions in the link you posted is enough
http://forum.coppermine-gallery.net/index.php?topic=32231.msg186532#msg186532
Title: Re: Shopping cart
Post by: Stramm on March 10, 2007, 04:00:51 pm
Aha, thanks for that quick response. that all worked well.
I am wondering if there is a way to enable discounts to be applied, if an order for multiple images is made for example!!?


of course possible, but you'd need to code it
Title: Re: Shopping cart
Post by: noel_edmunds on March 12, 2007, 12:52:42 pm
Hello!!
I have a silly question, i have the shopping cart plugin workin - thanks very much. All i would like to do is make the following change. On the order page that details a specific order, the file name is located on the right, i would like t position it under the other attributes on the left. I know this is silly thing to ask..or maybe this should be posted on a theme related board??
Many thanks
Title: Re: Shopping cart
Post by: jabundis on March 13, 2007, 11:12:34 pm
Hi! Stramm,
Thanks for your effor in creating this shopping cart.
I have a strange behavior with the plugin enabled.
I always add new pictures to my albums wiht the "batch add files" option on Coppermine, but when the plugin is enabled coopermine can´t add new photo files to database.
When you click on Batch add files and select the proper photo directory, coopermine normally show the filename at left side of page and a picture thumbnail on right side of page.
With plugin enabled Coopermine only show the filename on left side but never the thumbnail, of course coopermine never end loading the page.
Once disabled plugin coopermine back to normal operations.

Sorry for my bad english.

Regards

Julio Abundis
--------------
www.espaciosocial.com
Title: Re: Shopping cart
Post by: Scuba_Si on March 14, 2007, 06:06:24 am
Hi Stramm,

As with all your work its great!

I have a minor tweak that i cant work ou ton my own, please could you help.

I read all the posts here and searched too, no luck so far.

If the user adds multiple copies (lets say 3) of the same photo at the same size, everything is fine for the user in terms of checkout, but in admin i get the order, and the pricing total only accounts for one image unless i open up ht eorder.  This means i get some very strange totals for pricing.  The emails have the correct pricing, its just in the backend which is wrong.

Heard of this before?

http://www.buxtonphotographic.com/studio/ (http://www.buxtonphotographic.com/studio/)
sample gallery password= beer


If you need admin rights please let me know and i'll pm them

Thanks,

Simon
Title: Re: Shopping cart
Post by: Stramm on March 14, 2007, 07:24:29 am
do you use the latest version of the shop(1.3.3)?
Title: Re: Shopping cart
Post by: Scuba_Si on March 14, 2007, 02:45:07 pm
HI Stramm,

Sorry about that, i was on 1.3.1, i will update now.

Also, is it possible to have a review of their order in the email sent to customers? Or allow them to check their pending orders when logged in?

Thanks,

Simon
Title: Re: Shopping cart
Post by: Stramm on March 14, 2007, 04:47:05 pm
possible is (nearly) everything... there needs just to be someone who does the programming

however the pending orders thingie sounds interesting. When the order is marked 'sent' by the admin, the customer won't see the 'pending order' anymore. But then there needs to be a new menu link like 'My Orders', and there needs to be a possibility to disable it -> getting more and more extensive.
Title: Re: Shopping cart
Post by: Scuba_Si on March 14, 2007, 07:10:38 pm
hehe,

I agree it's possible, i'll have a go at it this weekend with my limited php knowledge.

Title: MOVED: Re: Shopping cart
Post by: Stramm on April 01, 2007, 07:55:13 pm
A reply to this thread has been split and then moved to Deutsch (German) (http://forum.coppermine-gallery.net/index.php?board=67).

http://forum.coppermine-gallery.net/index.php?topic=42747.0 (http://forum.coppermine-gallery.net/index.php?topic=42747.0)

Don't clutter this thread (or any other thread on the regular, non-language-specific boards) with postings in any other language than English.
Title: Re: Shopping cart
Post by: dml99 on April 13, 2007, 06:00:15 pm
Hi.  Nice plugin.  I do have a problem though and I can't find a reference to it in the posts.  I am trying to test the plugin with real-world usage and when I add an item to the cart it works fine.  And if I go to the check out it appears fine as well. The problem seems to come in when I add an item to the cart and then click on the cart button to verify the item is there.  If I click the 'back' icon in the browser to go back to the photo and continue browsing the photo album (i.e. 'continue shopping' as other e-commerce systems would have) I get the number of items in the cart incremented by one.  When I check the cart, the quantity of photos for the photo I returned to is 2 or 3 ...  depending on how many times I check and return.

I'm using photo_shop 1.3.3, no other plugins, Firefox 2 and Coppermine 1.4.10

Thanks for any help you can give me
Title: Re: Shopping cart
Post by: Stramm on April 14, 2007, 10:10:16 am
I could replicate your issues with firefox. However firefox tells you the reason in a popup box for that and requires you to click OK (resend post data). Alternatively you could click cancel. IE 7 works pretty fine for me.

To change that, you'll need to send the user to another target after adding an item -> change the refresh URL to the basket. I didn't consider this to be the most practicable way and decided for a refresh back to the image page.

Here's how to do this...
in codebase.php find
Code: [Select]
$referer = ($_SERVER['PHP_SELF'] . (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : ''));and replace with
Code: [Select]
$referer = "index.php?file=photo_shop/photo_shop_cart";
Title: Re: Shopping cart
Post by: dml99 on April 14, 2007, 04:30:13 pm
Thanks for the fix, Stramm.  As I said, I am trying to test it the way it would get used in the real world and people will surely go back and forth between the shopping cart and galleries.  Maybe its my own ignorance, but I seldom pay attention to that JPOST message - mostly because I am not a programmer and never understood what that was really telling me.  I  usually just click OK and go.  This is the first instance where it seemed to have had any effect on the page I was going back to.  Perhaps in a future release, a "Continue Shopping" button could be included in the shopping cart view that would circumvent the problem.

Again, thanks.  I'm really impressed with the speed that you reply with fixes.   :)
Title: Re: Shopping cart
Post by: JohannM on April 23, 2007, 01:18:33 am
Hi Stramm

Thanx for this plugin, I'm going to use it on my new site soon.

However, it is in fact a good idea to add "Continue Shopping" button, that takes you back to the originated thumbnail page.

I've tried to add a button (with success) and tried to implement the "javasript:history.go(-2)" code, but with no success.

Any suggestions ?
Title: Re: Shopping cart
Post by: Nibbler on April 23, 2007, 01:21:50 am
Try spelling javascript correctly.
Title: Re: Shopping cart
Post by: JohannM on April 23, 2007, 01:59:58 am
Sorry Nibbler ... I'm tired trying to figure this out.

What I have done is added the line:

<input type="submit" class="button" name="continue_shopping" value="{$lang_photoshop['continue_shopping']}" />

after

<input type="submit" class="button" name="empty_basket" value="{$lang_photoshop['empty_basket']}" />

(* Also fixed the lang file)

and

if (isset($_POST['continue_shopping'])) {
photoshop_refresh($_SERVER['PHP_SELF'].'?file=displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link'); // TO FIX LINK
      exit;
   }

after

   } elseif(isset($_POST['empty_basket'])) {
      setcookie($CONFIG['cookie_name'] . '_cart', '', time() + 86400 * 30, $CONFIG['cookie_path']);
      unset ($_SESSION['photoshop']['cart']);
        photoshop_refresh($_SERVER['PHP_SELF'].'?file=photo_shop/photo_shop_cart&box='.$box);
      exit;
   }

Question:  I do get an error ... but is this possible to get the code to work ?

Title: Re: Shopping cart
Post by: Nibbler on April 23, 2007, 01:11:26 pm
Try

Code: [Select]
photoshop_refresh("displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link"); // TO FIX LINK
Title: Re: Shopping cart
Post by: JohannM on April 24, 2007, 01:39:41 am
Thanx Nibbler

I get this error: "The selected album/file does not exist !"
Title: Re: Shopping cart
Post by: arges on April 26, 2007, 11:36:32 pm
Hello!!
I have a coppermine gallery with photo shop plugins configured correctly.
But i need to insert a button in the bottom of a image or in a thumbnail for my customers choose "add to cart" correctly with the right image.
How i put a radio button with the correct image,in the description under the image?

Have any solution for my problem?

my gallery is http://shishas.4sql.net/geral/ (http://shishas.4sql.net/geral/)
Thanks  :D
Title: Re: Shopping cart
Post by: Stramm on April 27, 2007, 10:19:25 am
if you mean in thumbnail view, then that functionality isn't coded into this plugin
Title: Re: Shopping cart
Post by: arges on April 27, 2007, 02:37:24 pm
Hey
Can you help me ,to improve the plugin...
I want insert a button under the bottom of some images , for my customers buy the specific image that belongs to a produt.
I think with some aditional code we can do this,every image have a code id item that belongs to the right image.
I want eliminate the choose button that i have now there in the top of the images,and put only a button in the bottom that have "add" to basket .

The photo shop plugin works good,but for me this aditional code it will be perfect for my website!
Thanks, :D
Title: Re: Shopping cart
Post by: Stramm on May 02, 2007, 09:20:57 am
you can edit that in codebase.php ... pretty easy. Right after
Code: [Select]
//loop through the items and create forms
The shops form (dropdown) gets calculated and saved into a var ($shop_data)
Change that to your needs. Make it a button or whatever.

To make it appeare below the intermediate image and not above you have to scroll down a few lines, find
Code: [Select]
$pic_data['html'] = $shop_data.$pic_data['html'];and change it to
   $pic_data['html'] .= $shop_data;
Title: Re: Shopping cart
Post by: AlexL on May 02, 2007, 11:50:49 am
[Off Topic]
Quote
i need to insert a button in the bottom
A nice way to feel pain?  ;) ;D
[/Off Topic]
Title: Re: Shopping cart
Post by: arges on May 03, 2007, 11:26:12 am
Thank you Stramm for your help!
Your are the best here! ;)
And thanks for make this good plugin and give suport!
I not very good leading with code,but i like it,its something for me, new to start and discovery!
This is the code that i guess i need to change like you said to me in the last post:


         <form action="{$REFERER}" method="post">
              {$added}{$lang_photoshop['buy']} {$html}
            <input type="hidden" value="{$pic_data['pid']}" name="pid" />
            <input type="hidden" value="add_item" name="event" />
             <input type="submit" value="{$lang_photoshop['send']}" class="comment_button" />
                        <input type="submit" value="Add to cart">
                       
         </form>


I add "<input type="submit" value="Add to cart>" The submit button to make the purchase,but is not storing the results in the variable,i want to save the value into the var ($shop_data) correctly like you said,but i dont know how...


If i change "$pic_data['html'] = $shop_data.$pic_data['html'];" to "$pic_data['html'] .= $shop_data;" i can see the images,after the change,so i left the code in the same.

Thanks,
Sandra
Title: Re: Shopping cart
Post by: davebursey on May 03, 2007, 03:39:34 pm
Hi Stramm,

Im trying to implement a cart-wide discount system for your Photo Shop. Its fairly simple. Any second, third fourth copies of any image ordered are recieved at half price.
So if at the moment we say that your cart calculates a sub total for an item by
quantity x price = subtotal

this discount could be applied by modifying this to

Price + ( {quantity-1} x price)/2 = subtotal

If we have one copy in the cart this will be charged at full price
If we have two copies in the cart, the second would only add half of the price on etc etc

Great.

Now if i were to try and implement this, could you point me in the right direction. My PHP is limited, but im playing catch up a little, to try and sort this!!

Many thanks
Dave

Title: Re: Shopping cart
Post by: Stramm on May 03, 2007, 03:59:33 pm
If I remember right, then there are 2 places where you need to do some changes

1. functions.inc.php (the plugins one)
find and edit the formula as you need it
Code: [Select]
$return[0] += $amount*$price;
Same for photoshop_cart.php
find and replace with your formula (2x)
Code: [Select]
$photo_price += $amount*$price;
The code in photoshop_cart.php is kinda redundant. I've written the function and use it nearly everywhere but haven't optimized the code in photoshop_cart.php yet.

Title: Re: Shopping cart
Post by: davebursey on May 03, 2007, 04:34:58 pm
hahaha, many thanks stramm, spot on!!

Here is my code

in include/function.inc.php
find the code
Code: [Select]
$return[0] += $amount*$price;.
replace with
Code: [Select]
php$photo_price += $price+(($amount-1)*$price)/2;
Then in photo_shop_cart.php
find two occurances of
Code: [Select]
$photo_price += $amount*$price;
and replace with
Code: [Select]
$photo_price += $amount*$price;
Voila.
This will apply a half price discount to any quantity over 1, of the same image bought
Dave
Title: Re: Shopping cart
Post by: JohannM on May 03, 2007, 06:19:29 pm
Hi Stramm

I'm busy creating and upgrading my website with coppermine 1.4.10.  I'm using your photo_shop plugin as my primary on-line sales tool.

By the way I think you did a freat job with it sofar !  I think (and know) that your ohoto shop will be used by many, it's a great add-on to coppermine.

However ...

Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

Also, I have read here somewhere for the users to have a "My Orders" section. Will this materialize ?

It will be nice for them to get a history of their online orders, and a detailed ORDER or INVOICE as suggested above.

Anyway, hope to get a reply from you soon ...

Feel free to test my website at:  http://www.youth-sport-fotos.com/fotos/

Title: Re: Shopping cart
Post by: Stramm on May 12, 2007, 07:50:23 am
Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

This of course is possible. Some code needs to be rewritten for that. Atm there's no function yet for creating the basket and the checkout list. So one either needs to code the exact same stuff a third (or fourth) time or you write a function and think about a template system for that. A lot of work ...

Also, I have read here somewhere for the users to have a "My Orders" section. Will this materialize ?

Such a 'My Orders' section isn't that hard to do if you integrate the link into the sub (or sys) menu. Basically a stripped down version of the admin system. If you however (my fav) don't want to clutter the menu even more, then the only option where you could place the link elsewhere is the users profile. Unfortunately there are no plugin hooks (and it's fairly complex to add some there) so you'd have to mod that file.
Title: Re: Shopping cart
Post by: Stramm on May 12, 2007, 11:05:08 am
Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

OK, I've added some basic invoice feature. It automatically gets sent with the order confirmation email to the user and the webmaster. There's a new entry in the lang file that defines the invoice header (your address).

The invoice is in plain text. I've put it in pre tags if your email client is set to display all emails as html. However it has additional line breaks in that 'mode'. Best is to view the email as plain text.

I've decided to clear the shop cookie (after the user confirmed his order) somewhen later. So it's possible to display all the orders on the confirmation page again. If you do not want that, you need to uncomment in photo_shop_checkout.php the three lines after
Code: [Select]
//comment out if you don't want the orders to appeare on the order confirmed pageDownside of the addition is, that the cookie an be cleard after the confirmation page has been created. Means it still shows items in the basket while it is empty. When clicking continue or after the first refresh the cleared cookie has its desired effect and the basket shows as empty.
If you do not like that, move the code that clears the cookie to the place it has in the orig code.

edit: removed the attachment and uploaded a new photo shop version 1.3.4
http://forum.coppermine-gallery.net/index.php?topic=32231.0
Title: Re: Shopping cart
Post by: Stramm on May 12, 2007, 03:21:30 pm
new version 1.3.4 is out

new:
- invoice in confirmation emails (see above)
- discounts

edit:
I've decided to add one more
- MyOrders page
- Minithums support (if you use the modpack)
Title: Re: Shopping cart
Post by: zac on May 13, 2007, 10:55:54 am
Great !! Thanks Stramm :D
Title: Re: Shopping cart
Post by: Stramm on May 14, 2007, 08:20:59 am
to only ahow the 'MyOrders' button to logged in users replace the entire function photoshop_user_menu with

Code: [Select]
function photoshop_user_menu(&$html){
    global $template_sys_menu_spacer, $lang_photoshop;
    if (!strpos($html,'{CART_MENU}')) {
$html = str_replace('{SUB_MENU}','{SUB_MENU} <br /> {CART_MENU}',$html);
}
//if you do not want the MyOrders page then uncomment the following line and comment out the one with the menu entry
    //$cart_menu = "<a style=\"padding:2px;\" class=\"admin_menu\" href=\"index.php?file=photo_shop/photo_shop_cart\">".photoshop_count()." {$lang_photoshop['in_cart']}</a> ".$template_sys_menu_spacer." <a href=\"index.php?file=photo_shop/photo_shop_checkout\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['checkout']}</a>";
    $cart_menu = "<a style=\"padding:2px;\" class=\"admin_menu\" href=\"index.php?file=photo_shop/photo_shop_cart\">".photoshop_count()." {$lang_photoshop['in_cart']}</a> ".$template_sys_menu_spacer;
if (USER_ID) $cart_menu .= " <a href=\"index.php?file=photo_shop/photo_shop_myorders\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['myorders']}</a> ".$template_sys_menu_spacer;
$cart_menu .= " <a href=\"index.php?file=photo_shop/photo_shop_checkout\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['checkout']}</a>";

    $html = str_replace('{CART_MENU}',$cart_menu,$html);

    return $html;
}

Recommended cause anon users can't use that functionality and just get a 'No orders' message.
Title: Re: Shopping cart
Post by: davebursey on May 15, 2007, 01:04:22 pm
Hi Stramm  - good upgrade.

How can i turn off 'my orders' completely - i cant spot it!!!

dave
Title: Re: Shopping cart
Post by: davebursey on May 15, 2007, 01:13:07 pm
Sorry!! read the manual!!

I ve got it!

But i do seem to have a lost the thumbnail on the checkout page? what havnt i read!!?

Dave
Title: Re: Shopping cart
Post by: Stramm on May 15, 2007, 05:38:50 pm
What thumbnail have you lost? Please post a link
Title: Re: Shopping cart
Post by: davebursey on May 18, 2007, 12:37:36 pm
hmmmmm, well ive made a mess of it all now!
I tried to revert back to previous version of the cart, and that failed..and then ofcourse the new version is no longer working! ive unistalled and reintalled, and the same.
So i think i might clean install, and try again - ill keep you posted on the thumbnail issue!

dave
Title: Re: Shopping cart
Post by: Lisaweb on May 20, 2007, 06:03:01 am
What thumbnail have you lost? Please post a link

I've got the same problem...  You can see it by going to www.dancamphoto.com and adding a photo to the cart.  Then press the checkout button.  Then you can see, that only thing under "Item ID" is a black dot.  No photo.  I need to fix this before I can accept orders, but have no idea how.

It's an awesome mod, I feel bad having to ask for help... I tried to figure out how to fix it myself, but couldn't find a solution.

Thanks for any advice anyone can contribute. 
Title: Re: Shopping cart
Post by: Stramm on May 20, 2007, 10:07:01 am
Link to the gallery is http://www.dancamphoto.com/gallery/
You're using the modpack... both helpful info

I guess you enabled mini thumbs but without actually creating them. So either run the admin tools to create these mini thumbs or disable them in config (Files and thumbnails settings).

Title: Re: Shopping cart
Post by: Lisaweb on May 21, 2007, 01:20:35 am
Link to the gallery is http://www.dancamphoto.com/gallery/
You're using the modpack... both helpful info

I guess you enabled mini thumbs but without actually creating them. So either run the admin tools to create these mini thumbs or disable them in config (Files and thumbnails settings).

*slaps forehead*
Geesh, dumb me!  You think I'd at least give you the right URL.  Thanks for being so proactive in helping me regardless of my incompetence.

You were right.  I used the tool to create the thumbs, and all is fixed.

Thanks Stramm, this mod is simply awesome. 

Title: Re: Shopping cart
Post by: davebursey on May 21, 2007, 06:29:10 pm
Hi folks,,

Yup i had the same problem as above, so thats sorted, thanks!!!

I have two questions now ( are two allowed, i fear not!?)

If i want to use a discount system that will be applied to when there are more than one of a specific file. ie when the amount is greater than 2 for one file. can i do this? what is the varible for this?

secondly i have a "%" that appears when a discount is applied so my last line in the cart, prior to the Total reads..

Discount :: % 1.50GBP
I am not applying a percentage discount, where is this % coming from, i have looked in the language file, and i cant see it!

Any pointers Stramm!?
Regards
Dave
Title: Re: Shopping cart
Post by: Stramm on May 21, 2007, 07:52:14 pm
you can change the % in functions.inc.php, function photoshop_format_price
Code: [Select]
if ($discount > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['discount'].' :: %'.$discount.$lang_photoshop['USD']); }the relevant part is :: %
In my country it's also the mercantile symbol for a subtraction

The discount is possible but you'll have to do some more calculating.
Check the function photoshop_count_items
It loops through all items of the basket and the var $amount holds the number. $item_id holds the id of the pic type you sell.

basically you copy that function. If $amount is > 1, you can grab the price of an item with
Code: [Select]

$price = $SHOP_CONFIG[$item_id]['price'];
$name = $SHOP_CONFIG[$item_id]['name'];
$name holds the name of the product, eg. 4x6 inch print (depending what you've set up).

You know when an photo is >1 times in the basket (for a certain goods group) and you know it's price. So basically you can do some calculation like
Code: [Select]
if ($amount >1) $discount .= ($amount-1) *$price / 2; if you have 3 pics 4x6 of pid 23 in the basket the first would get priced full, the others 50%

Unfortunately we have another functionality to take into account, the price override (you can specify different price levels on a per album basis). Including this the new function would look like...

Code: [Select]
function calculate_discount($temp_price, $cd_counter){
global $SHOP_CONFIG, $CONFIG;
$discount = '';

foreach($_SESSION['photoshop']['cart'] as $key => $temp){//foreach count photo items

$item_id = (isset($_SESSION['photoshop']['cart'][$key]['id'])) ? $_SESSION['photoshop']['cart'][$key]['id'] : '';
$amount = (isset($_SESSION['photoshop']['cart'][$key]['amount'])) ? $_SESSION['photoshop']['cart'][$key]['amount'] : '';
$aid = (isset($_SESSION['photoshop']['cart'][$key]['aid'])) ? $_SESSION['photoshop']['cart'][$key]['aid'] : '';

//price override
$price = $SHOP_CONFIG[$item_id]['price'];

$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_PRICES']} WHERE aid={$_SESSION['photoshop']['cart'][$key]['aid']}");

    while ($temp_data = mysql_fetch_array($results)) {
if($temp_data['gid']==$SHOP_CONFIG[$item_id]['id'])
$price=$temp_data['price'];
}
mysql_free_result($results);

if ($amount > 1) $discount .= ($amount-1) * ($price / 2);
}

return $discount;
}

This isn't tested at all
Title: Re: Shopping cart
Post by: davebursey on May 22, 2007, 11:41:51 am
Hi Stramm,
thanks for the reply - ill give this a go over the weekend a report back!

I have anothe issue (sorry!!)

the paypal button returns an error from paypal (Return to Merchant - We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller......)

I have changed the email address (once) in the include/gateway.inc.php

Do i need to something else!?

Many thanks
Dave
Title: Re: Shopping cart
Post by: davebursey on May 22, 2007, 12:21:26 pm
Once again - sorted my silly little problem. Just a simple spelling mistake in the folder structure, sorry to bother you all.
Title: Re: Shopping cart
Post by: Freder on May 23, 2007, 02:04:21 pm
Hello, and thanks for a great plugin!  :)

I found some issues, one is with the checkout page. The thumbnails seemed to be missing if you have the 'enable_mini_thumbs' unset, but in fact they were sized 0x0, so it was easy to fix - you just have to edit 'photo_shop_checkout.php' and replace the following:

Code: [Select]
    $ratio = max($row_pic['pwidth'], $row_pic['pheight']) / $new_size;
    $ratio = max($ratio, 1.0);
    $destWidth = (int)($row_pic['pwidth'] / $ratio);
    $destHeight = (int)($row_pic['pheight'] / $ratio);

with these:
Code: [Select]
    $ratio = max($row['pwidth'], $row['pheight']) / $new_size;
    $ratio = max($ratio, 1.0);
    $destWidth = (int)($row['pwidth'] / $ratio);
    $destHeight = (int)($row['pheight'] / $ratio);

Another problem that I have is that after the order is placed and the final info about the email being sent is displayed, the item summary seems to be misplaced and that totally borks the layout...  :(
Here is an account to check that: user Tester, pass 4testing2g0 (http://krypa.homelinux.net/cpg)

Also, has the shipment selection radio been implemented? I don't get any, and the shipment price is always the lowest one - so if you have a 'retrieve in person' with 0 cost, everyone gets in no matter if they want or not...

And finally, I wrote a Polish translation for the shop (hope you find it useful)...
Title: Re: Shopping cart
Post by: Stramm on May 23, 2007, 02:42:18 pm
Thanks for pointing out the lil problem. Has been addressed in the attached photo_shop_checkout.php

For the shipment... no changes since the last version, means you can only set it globally.

Oh, and thanks for the translation. Much appreciated  ;)
Title: Re: Shopping cart
Post by: Freder on May 23, 2007, 03:01:26 pm
Thanks very much for that.  :) Your speed truly is amazing...  ;)

I also found another detail I forgot to write about earlier. In the orders panel the discount does not get displayed (ie. I get "Ilosć: 87.20PLN - w tym zniżki %discount" or "Order volume: 87.20PLN - incl. shipping %discount"). I've been looking for the source of this, but I can only conclude that the '%discount' does not get replaced by the real discount value (if it is that) in the 'incl_ship' string. I don't know why that is...

EDIT: Oh I know what it is now... Took a look at the other translations. The % sign was a bit misleading. ;) I updated the 'polish.php.zip' file in the earlier post.
Title: Re: Shopping cart
Post by: chican0 on June 02, 2007, 03:08:42 pm
Strange... I checked and double checked my lang file but found no problem yet I still show the "Order ID: 40 - Items: 13 - USD total: 13.70 incl. shipping %discount"

Hopefully this can be explained.

Anyhow, I found a couple problems with the Google Checkout portion.

1: gateway.inc.php: locale was using the same identifier as button style.
Code: [Select]
Line 74: $CONFIG['photo_shop_google_button_style'] = 'trans';

Line 77: $CONFIG['photo_shop_google_button_style'] = 'en_US';
Line 77 should reflect the following...
Code: [Select]
$CONFIG['photo_shop_google_button_loc'] = 'en_US';
2: photo_shop_checkout.php: Found two </form> ending tags which caused incomplete data to be sent to google checkout. I simply removed the first </form> from Line 140.

Other than that... Google Checkout is working normally.

Thank you so very much for the updates to this plugin!
Title: Re: Shopping cart
Post by: Stramm on June 02, 2007, 03:31:34 pm
thanks for your feedback on the google checkout implementation. I wasn't able to test it so I'm in need for any feedback possible. I've added your suggestions to my local copy.

the discount thingie. I'm not really sure what you're up to. If the % sign is your problem, then read http://forum.coppermine-gallery.net/index.php?topic=32231.msg208922#msg208922

If the word 'discount' is your problem... it just should appeare if the conditions for the discount are set. I've explained the new discount feature in the announcement post (1 post in this thread), also in codebase.php. Some explaining in the above mention post too.

Hope that helps
Title: Re: Shopping cart
Post by: chican0 on June 02, 2007, 03:57:19 pm
My! You are fast!

My apologies. I was assuming that the word discount would only show if the order qualified for a discount.

I have my functions.inc.php set to discount if more than 10 images are ordered for prints. However, orders that have only 2 images to print still show the word discount.

"Order ID: 8 - Items: 2 - USD total: 6.00 incl. shipping %discount"

Granted, there is no discount information included within the financial totals so the total price being charged to the customer is not effected. When the discount is applied or not, the overall totals reflect the correct amounts.

I suppose I could just edit the language file to show "incl. shipping and discount (if applicable)"


Title: Re: Shopping cart
Post by: Stramm on June 02, 2007, 04:46:49 pm
ahh, OK, have seen what you mean, the entry in the shop admin.
That's in the lang file, array $lang_photoshop_admin, incl_ship
It's just stating that in that total shipping and discount is included if applicable.
Title: Re: Shopping cart
Post by: Stramm on June 08, 2007, 03:22:59 pm
New version 1.3.5
- you now have the possibility to set shipping per item; customizable within the function (similar to the discount system).
Title: Re: Shopping cart
Post by: housemeister on June 10, 2007, 01:07:00 pm
@stramm, nice mod ;-)

if i add a picture the language is english:

click on shoppping cart

index.php?file=photo_shop/photo_shop_cart

also english -> checkout page is correct in euro ?

btw: where can i change the paypal account ?
Title: Re: Shopping cart
Post by: Stramm on June 10, 2007, 06:01:35 pm
Redownload 1.3.5 from my site and install it. I've improved language detection. In plugin environments it seem sto be somehow tricky sometimes.

paypal and all other billing solutions:
Quote
New version (1.2 uploaded on 10/03/2006)
 - added bridge compatibility (should work without the need to configure anything, beta status)
 - added a paypal gateway (configure and enable it in include/gateway.inc.php, beta status)
 - fixed 2 bugs related to the shipping costs addition
Title: Re: Shopping cart
Post by: housemeister on June 10, 2007, 06:36:19 pm
works great, thanks :-)
Title: Re: Shopping cart
Post by: JohannM on June 12, 2007, 11:35:14 am
Hi Stramm

Great work so far. I'm using your shopping cart as primary tool for online orders.

I need to know the following. During registration, I added fields like user_address, user_tel, etc. to be saved in the user's table.

Now with the shopping cart, especially in photo_shop_admin and the emails sent to the admin and user, I want to include this fields.  How do I do this ? Is there a simple way just to add a couple of sql query lines to get the information ?

It would also be nice to include the Order ID in the subject of the emails. How do I do this ?

Hope you can help.

Keep up the good work.
Title: Re: Shopping cart
Post by: Stramm on June 13, 2007, 12:23:58 pm
in the admin.. basically it's in there, just click the user's name to open his profile (shift+click to open it in a new window). To show all profile info in the shop admin is confusing and far to much info (imho). Probably useful in the detailed order overview if the webmaster requires this info (as I do). But you have  the possibility here too, to open the profile (click on username)

to add more profile info to the email... easy to do, and I'll keep the changes for later releases
in photo_sho_checkout.php find
Code: [Select]
'{LINK}' => $CONFIG['ecards_more_pic_target'],below add
Code: [Select]
'{USER_PROFILE1}' => $user_info['user_profile1'],
'{USER_PROFILE2}' => $user_info['user_profile2'],
'{USER_PROFILE3}' => $user_info['user_profile3'],
'{USER_PROFILE4}' => $user_info['user_profile4'],
'{USER_PROFILE5}' => $user_info['user_profile5'],
'{USER_PROFILE6}' => $user_info['user_profile6'],

now you can use the placeholders {USER_PROFILE1} - {USER_PROFILE6} in your email templates to the user and admin (to be found lang file(s))

Order id in the subject:
in the same photoshop_email_the_user where you just did your first changes find 2-3 lines below in the function call cpg_mail the variable $subject and replace it eg with
Code: [Select]
$subject.', Order ID: '.$order_idto get a result like
Quote
Thanks for your order,  Order ID: 107
to the admin it'll look like
Quote
You got a new order,  Order ID: 107
Title: Re: Shopping cart
Post by: JohannM on June 13, 2007, 03:12:16 pm
Hi Stramm

Thanx a lot man, your the best !

The reason why I want to have the {USER_ADDRESS} on the admin page is that it would be much easier for me to print out the page for my files when doing the actual order.

You suppose I can include (put) $user_data['user_address'] on the spot in the admin page where I want the address to appear ?

Title: Re: Shopping cart
Post by: Stramm on June 13, 2007, 04:14:17 pm
no, hehehe, it's not that easy, just thinking one needs the address and therefore typing somewhere {USER_ADDRESS} would bring that up is magic

you'll first need to get the data from the db
-> photo_shop_admin.php
find
Code: [Select]
$sql = "SELECT s.*, u.{$udb_var['field']['username']}, u.{$udb_var['field']['email']}  FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE oid=".$oid." AND cd=1 LIMIT 1";
and replace it with
Code: [Select]
$sql = "SELECT s.*, u.* FROM {$CONFIG['TABLE_SHOP']} AS s LEFT JOIN {$udb_var['usertable']} as u ON u.{$udb_var['field']['user_id']} = s.uid WHERE oid=".$oid." AND cd=1 LIMIT 1";
that could will get the additional data (all user data) from the db, therefore the detailed list got replaced with *
We need (same as in my post above) the fields user_profile1 - user_profile6 (not address ;) )

Now we add that additonal info to the detailed order view
-> again photo_shop_admin.php find ~line 550
Code: [Select]
<span style="cursor:pointer" onclick="window.location='profile.php?uid={$row['uid']}';">{$row['user_name']} - </span> -
and replace
Code: [Select]
{$row['user_name']} - with
Code: [Select]
{$row['user_name']} - {$row['user_profile1']} - {$row['user_profile2']} - {$row['user_profile3']} - {$row['user_profile4']}of course you can insert user_profile5 and user_profile6 too, also you can chose a different place to place the address, that's just an example placement
Title: Re: Shopping cart
Post by: JohannM on June 13, 2007, 05:03:57 pm
Hi Stramm

Thanx a lot man, yet again, you are just a STAR !

It all works well ... for the record, I have a field name "user_address".

Now, on my admin page, its shows the adrress like:

PO BOX 5555 CAPE TOWN 8000 (in one line)  and not like

PO BOX 5555
CAPE TOWN
8000


How do I fix this ?

Thanx for your quick and VERY helpful help !
Title: Re: Shopping cart
Post by: Joachim Müller on June 13, 2007, 05:51:08 pm
Individual issues should imo go into separate threads and not into the announcement thread. This thread is very cluttered (because it's a "hot" one) already.
Title: Re: Shopping cart
Post by: JohannM on June 14, 2007, 06:11:52 pm
GauGau


Where and on what board should we post questions about this Shopping Cart (Photo Shop) then ?
Title: Re: Shopping cart
Post by: Joachim Müller on June 14, 2007, 07:11:46 pm
cpg1.4 plugins (http://forum.coppermine-gallery.net/index.php?board=53.0)
Title: Re: Shopping cart- error There was an error while processing a database query
Post by: panthereyes07 on June 15, 2007, 06:40:35 am
i have installed the gallery and then went to install the photo shop module i have recived the following error, how do i fix these errors.

There was an error while processing a database query
Title: Re: Shopping cart
Post by: Stramm on June 15, 2007, 07:58:40 am
enable debug mode and post the actual error message
Title: Re: Shopping cart- Critical error There was an error while processing a databas
Post by: panthereyes07 on June 15, 2007, 12:27:40 pm
Critical error There was an error while processing a database
While executing query "insert into cpg_plugins (name, path,priority)  values ("Photo Shop","photo_shop",5);" on 0

mySQL error: Duplicate entry 'Photo Shop' for key 2


Debug Info

USER:
------------------
Array
(
    [ID] => 041d17d6d4995250e4e77edccb4e8b91
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [theme] => valentines
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => chrisb
    [groups] => Array
        (
           
        )

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

==========================
Queries:
------------------
Array
(
    [op] => install
    [p] => photo_shop
)

==========================
POST :
------------------
Array
(
    [submit] => Go!
)

==========================
VERSION INFO :
------------------
PHP version: 4.4.4 - OK
------------------
mySQL version: 4.1.22-standard
------------------
Coppermine version: 1.4.10(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 4.1.22
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.3
Linked Version 1.2.1.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 8M | 8M
post_max_size | 16M | 16M
==========================
Page generated in 0.07 seconds - 20 queries in 0 seconds - Album set : ; Meta set: ;
Title: Re: Shopping cart
Post by: Stramm on June 15, 2007, 12:56:25 pm
looks like you're trying to install a plugin that's already installed. Uninstall older versions before installing the new one.

Read the install notes in the anouncement thread for version 1.3.5 and do as suggested
Title: Re: Shopping cart
Post by: manyquestions on June 26, 2007, 02:29:02 pm
Hi Stramm, i am a german guy but try to write in english ;)

Thats a great plugin but where is the opportunity to add the tax of the countries, like germany with 19% V.A.T ?

At the end of each order there must be added the tax to the sum  ???

I can´t find it or isn´t it impelemented?

Greetings

manyquestions
Title: Re: Shopping cart
Post by: Stramm on June 26, 2007, 03:38:39 pm
Usually tax is included in the price you show in the shop. Therefore support for tax isn't enabled atm. But you could 'abuse' the discount or shipping  functionality (for shipping you still can set a global one if you do so).

If you do not want to add the tax to the total, but you just want to display it in the invoice, something like ' incl. 19% MWSt: 3.15 EUR', then you easily can do that in functions.inc.php function photoshop_format_price
Title: Re: Shopping cart
Post by: manyquestions on June 26, 2007, 04:19:46 pm
Usually tax is included in the price you show in the shop. Therefore support for tax isn't enabled atm. But you could 'abuse' the discount or shipping  functionality (for shipping you still can set a global one if you do so).

If you do not want to add the tax to the total, but you just want to display it in the invoice, something like ' incl. 19% MWSt: 3.15 EUR', then you easily can do that in functions.inc.php function photoshop_format_price

Thanks Stramm for your feedback.

Sorry, i am not a coder. What should i change to show the tax amount of the order at the end of the bill?

Thanks so much

manyquestions
Title: Re: Shopping cart
Post by: Stramm on June 28, 2007, 07:46:28 pm
function photoshop_format_price in functions.inc.php (the plugins one)
after
Code: [Select]
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping-$discount),2);
define the tax, eg.
Code: [Select]
$tax = number_format(($tot_price/119*19),2);

then add the calculated tax to the html output
looks something like (hardcoded)
Code: [Select]
<td colspan="6" align="right">
{$photo_price2}
{$cd_price2}{$error}
{$total_price}
<br/>Incl. MWSt.: {$tax}{$lang_photoshop['USD']}&nbsp;&nbsp;
</td>

now add it to the txt output (emails)

eg.
Code: [Select]
$out['text'] .= sprintf("%+63s\n", 'Incl. MWSt: '.$tax.$lang_photoshop['USD']);
right before
Code: [Select]
return $out[$template];

 
Title: Re: Shopping cart
Post by: Styles on June 29, 2007, 03:35:59 am
Hello

Just a quick thank you for this great plugin

I do have a question:

If a buyer desides that he wants to pay later and clicks on "continue" instead of, "paypal".
Is there a way to send him(the buyer) the paypal link in the "thank you for your order" email?
or can the buyer go back to the checkout page without having to reorder?

Thank you
Title: Re: Shopping cart
Post by: Stramm on June 29, 2007, 09:33:19 am
in your paypal merchant tools create a buy now button for a single item (doesn't matter what values you use), make sure you check unencrypted, then you get a link to use in emails.

Now copy/ paste the email into the photo shop lang file into an anchor tag ($lang_photoshop_email_order),
replace the price you entered with {PRICE}, the Item ID/Number with {ORDER_ID} and the item name you entered with eg. Your%20order:%20{ORDER_ID}

that'll look similar to
Code: [Select]
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=webmaster%40coppermine%2ecom&item_name=Your%20order:%20{ORDER_ID}&item_number={ORDER_ID}&amount={PRICE}&no_shipping=0&no_note=1&currency_code=EUR&lc=DE&bn=PP%2dBuyNowBF&charset=UTF%2d8">Pay with Paypal</a>this sample uses the email addy webmaster@coppermine.com, Eur and the german paypal frontend
Title: Re: Shopping cart
Post by: Styles on June 29, 2007, 02:06:47 pm
 :o HOLY DOODLE BATMAN

That was quick (and easy)

Thanks!!
Title: PhotoShop 1.3.5 on CPG 1.4.11
Post by: GuidoR13 on June 29, 2007, 06:44:19 pm
Hello,

I just installed CPG 1.4.11 and then PhotoShop 1.3.5 and I get an internal server error (500, no debug possible, no serverlog accessible :-() when I send an order in photo_shop_checkout.php. Everything else (adding pictures, administration, deleting orders, deleting pictures in orders) works like a charm. Any ideas?

Thank you,
Guido
Title: Re: Shopping cart
Post by: Stramm on June 29, 2007, 07:08:25 pm
An internal server error usually is what it claims to be, a server error while the server doesn't know a better message than that 'internal'.

To track down the culprit you should check your error logs. If you do not have access to the error logs, you'll have to ask your host to do so.

It may help to reupload the file that's making the troubles.
Title: Re: Shopping cart
Post by: GuidoR13 on July 02, 2007, 06:39:50 pm
Thank you, the problem was a user without email address, which leads to a forbidden action on the server resulting in the internal server error - took some time to find...
Title: Shopping Cart - Registered only galleries
Post by: GuidoR13 on July 02, 2007, 10:02:38 pm
Hello, some of my galleries are registered only, nevertheless I find you shop more than convient.

I've to add the following line to deny access by URL to: photo_shop_cart.php, photo_shop_checkout.php, photo_shop_myorders.php, photo_shop_register.php
Code: [Select]
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

A change to photshop_user_menu() in the codebase.php just after the global declaration inhibits the menu:
Code: [Select]
    if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) return $html;

G.
Title: Re: Shopping cart
Post by: Swieb on July 10, 2007, 12:43:51 am
Hi,

Hope this is the right topic for my question.
Looking for gallery software with shopping cart support I decided to go for CPG. During the test I've been doing for the last few days it turned out to have almost everything I hoped for.
The 'almost' is the reason for my post here.

I would like to add an additional service for my customers so they receive an Update e-mail when the order status changes.
(when payment is received and when the order is shipped)

Being a CPG newb I've been staring myself blind on the photo_shop_checkout.php and photo_shop_admin.php code to figure out a way to get my change working. So far no luck. The only result is a Critical error when I try to send the email.

Code: [Select]
While executing query "SELECT *,  AS user_name,
AS user_email,
AS user_regdate,
AS user_location,
AS user_website
FROM   WHERE  = '1'" on

mySQL error: You have an error in your SQL syntax near 'AS user_name, ' at line 1

I see the table is missing but that's as far as I get.

FYI
I inserted a photoshop_email_the_user() call in the Switch dowhat_item section (case "mark_payed") of photo_shop_admin.php.
My Quick and dirty attempt to put a copy of functions photoshop_email_the_user() and photoshop_user_details() in photo_shop_admin.php didn't do the trick and to be honest I don't have a clue what to try next.

Has anybody tried to implement similar functionality (and got it working) or can somebody point me in the right direction to get this working?

Any help is appreciated.
Title: Re: Shopping cart
Post by: Stramm on July 10, 2007, 07:02:11 pm
you can set a single item as paid -> within the check if all pics of an order have been paid you call the mail function.
There's altready a query for the status... get the uid (user id of the user who did the actual order) too.
You'll have to modify the function photoshop_email_the_user() as well as it out of the box only is able to email the admin or the logged in user. But in the step before you grabbed the uid. That you can use to query for the user details in function photoshop_email_the_user()
Title: Re: Shopping cart
Post by: Swieb on July 10, 2007, 11:53:55 pm
Thanks for pointing me in the right direction Stramm!

I've got both parts (sending a notification when payment is received and when the order is shipped) working now.
I left out the price in the notification since I didn't feel like re-coding the calculation of items, discounts and shipping. Perhaps later...

Had some problems getting the mail template in de lang file to work, but finaly figured out not to put de additional mailcontent in the
if (defined('PHOTOSHOP_ORDER_PHP')) conditional.

Also adding require('include/mailer.inc.php'); helped ;)

Again thanks for your help!
Title: Re: Shopping cart
Post by: Swieb on July 14, 2007, 01:58:00 pm
Hi Stramm,
Since you where so helpful a few post above perhaps you can answer this question too  ;D.

It's about different pricing used for some galleries.
I’ve set the default pricing for a 10 x 15 print to 2 Euro.
For one specific gallery I’ve set it to 3 Euro

When I log in as a regular user, put a photo in the cart and go to "My orders", I see the order with the non-default price.
So far so good.

The thing that imho is confusing is that the pricelist below the order overview shows the default pricing, and not the gallery specific pricing.
For now I removed the pricelist, but it would be nicer to have the pricelist back with correct gallery specific pricing.

Is there a simple solution to this "problem"?
And if so, where can this be ‘fixed’
Title: Re: Shopping cart
Post by: Stramm on July 15, 2007, 01:08:56 pm
I haven't add the 'per album prices' to the pricelist (as it can grow really huge with that).
Atm it shows the standard prices and the shipping (all shipping)
This data is stored in an array and you can easily read it. To get the additional data you'll need to do a db query (with a join to get the album name)

Just have a look at the function photoshop_pricelist() (plugins/photo_shop/include/functions.inc.php)
Before the echo you'll need to add the query (table shop_prices join albums). In the prices table aid is the album ID and gid the item id.
Title: Re: Shopping cart
Post by: Swieb on July 15, 2007, 01:54:33 pm
Thanks for your reply.

I now get the point.

I was thinking about listing only album specific prices, and when not set: list defaults.
Since I’m still testing on a local server I didn't keep in mind that actual customers would possibly order from more than one gallery at once.
My change would list all pricing for each gallery they had made selections from.
I now see that it would not be wise to implement this feature.

If album specific pricing is to be listed than the best place would be inside each gallery (but not in the shopping cart screens).


Title: Re: Shopping cart
Post by: DesMas on July 26, 2007, 01:16:44 pm
Heya, Im on startup to use this great mod for a project where a shop system for picures is needet.

ATM I have 2 problems with the system, one is very simple, the other one might need more explanation

1) I found that there are some points in the language file (english & german) missing so the table in the mail has no header description.
fixed this by adding the following line to the $lang_photoshop array:

german.php:
Code: [Select]
  'item_id_checkout' => 'Item ID',
  'type_chckout' => 'Format',
  'amount_checkout' => 'Anzahl',
  'total_checkout' => 'Preis',

english.php:
Code: [Select]
  'item_id_checkout' => 'item ID',
  'type_chckout' => 'dimension',
  'amount_checkout' => 'count',
  'total_checkout' => 'price',

the 2. problem might be a little more complicated:
- the coppermine system is integrated with a special bridge from mehdi (http://www.mehdiplugins.com/misc/index.htm) into a joomlaa 1.0.12 cms
- in the joomla cms i've installed the "User Extended" Component to integrate more user field on registration (like adress and so on)

the problem I now have, that by this plugin, a registration in the gallery (redirected to the cms) will stop at the point where the cms is generating an email.
the solution in this original mod, that the user wil be automatically "activated" and directed back to its basked wont work (deactivated by the bridge).

Does anyone have an idea how this could be reimplemented by using the bridged system?


Another problem i have is, when an unregistered user wants to check out, the system redirects him to the register form.
Well with the bridge he will be directly redirected to the user_extended registration form of the cms. But i need another redirection so he has before to accept the "system rules" (AGB).
I think this could be done by a manipulation of the following lines in the phptoshop_register.php:

Code: [Select]
//if user isn't logged in redirect to shop register/login page
if(!USER_ID) {
    photoshop_refresh($_SERVER['PHP_SELF'].'?file=photo_shop/photo_shop_register');
exit;
}
Dont know, but will try out :)


EDIT

well I found another thing, that relies on the usage of the bridged mode:
If the user logs out with a filles shopping cart this one will stay active for the guest...

But the most worst thing is:
If i want to change the amount of pictures in the shopping cart, i get the error Message:
Code: [Select]
Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.And I dont know where this comes from

Live site to check this: http://www.pferdefotos-sh.de/coppermine
Title: Re: Shopping cart
Post by: DesMas on July 26, 2007, 05:10:28 pm
If the user logs out with a filled shopping cart this one will stay active for the guest...
-->cookie problem???
Title: Re: Shopping cart
Post by: Stramm on July 27, 2007, 08:11:24 am
I do not know Joomla or the bridge so I can't help you much there. You could just disable the redirection to the photo_shop login/ register site and instead display a message 'To finish your order you need to log in' or similar. That'll solve your problem 1+2.

That message
Code: [Select]
Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.I guess it's from Joomla... you need to search there

Quote
If the user logs out with a filled shopping cart this one will stay active for the guest...
This is expected behaviour.

The not logged in user can add items to his basket. If he logs in, the items will stay in the basket. If the browser crashes or he logs out and later comes back, the items still will be active.

Probably you mean the items will now show for all not logged in users??? No, that's not the case. Only for the user with the cookie saved on his computer.

And thanks for spotting the missing lang file entries.
Title: Re: Shopping cart
Post by: DesMas on July 27, 2007, 10:12:04 am
Thx for your answers

well the fact that the cookie stays acrive on browser reload and saves by this the basket helps with the registration thing on the bridged system.

- ATM i changed the redirection at check out from login to a static content item.
- there the guest has to accept the rules (AGB)
- then gets forwarded to the registration.

By the fact that this is a modded joomla registration, ill need to mod the mod, if i want to skip the email for shop users.
well this would be the not so heavy thing i hope :P

with the other error...h,, maybe i find where the joomla code forces this Illegal variable error....
Interesting is:
- I can delete an item in the basked via the X
- but cannot change the values

How are these 2 things implemented?
GET or POST ? special things?

EDIT:
I found the code snipped that forces this error in joomla:

globals.php
Code: [Select]
/**
 * Adds an array to the GLOBALS array and checks that the GLOBALS variable is
 * not being attacked
 * @param array
 * @param boolean True if the array is to be added to the GLOBALS
 */
function checkInputArray( &$array, $globalise=false ) {
static $banned = array( '_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals' );

foreach ($array as $key => $value) {
$intval = intval( $key );
// PHP GLOBALS injection bug
$failed = in_array( strtolower( $key ), $banned );
// PHP Zend_Hash_Del_Key_Or_Index bug
$failed |= is_numeric( $key );
if ($failed) {
die( 'Illegal variable <b>' . implode( '</b> or <b>', $banned ) . '</b> passed to script.' );
}
if ($globalise) {
$GLOBALS[$key] = $value;
}
}
}

/**
 * Emulates register globals = off
 */
function unregisterGlobals () {
checkInputArray( $_FILES );
checkInputArray( $_ENV );
checkInputArray( $_GET );
checkInputArray( $_POST );
checkInputArray( $_COOKIE );
checkInputArray( $_SERVER );

if (isset( $_SESSION )) {
checkInputArray( $_SESSION );
}

$REQUEST = $_REQUEST;
$GET = $_GET;
$POST = $_POST;
$COOKIE = $_COOKIE;
if (isset ( $_SESSION )) {
$SESSION = $_SESSION;
}
$FILES = $_FILES;
$ENV = $_ENV;
$SERVER = $_SERVER;
foreach ($GLOBALS as $key => $value) {
if ( $key != 'GLOBALS' ) {
unset ( $GLOBALS [ $key ] );
}
}
$_REQUEST = $REQUEST;
$_GET = $GET;
$_POST = $POST;
$_COOKIE = $COOKIE;
if (isset ( $SESSION )) {
$_SESSION = $SESSION;
}
$_FILES = $FILES;
$_ENV = $ENV;
$_SERVER = $SERVER;
}

/**
 * Emulates register globals = on
 */
function registerGlobals() {
checkInputArray( $_FILES, true );
checkInputArray( $_ENV, true );
checkInputArray( $_GET, true );
checkInputArray( $_POST, true );
checkInputArray( $_COOKIE, true );
checkInputArray( $_SERVER, true );

if (isset( $_SESSION )) {
checkInputArray( $_SESSION, true );
}

foreach ($_FILES as $key => $value){
$GLOBALS[$key] = $_FILES[$key]['tmp_name'];
foreach ($value as $ext => $value2){
$key2 = $key . '_' . $ext;
$GLOBALS[$key2] = $value2;
}
}
}

if (RG_EMULATION == 0) {
// force register_globals = off
unregisterGlobals();
} else if (ini_get('register_globals') == 0) {
// php.ini has register_globals = off and emulate = on
registerGlobals();
} else {
// php.ini has register_globals = on and emulate = on
// just check for spoofing
checkInputArray( $_FILES );
checkInputArray( $_ENV );
checkInputArray( $_GET );
checkInputArray( $_POST );
checkInputArray( $_COOKIE );
checkInputArray( $_SERVER );

if (isset( $_SESSION )) {
checkInputArray( $_SESSION );
}
}

wel now i need to find out why/how the post variable from the shop forces this error....narf
Title: Re: Shopping cart
Post by: Stramm on July 27, 2007, 10:42:05 am
just check the code...
photo_shop_cart.php, the first lines

empty basket and apply modifications (changing the item numbers) -> POST
delete item -> REQUEST

when I search the web for your 'error message' I get some joomla threads.. maybe it's woth to read them ... tells to use the 'new' globals.php


And if you do not want the cookie... then don't save it. The shop uses both, sessions and cookies.
codebase.php -> function photoshop_add_item()
Title: Re: Shopping cart
Post by: DesMas on July 27, 2007, 11:09:56 am
yea found them also, the problem is as far as i could read out, the thing that numeric values are in the post array:

Code: [Select]
Array
(
    [file] => photo_shop/photo_shop_cart
)

Array
(
    [item_id] => Array
        (
            [0] => 0
        )

    [0] => 1
    [box] => photo
    [apply_modifs] => Speichere neue Anzahl
)

Code: [Select]

// PHP Zend_Hash_Del_Key_Or_Index bug
$failed |= is_numeric( $key );

and thy are not allowed...

well I could now comment the is_numeric check out but more likely I would change the shopping basked code :P
Title: Re: Shopping cart
Post by: Stramm on July 27, 2007, 11:26:56 am
then why not recode the shop?? Make the number of items and the item id non numeric, add a letter to it, like 'n' or 'r', later you have to remove that again.

Some work

or... REQUEST isn't banned in globals.php... change POST to REQUEST
Title: Re: Shopping cart
Post by: DesMas on July 27, 2007, 06:15:09 pm
ok I managed it bay adding a text part to the element:
for those others who might be searching for a solution for the error
Code: [Select]
Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.when modifing the amount of items:

photo_shop_cart.php
search:
Code: [Select]
$_SESSION['photoshop']['cart'][$item_id]['amount'] = $_POST[$item_id];replace:
Code: [Select]
$_SESSION['photoshop']['cart'][$item_id]['amount'] = $_POST['count'.$item_id];
search:
Code: [Select]
<input type="text" class="textinput" maxlength="5" style="width: 20px" name="{$key}" value="{$amount}"/>replace:
Code: [Select]
<input type="text" class="textinput" maxlength="5" style="width: 20px" name="count{$key}" value="{$amount}"/>
Title: Re: Shopping cart
Post by: DesMas on August 02, 2007, 07:22:45 pm
Stramm, 2 questions:

in my test system I have a list of the following orders:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.vmm-is.de%2Ffiles%2Fphoto_cart.jpg&hash=731b39ad6380ab822a785f343301c6be)
well this looks nice at first but what confuses me:

There are User ID's listet of 62 and 65 but the highest key in the DB's user table ist 6 on this system  ???
codearea ~428 in photo_shop_admin.php
Code: [Select]
<div class="smallfont">
<span style="float:right;"><a href="index.php?file=photo_shop/photo_shop_zip&oid={$oid[$k]}">{$lang_photoshop_admin['download_zip']}</a></span><br>
<span style="float:right;"><a href="mailto:{$user_email[$k]}">{$user_email[$k]}</a></span>
<span style="cursor:pointer" onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';">{$lang_photoshop_admin['order_id']}: {$oid[$k]}&nbsp;&nbsp;- &nbsp;&nbsp;{$lang_photoshop_admin['user_id']}: {$uid_tmp[$k]}</span>
</div>

it seems for me like the uid gets mixed up while an order is getting stored into the shop table, right or did i miss something?

photo_shop_checkout.php -> photoshop_add_data() around 357ff
Code: [Select]
$results = cpg_db_query ("INSERT INTO `{$CONFIG['TABLE_SHOP']}` (`oid`, `uid`, `pid`, `quantity`, `size`, `price`, `otime`) VALUES ('$order_id', '".USER_ID."', '$pid', '$amount', '$size', '$price', '$otime')");Hmm how can USER_ID get mixed up here.....
Title: Re: Shopping cart
Post by: Stramm on August 03, 2007, 06:55:07 am
In that gray table cell you'll usually see the user name (clickable -> profile). I assume there'S a problem with your joonla bridge. With a standard install (standalone, smf) I wasn't able to reproduce your problems.
Title: Re: Shopping cart
Post by: pyrosteve on August 05, 2007, 12:49:15 am
Quick question, which I expect has been asked and answered before so sorry in advance :) I did have a search around and browsed this thread but couldnt see anything..

With the shopping cart plugin can you define which albums photos can be bought from? I have several albums which I would like to be able to sell photos from, but I also have several albums which I do not wish to sell photos from. I want all the albums to be viewable by any user group etc so cant just restrict it that way somehow..

Thanks!
Title: Re: Shopping cart
Post by: Stramm on August 05, 2007, 09:23:25 pm
from the first post in this very thread
Quote
New version (1.3 uploaded 10/07/2006)
 - added per album settings, in the shop config you can browse through the existing albums and set different prices. These override the global configuration. Also you can disable to show the shop for a certain album (checkbox).
 - If you set in the per album settings the price for a item to 0, then it won't display anymore in the shop
 - the order admin shows now the filename too
Title: Re: Shopping cart
Post by: pyrosteve on August 05, 2007, 10:58:42 pm
 :D Thank you! will give it a whirl now
Title: Re: Shopping cart
Post by: DesMas on August 07, 2007, 07:41:06 pm
@ Stramm

I manaeged to find out the problem for the missing data in the admin area (missing profile Link and email).
Well I by myself was wrong with the idea of mixed ID's ... got mixed up by myself while browsing the tables... :P

Well the reason for this problem on a bridged shop is, that the colnames are hardcoded in the photosop_admin.php around line 380ff
this works fine in the original cpg, but when the names change due bridge use, the bridge data should be used:

old code:
Code: [Select]
while($i=mysql_fetch_array($result))
{
$user_name[] = $i['user_name'];
$user_email[] = $i['user_email'];
$this_id[] = $i['id'];
$oid[] = $i['oid'];
$uid_tmp[] = $i['uid'];
$quantity[] = $i['quantity'];
$price[] = $i['price'];
$otime[] = $i['otime'];
$status[] = $i['status'];
$aktive[] = $i['aktive'];
}

new code
Code: [Select]
while($i=mysql_fetch_array($result))
{
$user_name[] = $i[$udb_var['field']['username']];
$user_email[] = $i[$udb_var['field']['email']];
$this_id[] = $i['id'];
$oid[] = $i['oid'];
$uid_tmp[] = $i['uid'];
$quantity[] = $i['quantity'];
$price[] = $i['price'];
$otime[] = $i['otime'];
$status[] = $i['status'];
$aktive[] = $i['aktive'];
}

user_name and user_email Array were filled up with non existing datas... this could never work :P
Maybe u integrate this into the next update, because it may come up someday again in another bridged system.
Title: Re: Shopping cart
Post by: Stramm on August 07, 2007, 10:23:13 pm
thanks for this fix... it def will go into the next update ;)
Title: Re: Shopping cart
Post by: Zeder on August 09, 2007, 12:11:48 am
Hello,
Where would I change the USD to CND funds?
Also, is there a way to add a Tax line before the Total?  I have to charge GST in Canada, 6%.
Lastly is there a link to send this to Paypal.
Cheers,
Z
Title: Re: Shopping cart
Post by: Stramm on August 09, 2007, 06:37:39 am
everything answered in this thread
Title: Re: Shopping cart
Post by: iframe on August 22, 2007, 10:57:57 am
Hey Stramm!

At first, great update.

One question about the Email-notification.
This is great, the User can look up his order in his Email.

But i want one more thing:

How can i add the "filename" of the picture to the email.

I found in photo_shop_checkout this line:

Code: [Select]
$out['text'].= sprintf("%10.10s\t", $item_id['pid']).sprintf("%15.15s\t", $SHOP_CONFIG[$item_id['id']]['name']).sprintf("%10.10s\t", $item_id['amount'])
.sprintf("%10.10s\t", $item_id['filename']).sprintf("%15.15s\n",$lang_photoshop['USD'].' '.$price);


This will show in the Email:

ID    Typ        Amount    price complete

 3      Photo         1            EUR  5.00


To add the "filename", i thought, to add this line will be correct:

Code: [Select]
.sprintf("%10.10s\t", $item_id['filename'])
but it wont work. What´s wrong?


        EDIT:

okay, i found a way, but not final:

in photo_shop_checkout:

at first, add the title "filename": 

Code: [Select]
$lang_photoshop['filename'])
a view lines among this code to show the filename of the picture:

Code: [Select]
.sprintf("%15.15s\t", $select_columns['filename'])
but in the email i see only one letter. the first letter of the filename. why?

Thx
Title: Re: Shopping cart
Post by: Stramm on August 22, 2007, 04:05:31 pm
http://forum.coppermine-gallery.net/index.php?topic=44417.msg211449#msg211449

Have a look at that post. It should be able to help you.
Title: Re: Shopping cart
Post by: iframe on August 22, 2007, 04:18:53 pm
Great! Great! Great!

Thx a lot!
Title: Re: Shopping cart
Post by: Troul Hawk on August 29, 2007, 10:10:07 pm
Stramm, for some reason I am unable to resolve your sandbox, and would like to get a copy of 1.3.5

Is there a link to download it from Coppermine's web?

Thanks!

edit: Found it along with the plugin_pack.  Thanks for your time!
Title: Re: Shopping cart
Post by: Stramm on September 04, 2007, 08:42:36 pm
You shouldn't use the one from the plugin pack cause it's outdated. Use the one attached to the first post in this thread.
Title: Re: Shopping cart
Post by: tyio on September 09, 2007, 05:32:13 pm
Very nice plugin because of the nice cart design , congrats :)



I ask you for a information about the coding :)


i would like to bypass the register form, because i have cancel the registration on my website. And so, when i put "pay with paypal buton", i would like to put in the order spec,  the information the buyer put (mean the n° of the picture, and the details), and not the order number :)

It's too because don't want to show the buyer the number of order i did, and too because my webhoster doesn't allow me to send mail .... So, i know paypal service is ok (and i only send .zip files, no ships :)



Thanks :)

EDIT : and what about adding some other type (more than "CD, shipping, picture") ??

:)
Title: Re: Shopping cart
Post by: Prowler9 on September 15, 2007, 03:50:39 am
Is there a way to change the TYPE of item being sold from photo to something else?
Title: Re: Shopping cart
Post by: kiama on September 28, 2007, 11:15:54 pm
problem solved
Title: Re: Shopping cart
Post by: DesMas on October 07, 2007, 04:37:04 pm
Hi Stramm, as u may remember i used your shop mod in a bridged cpg_joomla system and namaged several changes to the code :P

Well at least I made some changes that may be good for the usability and maybe u take them over into one of the next versions.
Alos I dont want to hold back changes I made, because its your plugin and u should know what others do with it :P

Situation as it was:
normally u navigate in the admin area by click on the order and another click on the order details to get back to the overview of all orders.

I changes this, by removin the onclick event and set it on a real visible linktext/button:

for the order overview:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.vmm-is.de%2Ffiles%2Fcpg_shop%2FListe_eingegangene_Bestellungen.jpg&hash=0fb89a41deccf6cc5b86155f20296852)

replaced:
Code: [Select]
echo <<<EOT
<tr>
<td class="alt1 smallfont" width="50px">
v<img src="$icon_type1[$k]" alt="" border="0" /><br>
p<img src="$icon_type2[$k]" alt="" border="0" /><br>
s<img src="$icon_type3[$k]" alt="" border="0" />
</td>
<td class="alt2">&nbsp;<a href="profile.php?uid={$uid_tmp[$k]}">{$user_name[$k]}</a>&nbsp;</td>
<td class="alt1Active" width="75%">

<div>
<span style="float:right" class="smallfont">Date: {$thisdate} - {$thistime}</span>
<div style="cursor:pointer" onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';">
{$lang_photoshop_admin['noitems']}: {$quantity[$k]} <input type="button" value="details" name="details" onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';"/><br />
{$lang_photoshop_admin['volume']}: {$price[$k]}{$lang_photoshop_admin['usd']} - {$lang_photoshop_admin['incl_ship']}
</div>
</div>
<div class="smallfont">
<span style="float:right;"><a href="index.php?file=photo_shop/photo_shop_zip&oid={$oid[$k]}">{$lang_photoshop_admin['download_zip']}</a></span><br>
<span style="float:right;"><a href="mailto:{$user_email[$k]}">{$user_email[$k]}</a></span>
<span style="cursor:pointer" onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';">{$lang_photoshop_admin['order_id']}: {$oid[$k]}&nbsp;&nbsp;- &nbsp;&nbsp;{$lang_photoshop_admin['user_id']}: {$uid_tmp[$k]}</span>
</div>

</td>
<td class="alt2" align="center" style="padding:0px"><input type="checkbox" name="orders[{$oid[$k]}]" value="{$oid[$k]}" /></td>
</tr>

EOT;
width:
Code: [Select]
    echo <<<EOT
        <tr>
        <td class="alt1 smallfont" width="50px">
        v<img src="$icon_type1[$k]" alt="" border="0" /><br>
        p<img src="$icon_type2[$k]" alt="" border="0" /><br>
        s<img src="$icon_type3[$k]" alt="" border="0" />
        </td>
        <td class="alt2">&nbsp;<a href="profile.php?uid={$uid_tmp[$k]}">{$user_name[$k]}</a>&nbsp;</td>
        <td class="alt1Active" width="75%">

            <div>
                <span style="float:right" class="smallfont">Date: {$thisdate} - {$thistime}</span>
                <div>
                {$lang_photoshop_admin['noitems']}: {$quantity[$k]} (<a href="index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';" target="_self">{$lang_photoshop['details']}</a>)<br />
                {$lang_photoshop_admin['volume']}: {$price[$k]}{$lang_photoshop_admin['usd']} - {$lang_photoshop_admin['incl_ship']}
                </div>
            </div>
            <div class="smallfont">
                <span style="float:right;"><a href="index.php?file=photo_shop/photo_shop_zip&oid={$oid[$k]}">{$lang_photoshop_admin['download_zip']}</a></span><br>
                <span style="float:right;"><a href="mailto:{$user_email[$k]}">{$user_email[$k]}</a></span>
                <span style="cursor:pointer" onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;oid={$oid[$k]}&amp;box={$box}';">{$lang_photoshop_admin['order_id']}: {$oid[$k]}&nbsp;&nbsp;- &nbsp;&nbsp;{$lang_photoshop_admin['user_id']}: {$uid_tmp[$k]}</span>
            </div>

        </td>
        <td class="alt2" align="center" style="padding:0px"><input type="checkbox" name="orders[{$oid[$k]}]" value="{$oid[$k]}" /></td>
    </tr>

EOT;

for the order details (added a new back button):
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.vmm-is.de%2Ffiles%2Fcpg_shop%2FUebersicht_Bestelldetails.jpg&hash=ac9b02b22af7003e9eb7a80d2cf6c0d7)

replaced:
Code: [Select]
echo <<<EOT

<table class=" " cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<thead>
<tr>

<td class="tablef" align="right" colspan="4">
<div class="smallfont">
{$lang_photoshop_admin['SelectedOrders']}
<select name="dowhat_item" class="listbox">
<option value="mark_payed">{$lang_photoshop_admin['mark_payed']}</option>
<option value="mark_unpayed">{$lang_photoshop_admin['mark_unpayed']}</option>
<option value="mark_sent">{$lang_photoshop_admin['mark_sent']}</option>
<option value="mark_unsent">{$lang_photoshop_admin['mark_unsent']}</option>
<option value="delete_orders">{$lang_photoshop_admin['delete']}</option>
</select>
<input type="hidden" name="box" value="{$box}" />
<input type="hidden" name="oid" value="{$oid}" />
<input type="submit" class="button" value="{$lang_photoshop_admin['go']}" />
</div>
</td>
</tr>
    <tr>
              <td colspan="5" style="padding: 0px;">
                      <table width="100%" cellspacing="0" cellpadding="0">
                              <tr>
                                      {$tabs}
                              </tr>
                      </table>
              </td>
    </tr>
</thead>
</table>
</form>
</tr></td></table>


<table class="pms_legend" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr><td><img src="{$THEME_DIR}images/s_neg.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['pos']}</td></tr>
<tr><td><img src="{$THEME_DIR}images/s_pos.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['neg']}</td></tr>
EOT;

with:
Code: [Select]
echo <<<EOT

<table class=" " cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<thead>
    <tr>

        <td class="tablef" align="right" colspan="4">
            <input class="button" style="float: left;" type="button" value={$lang_photoshop['back']} onclick="window.location='index.php?file=photo_shop/photo_shop_admin&amp;box={$box}';"/>
            <div class="smallfont">
                {$lang_photoshop_admin['SelectedOrders']}
                <select name="dowhat_item" class="listbox">
                    <option value="mark_payed">{$lang_photoshop_admin['mark_payed']}</option>
                    <option value="mark_unpayed">{$lang_photoshop_admin['mark_unpayed']}</option>
                    <option value="mark_sent">{$lang_photoshop_admin['mark_sent']}</option>
                    <option value="mark_unsent">{$lang_photoshop_admin['mark_unsent']}</option>
                    <option value="delete_orders">{$lang_photoshop_admin['delete']}</option>
                </select>
                <input type="hidden" name="box" value="{$box}" />
                <input type="hidden" name="oid" value="{$oid}" />
                <input type="submit" class="button" value="{$lang_photoshop_admin['go']}" />
            </div>
        </td>
    </tr>
    <tr>
              <td colspan="5" style="padding: 0px;">
                      <table width="100%" cellspacing="0" cellpadding="0">
                              <tr>
                                      {$tabs}
                              </tr>
                      </table>
              </td>
    </tr>
</thead>
</table>
</form>
</tr></td></table>


<table class="pms_legend" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr><td><img src="{$THEME_DIR}images/s_neg.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['pos']}</td></tr>
<tr><td><img src="{$THEME_DIR}images/s_pos.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['neg']}</td></tr>
EOT;

new in $lang_photoshop for this:
Code: [Select]
  'catalog'     => 'Katalog',
  'imagename'   => 'Dateiname',
  'back'        => 'zurück',
  'details'     => 'details',

well those changes are only marginal, but I think they bring in a good improvement for the usability :P

I also added the User email adress to the mail sent to the admin and blew up the info table send in the mail to this:
Code: [Select]
   Item ID                      Dateiname     Format     Anzahl           Preis                                       Katalog

         1                    Ina_Reimers        4x6          1       EUR  2.00                      Bilder/TestVA/Testalbum/

         5         Siegerehrung_E-Dressur        4x6          1       EUR  2.00                      Bilder/TestVA/Testalbum/
(I dont describe it, because had been done already in another thread)

also I changed the table displayed for the users in the checkout to:
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.vmm-is.de%2Ffiles%2Fcpg_shop%2FAufstellung_Bestellung_vor_OK.jpg&hash=141d1e53d5b3e3656c65e2460a791026)

Maybe u think, some of those changes are worth it to be taken over into the next code review :P
Title: Re: Shopping cart
Post by: jesphoto on October 15, 2007, 07:19:01 pm
Will I be able to sell zipped photos?.I have a oscommerce running, but I am tied of so many bugs.
Title: Re: Shopping cart
Post by: Stramm on October 15, 2007, 07:29:44 pm
I'm not sure what you mean with zipped photos... but try and you'll see
Title: Re: Shopping cart
Post by: Freder on October 15, 2007, 07:57:12 pm
I think it means 'compressed with zip'. There is no such option right now, automatic that is: you can customize the 'add to CD' option. In CPG there is the option of downloading favourites in a zip archive, but it's not connected to the shop (yet?).

BTW Is there an option to enable some items locally (per album) and have them disabled in all the rest? Will setting the global price to 0 work that way?
Title: Re: Shopping cart
Post by: Stramm on October 15, 2007, 10:19:01 pm
The admin can download orders as zip...

you can disable single albums but not items in an album
Title: Re: Shopping cart
Post by: krp on October 20, 2007, 06:24:18 pm
Hi Stramm,

can i change the place of menu for "add" button and box for prices with sizes. In my gallery it stay on the right side and make white frame around the picture very big(i use 500pix pictures), when i use black background from theme. Maybe if it stay in the middle?

   http://www.sportnitanci.com/webga/displayimage-3393.html

Thank you!

Kalin
Title: Re: Shopping cart
Post by: Stramm on October 20, 2007, 09:29:31 pm
remove unnecessary wording to make it smaller... eg there's the white heading 'Add image to shopping basket: ' on white background before the dropdown... remove it (lang/english.php) or make it smaller an you should be good
Title: Re: Shopping cart
Post by: krp on October 22, 2007, 11:22:51 pm
Thank you for support Stramm. Everything working great. Thank you again :) :) :) ;D
Title: Re: Shopping cart
Post by: JohannM on November 01, 2007, 10:15:09 am
Hi Stramm

It's nearly Christmas ... and due to your excellent mod I am managing to make some money for a change. I owe you a Christmas present all the way from South Africa, so please pm me with some contact details.

Anyway (this is not bribing) I do have a question: I am busy with a website for temp tattoos.  There are 4 Types, about 6 sizes, and 200 + designs per tattoo ... I need to sell them (per size) for a certain amount at certain prices.  How do I do this when adding the information to the shop config ?
Title: Re: Shopping cart
Post by: Stramm on November 02, 2007, 10:33:29 am
Easiest way to do that would be to add for each type all sizes.
-type 1 4x6
-type 1 5x7
-type 1 6x8
-type 1 7x9
-type 2 4x6
-type 2 5x7
-type 2 6x8
-type 2 7x9
.... that for all four types
if you look for let's say two dropdowns, one with type, the other containing the size... then this is not possible without changing a good bunch of code in nearly all files. Also db modifications would be necessary. A task that can't be done in a few minutes.
Title: Re: Shopping cart
Post by: JohannM on November 07, 2007, 03:17:54 pm
Hi Stramm

Thanx, yea, I figured it would be the only way, it will take me a while, but I guess ones it's done, it's done.

The only thing I don't like is that as soon as you add an item (or all items), it automatically adds it to all albums ... in what code can I change to NOT add it, but rather let me enable the albums for the prices as I wish ...

Thanx yet again for all your help.
Title: Re: Shopping cart
Post by: Stramm on November 07, 2007, 03:23:44 pm
to exclude certain albums from the shop functionality is a shop admin setting as well as letting certain albums override the global prices.

If you want to not exclude but rather enable the shop for certain albums you'll have to change code as you said. That code you can find in codebase.php function add_item (I think it was).
Title: Re: Shopping cart
Post by: JohannM on November 12, 2007, 08:33:08 pm
Stramm

If I want to enable discount for a user group called Agents ... how do I fix the code to ONLY give them discount based on number of pics they order ? This will be in functions.php.

Something like:

function calculate_discount($temp_price, $cd_counter){

   $discount = '';
   //variables that can be used
   //$cd_counter['photo']  number of pics for print
   //$cd_counter['cd']      number of pics on CD
   //$temp_price[1]      price for the CD
   $temp_price[0];      //price for the pics

   //just to demonstrate how to calculate a discount
   //10% on print images if user orders more than 10 pics
   
   if ((!USERGROUP) >= AGENTS)) {
   if($cd_counter['photo'] >= 0);
   
      $discount = 0.1 * $temp_price[0];
   }
   

   /*
   //or another example... 10% if the order volume is > 100USD
   if($temp_price[0] >= 100) {
      $discount = 0.1 * $temp_price[0];
   }
   */
   return $discount;
}
Title: Re: Shopping cart
Post by: Stramm on November 12, 2007, 09:32:46 pm
Looks somehow made up with some syntax errors. At least a constant USERGROUP isn't defined
You could try that instead

Code: [Select]
if (USER_GROUP == 'AGENTS') {
$discount = 0.1 * $temp_price[0];
}
Title: Re: Shopping cart
Post by: JohannM on November 12, 2007, 09:53:51 pm
Hi Stramm

Thanx for the help ... I created two groups with different discounts .... problem is that altough the calculation is correct, the total amount seems to be wrongly calculated ...

Products: 1 Design(s) ::   R  35,000.00
Agent Discount :: % :: R 5,250.00
Total: R  34,995.00

Also the percentage discount before the % sign do not show ....

Can you help please ?

Thanx in advance

Title: Re: Shopping cart
Post by: Stramm on November 12, 2007, 10:03:11 pm
this is how it should look
Quote
For print: 7 pics :: 14.00USD
Shipping :: 4.00USD
Discount :: % 1.40USD 
Total: 16.60USD

And as you can see it works pretty good.  I do not know what you've modified so I can not give you much advice.
Title: Re: Shopping cart
Post by: JohannM on November 12, 2007, 10:11:04 pm
I don't charge shipping ... can that be the problem ?
Title: Re: Shopping cart
Post by: Stramm on November 12, 2007, 10:18:22 pm
no
Title: Re: Shopping cart
Post by: JohannM on November 12, 2007, 10:19:12 pm
Stramm

The % gives the discount amount and not the percentage and the discount amount (e.g.  15% :: R 25.00 )

Is there a way to indicate the discount percentage ?
Title: Re: Shopping cart
Post by: Stramm on November 12, 2007, 10:26:16 pm
I digged around and have seen that there indeed is a problem. Will look into this tomorrow.

The percentage as you want to display it isn't known by the system. You can define the discount in the function you just modified and here you can do whatever math you like and not just using percentages (% is in my country the sign for difference, if you do not like it you can renove it - has been asked and answered before)
Title: Re: Shopping cart
Post by: Stramm on November 13, 2007, 11:15:48 am
Here's the fix for your problem. It occurs when the numbers are >= 1000. The problem was the formatted output of the numbers (eg. 12,000.00 instead of 12000.00).

In plugins/pgoto_shop/include/functions.inc.php find
Code: [Select]
$discount = number_format(calculate_discount($temp_price, $cd_counter),2);
$shipping = number_format(calculate_shipping(),2);
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping-$discount),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
and replace with
Code: [Select]
$discount_calc = calculate_discount($temp_price, $cd_counter);
$shipping_calc = calculate_shipping();
$discount = number_format(($discount_calc),2);
$shipping = number_format(($shipping_calc),2);
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping_calc-$discount_calc),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);

edit: added number format for discount and shipping as noted by JohannM 2 posts below
Title: Re: Shopping cart
Post by: JohannM on November 13, 2007, 04:36:51 pm
Hi Stramm

Seems to me the calculations is correct now, but the discount amount is not with decimal places:

Products: 2 Design(s) ::   R  57,500.00
Discount :: % :: R  14,375
Total: R  43,125.00

Is there a way to have fixed digits (e.g. 9 number format) ?
Title: Re: Shopping cart
Post by: JohannM on November 13, 2007, 04:40:27 pm
should be:

    $discount_calc = calculate_discount($temp_price, $cd_counter);
   $shipping_calc = calculate_shipping();
   $discount = number_format(($discount_calc),2);
   $shipping = number_format(($shipping_calc),2);
   $tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping_calc-$discount_calc),2);
   $cd_price = number_format($temp_price[1],2);
   $photo_price = number_format($temp_price[0],2);

That is fixed now ...

Just wonder about fixed length of digits ...
Title: Re: Shopping cart
Post by: Stramm on November 13, 2007, 05:59:36 pm
http://php.net/manual/en/function.number-format.php
http://php.net/manual/en/function.money-format.php
Title: Re: Shopping cart
Post by: JohannM on November 14, 2007, 03:17:10 pm
Stramm

Just a question ... if you add an item to the shopping basket, for a brief moment the page refresh with only the footer (Powered by Coppermine) etc.

Is there a way to add a line there for e.g. "Adding product to basket" ? And where in what file (line) can I add this ?

Check out my new site:  http://www.temp-tattoos.co.za/agents/

I'm still doing some changes ...
Title: Re: Shopping cart
Post by: Stramm on November 14, 2007, 03:41:18 pm
yah, I always wanted to add this... started to code it but never finished. Somehow I had implemented it but, hmmm... I didn't like it. The remainings you'll come across when I show you what to do.

plugins/photo_shop/codebase.php find
Code: [Select]
photoshop_refresh($referer);replace with
Code: [Select]
photoshop_refresh($referer, $lang_photoshop['added']);

plugins/photo_shop/include/functions.inc.php
replace the already existing function photoshop_refresh with this new one
Code: [Select]
function photoshop_refresh($redirect, $txt='') {
global $lang_info;

            pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"0;url={$redirect}\">");
            if($txt !='') {
msg_box ($txt, $txt);
}
            pagefooter();
            ob_end_flush();
exit;
}
Title: Re: Shopping cart
Post by: JohannM on November 14, 2007, 08:48:29 pm
Hi Stramm

I see what you mean, altough I like it.

But I would like to change the actual message you see inside the table (e.g.  Item added to shopping basket) and the table/page heading something like "REFRESING" ...

I played a bit with the code with no luck ....
Title: Re: Shopping cart
Post by: Stramm on November 14, 2007, 11:36:41 pm
in the lang file... added
change that
Title: Re: Shopping cart
Post by: JohannM on November 19, 2007, 11:01:03 pm
Hi Stramm

I am full of questions (one per thread):

How can I include a function and button in the admin page to resend an specific order (email) to the specific user and admin ?

Thanx in advance 
Title: Re: Shopping cart
Post by: Joachim Müller on November 20, 2007, 04:41:54 pm
I am full of questions (one per thread):
Then why do you ask your questions in this very thread? The policy says "one question per thread". It doesn't say "one question per posting". Asking for new features in the announcement thread is not a bright idea.
Title: Re: Shopping cart
Post by: JohannM on November 20, 2007, 07:14:06 pm
Sorry then

I supposed I thought this question is related to the Shopping cart .... where should I post the question then ?

Thanx
Title: Re: Shopping cart
Post by: Joachim Müller on November 21, 2007, 08:16:49 am
Request new feature on the plugin board (http://forum.coppermine-gallery.net/index.php?board=53.0), with reference to the announcement thread of the plugin that you want to see improved. Of course there's no guarantee that someone is going to look into your request.
Title: Re: Shopping cart
Post by: mattocean on November 23, 2007, 04:22:16 pm
Dear Stramm,

thanks for this great plugin. I have just installed it and would like to ask you about some things...

1. Is there any possibility to set up just - Print order - option? I want just, that my users orders print from my photos in different sizes and after I did the print send it to the buyer. How can I set up a - Order Print - style photo shop?

Something like this... ist this the Photo Shop plugin or others?

[Edit GauGau] Hotlinked image replaced with attachment [/Edit]

2. I wanted to upgrade the language file to my language but there is a problem, my language has some special characters like - é, ű, ő, í - and the words arn't uppers correctly. How can I include the special characters for my language?

Thanks for your answer.

Regards,
Matt
Title: Re: Shopping cart
Post by: Stramm on November 23, 2007, 06:32:15 pm
save the lang file as utf-8
in the shop's config remove the entries for 'CD'
Title: Re: Shopping cart
Post by: cprphotography on December 04, 2007, 04:44:22 am
hello all, I'm really having a very hard time aading shopping cart to my gallery, can some one help me. nothing seem to be going right. rather than posting here can you e-mail me better. here is my e-mail nycfotografo@yahoo.com. i really will love to have this working, i can also call anyone in the usa fi you rather.
check my gallery http://cprphotography.com-h.com/album/displayimage.php?album=2&pos=3.
Title: Re: Shopping cart
Post by: Stramm on December 04, 2007, 10:44:05 am
We do not give support by email, for that we have the forum.
As far as I can see the shopping cart seems to work fine.
Title: Re: Shopping cart
Post by: darkpollo on December 09, 2007, 01:02:13 pm
Hi Stramm, this is a great plugin!

Well i need some modifications, but i am not sure where (and what :P) to change in the code to make them, could you help me?

I have a gallery of art, and i am using CPG to show the pictures and maybe sell anyone. :)

I have diferents albums to diferent category of art in cpg (orders by size), but this pixtures can be selled only one time. And also, the picture has ther size, and it is impossible to change it.
So, i need two things, i am not sure if it is difficult or not, but i will try to make them.
- First of one, i need that when anyone come into an album with a size they could only select that size to buy, not all the prices list.I mean, I have an album in cpg with all the pixtures 35x45, i want that the shop plugin only shows that option to buy in that albums items, not the 4x7 option. I hope you understand me. I think this cannot be so dificult as you have diferente prices for albums... just remove items for them...
- Second i need is more dificult. I need a posibiliy to select what pictures can be selled and other that cannot be, because when i sell a picture i will keep it on the gallery, but i cannot sell it again. :)

I hope you could help me to edit the code. Thank you very much for the plugin.

I have translate into spanish the lang file, but changing some words to adapt to my web. It is attached on this post also.

Title: Re: Shopping cart
Post by: Stramm on December 09, 2007, 01:26:12 pm
Your desired modification to show only one specific picture size for a certain album surly is possible. You'll have to add another field to the shops config table, then modify the config/ admin backend to be able to mark one item per album (save in the above created field).
Then modify the add-item function to only show the above marked items.

For that you need to add a field to the pictures table cause the shop is not prepared for 'per item' usage but for per 'album' usage. That field you need to check again in the add_image function if set, if set you don't display the shop's dropdown. If you sell an item, you mark it as sold in the admin... here you need to add code that add's to the pictures table in the above mentioned field.
Title: Re: Shopping cart
Post by: darkpollo on December 09, 2007, 01:48:03 pm
Your desired modification to show only one specific picture size for a certain album surly is possible. You'll have to add another field to the shops config table, then modify the config/ admin backend to be able to mark one item per album (save in the above created field).
Then modify the add-item function to only show the above marked items.

For that you need to add a field to the pictures table cause the shop is not prepared for 'per item' usage but for per 'album' usage. That field you need to check again in the add_image function if set, if set you don't display the shop's dropdown. If you sell an item, you mark it as sold in the admin... here you need to add code that add's to the pictures table in the above mentioned field.

Sound easy :P
I will come back if stop on something im not sure how to solve. :D
Thanks!
Title: Re: Shopping cart
Post by: darkpollo on December 10, 2007, 04:56:56 pm
Hi.
I managed to do the things in a easy way.

For the first thing, i will use only a generic type of price, as i have my pictures in diferents albums, all with the same price, so editing the price of each album seem easy. 

Also, i will use one of the custom profile data of each pictures to mark them as sold, and thsi way i did not touch the pictures database. :) I will onli need to add code to the add_image function.  :)

With that solution i need to make a custom price list, because each album has diferent prices.
It is possible to make an option to the plugin to add a custom price list?

Thanks
Title: Re: Shopping cart
Post by: PerformanceImagery on December 31, 2007, 05:26:24 pm
Hello Stramm,

  Thank you for writting and supporting this plug-in for all of us non coders out here.  It really works well and is quite versable.  So far I've been able to get it to do every thing I need to to.  You really should have a way for us to send you donations to help offset you hard work.  I do have some layout questions that I'll post in the plug-in forums, but wanted to say thank you in this thread!
Title: Re: Shopping cart
Post by: t.hagoort on January 17, 2008, 08:51:27 pm
Is there a possibility that customer won't register due checkout, but only fill in there name and e-mailadres (required)?

greetz thijs
Title: Re: Shopping cart
Post by: Stramm on January 18, 2008, 07:52:50 am
you'd need to modify a bunch of code in checkout.php... but why, change your registration form to only show name, email and nick. Then that's basically what you require.
Title: Re: Shopping cart
Post by: t.hagoort on January 18, 2008, 11:55:35 am
Do you mean the registration form of joomla or photo_shop?
Because I don't want any users on my site. it's a free public site and when the order i don't want messages like: username already exist.

thanks for your help!
Title: Re: Shopping cart
Post by: Stramm on January 18, 2008, 12:20:08 pm
If you're bridged, then your bridge apps registration form should made use of. To save the user data is a necessary process. Creating just another user table while one already exists is redundant. Therfore the most logic thing to do
id to use the existing structure. If you do not want your users to be able to chose a username you probably can set it the same as the user id (a unique number). Means additional coding.
Title: Re: Shopping cart
Post by: rterburg on January 19, 2008, 08:09:48 pm
I have tried to install the plugin into my Coppermine 1.4.14 gallery bridged with the Mehdi Bridge (http://www.mehdiplugins.com/misc/index.htm).
After installing I get the message "critical error retrieving data from the database and my gallery isn't working anymore. Can someone help me to solve this problem? I use the latest  shopping card version.

Thanks for your reply.

Regards,

Ron
Title: Re: Shopping cart
Post by: PerformanceImagery on January 20, 2008, 03:03:23 pm
Ron, I"m no coder, but I use Joomla and that bridge so maybe I can help you out.  Please give a little more details.  Was your Gallery and Joomla sites up and running by them selves before bridging them?  Did the bridging seem to go alright when you when through the steps?
Title: Re: Shopping cart
Post by: vfx on January 20, 2008, 05:13:08 pm
Hi Stramm.
Thanx for the plugin!

My gallery is only my own private gallery. I don't have any users and disabled "Allow new user registrations" in CPG config. And so i need some problems solutions.

- The best way is to have a simple checkout form without a new users registration in gallery (only name, e-mail, ... for sending pictures). Is it possible to make?

- In case of a new user registration (as is), is it possible to disable auto login user/customer after filling registration form and checkout?

- I have made a new user group "customers" without any rights, but after checkout registration procedure all new users membership is "Registered". Where can i change it?


Can you help me?
Thanx in advance.
Title: Re: Shopping cart
Post by: jaap_cpg on January 24, 2008, 09:31:08 am
Hello Stramm,

Thank you for this wondering tweak to Coppermine.
Im not very handy with php so thats why I like Copper + your tweak very much.

Now my question is: Where can I change the sizes and price?
Its allready in EUR, but if I edit the basic.sql file (so change the size and price) nothing happends after I uploaded the new edits.
Maybe I do something wrong, or do I have to change more files?

Thank you!
Title: Re: Shopping cart
Post by: Stramm on January 24, 2008, 11:36:58 am
Changing EUR has been asked and answered within this thread... done modifying the lang file.
The prices and sizes you can edit in the shops config (see the first post in this thread).
Title: Re: Shopping cart
Post by: jaap_cpg on January 24, 2008, 12:02:01 pm
ohhhh, thanks I just thought I had to make the edits in notepad but its easy to do online.

many thanks!
Title: Re: Shopping cart
Post by: rterburg on January 25, 2008, 08:17:35 pm
Ron, I"m no coder, but I use Joomla and that bridge so maybe I can help you out.  Please give a little more details.  Was your Gallery and Joomla sites up and running by them selves before bridging them?  Did the bridging seem to go alright when you when through the steps?

Thanks for your reply. Somehow the tables were installed into the wrong database (the database of Joomla instead of the Coppermine database). So, problem solved.  ;D
Title: Re: Shopping cart
Post by: rterburg on January 25, 2008, 11:04:48 pm
Hi Stramm.
Thanx for the plugin!

My gallery is only my own private gallery. I don't have any users and disabled "Allow new user registrations" in CPG config. And so i need some problems solutions.

- The best way is to have a simple checkout form without a new users registration in gallery (only name, e-mail, ... for sending pictures). Is it possible to make?

- In case of a new user registration (as is), is it possible to disable auto login user/customer after filling registration form and checkout?

- I have made a new user group "customers" without any rights, but after checkout registration procedure all new users membership is "Registered". Where can i change it?


Can you help me?
Thanx in advance.

Hi vfx,

You can configure the user rights in Coppermine. At the user groups you can set at the "registered group" the "Public albums upload" and the "Personal gallery" allowed to "No".

Good luck,

Ron
Title: Re: Shopping cart
Post by: jaap_cpg on January 28, 2008, 11:09:51 am
Ok I did a preview order to myself but once I want to confirm I have this message:

"Bedankt voor uw bestelling.
Een email ter bevestiging is naar u verzonden!
Zodra uw betaling is ontvangen wordt uw bestelling afgehandeld!
--->This is just a demo cart, do not process any payment. Do not paypal me any funds!!!!<---"

Aspecially the last line... what do you mean with this and how do I get it out?
Title: Re: Shopping cart
Post by: Stramm on January 28, 2008, 12:16:10 pm
It's exactly what it say... I'm a demo cart, do not paypal me funds as I won't send photos back in return...

To remove that line edit the lang file (as usual)
Title: Re: Shopping cart
Post by: LeAnnSmith on February 19, 2008, 05:30:20 am
Coppermine 1.4.12 has an include/archive.php with different function names and class name than what is used in photo_shop_zip.php.  Class zipfile -> zip_file, functions: addfiles -> add_files, filedownload -> download_file.  After I made these changes in photo_shop_zip.php and clicked on "Download zip" in the Shop tab of the admin, I just got a blank white page.
????

Also, (and less important) when you include the url to the orders page in the "You got a new order" email, it does not work unless you are already logged in.
Title: Re: Shopping cart
Post by: ib2loud on February 23, 2008, 04:01:28 am
Thank you for an amazing add-on to my gallery! I can only hope I get some business as the car show season starts up soon.
Title: Re: Shopping cart
Post by: Stramm on February 23, 2008, 10:42:25 am
Coppermine 1.4.12 has an include/archive.php with different function names and class name than what is used in photo_shop_zip.php.  Class zipfile -> zip_file, functions: addfiles -> add_files, filedownload -> download_file.

This has been changed in CPG ~ 1.4.10... needs correction

Quote
Also, (and less important) when you include the url to the orders page in the "You got a new order" email, it does not work unless you are already logged in.
Yes, only the logged in admin should be able to view all orders. You get the notification. If logged in, the link works OK and you'll see the admin. If you're not logged in, then of course the system sees you as guest and you do not have permission to view admin pages. In that case you get a permission denied error.
Title: Re: Shopping cart
Post by: LeAnnSmith on February 26, 2008, 03:20:41 am
Coppermine 1.4.12 has an include/archive.php with different function names and class name than what is used in photo_shop_zip.php.  Class zipfile -> zip_file, functions: addfiles -> add_files, filedownload -> download_file.  After I made these changes in photo_shop_zip.php and clicked on "Download zip" in the Shop tab of the admin, I just got a blank white page.

TO FIX:  -TESTED AND WORKS!
Remove the last six lines of code in photo_shop_zip.php from "$flags['storepath'] = 0;"  to: "$zip->download_file(...".
Add the following (notice the new trailing 's' for storepaths):

$flags['storepaths'] = 0;
$flags['basedir'] = "./{$CONFIG['fullpath']}";
$flags['inmemory'] = 1;
$flags['recurse'] = 0;
$zip = new zip_file(photoshop_pics_oid_'.$_REQUEST['oid'].'.zip');
$zip->set_options($flags);
$zip->add_files($filelist);
$zip->create_archive();
ob_end_clean();
$zip->download_file();
Title: Shopping cart database query error -fixed
Post by: LeAnnSmith on February 28, 2008, 06:30:38 am
codebase.php, photoshop_add_item() will cause a database critical error when you perform any search (issue : query includes 'WHERE aid=search')  Ad the following before the first line of code to fix:

   if( strcmp($pic_data['aid'], "search") == 0)
   {
      return $pic_data;
   }
Title: Re: Shopping cart
Post by: artefatta on March 03, 2008, 04:53:59 pm
 ???
I installed your plugin and my site is not accessable anymore!!
www.artefatta.biz

Sorry false allarm  ::) it taked some minutes, but now it works.

Question:
As there is a gallery of real art, all pieces are unique.
Could my users put the price in one of user fields and your script grab it from there?
Title: Re: Shopping cart
Post by: ib2loud on March 03, 2008, 04:56:46 pm
???
I installed your plugin and my site is not accessable anymore!!
www.artefatta.biz

I tested it out and it seems to be working fine on my side.
Title: Re: Shopping cart
Post by: Stramm on March 03, 2008, 08:41:42 pm
???
I installed your plugin and my site is not accessable anymore!!
www.artefatta.biz

Sorry false allarm  ::) it taked some minutes, but now it works.

Question:
As there is a gallery of real art, all pieces are unique.
Could my users put the price in one of user fields and your script grab it from there?


I'd say that's probably possible. It however would mean recoding a good bunch of the plugin.
Title: Re: Shopping cart
Post by: artefatta on March 04, 2008, 09:31:58 am
I'd say that's probably possible. It however would mean recoding a good bunch of the plugin.

Oh, I guess that means you should write a new plugin for such a possibility?
May be there is already one that fits my needs and I don't know it because I'm a newbie??
Title: Re: Shopping cart
Post by: Stramm on March 04, 2008, 09:36:28 am
I do not know of a plugin/ mod that's exactly what you're looking for.
This plugin needs to be rewritten (some parts of it), to do what you want. That's not trivial and means a lot of work.

 
Title: Re: Shopping cart
Post by: pawankodakandla on March 13, 2008, 08:16:17 am
I installed shopping cart recently...

anyway whenever a new item is added to the cart (clicking on add button), the browser is not redirecting to the last page, it is working with a classic theme, im using a custom made theme, did i miss something... please help me, if i have posted this thread in a wrong section, excuse for the same.

In case the above issue is mentioned already in the post, then please let me know!!!

here is the link: http://www.adityasphotos.com
Title: Re: Shopping cart
Post by: Stramm on March 19, 2008, 09:07:03 pm
hmmm, works just fine for me
Title: Re: Shopping cart
Post by: mfaizalar on March 21, 2008, 04:17:01 am
Hi Stramm,

My photoshop doesn't show correct total price in 'myorders'. At checkout stage, the total price still ok but when it goes to myorders; Shipping & discount excluded from the total price calculation.

As you can see in the attachments, the total price at cart and checkout stage is RM7.45. But it was checked out and I open myorders page it shows total price as RM0.45 only (excluded shipping cost of RM7.00). What went wrong? I didn't make any changes on the coding so far.

Appreciate your kind help  ;)
Title: Re: Shopping cart
Post by: Stramm on March 21, 2008, 09:40:05 am
Which version of the cart do you use?
Title: Re: Shopping cart
Post by: mfaizalar on March 21, 2008, 01:30:54 pm
Which version of the cart do you use?

I'm using photo shop ver 1.3.5 and CPG ver 1.4.16
Title: Re: Shopping cart
Post by: Stramm on March 24, 2008, 09:16:27 pm
I've a ver 1.3.6 ready for some weeks now. Just forgotten to post it. If I'm not totally wrong, it fixes that.
Will upload it the next days.
Title: Re: Shopping cart
Post by: mfaizalar on March 25, 2008, 04:34:12 am
Thx Stram!! You are absolutely my life saver  ;)
Title: Re: Shopping cart
Post by: Stramm on March 25, 2008, 01:03:09 pm
New (maintenance) version (1.3.6 uploaded 3/25/2008)
Title: Re: Shopping cart
Post by: mfaizalar on March 27, 2008, 12:27:09 pm
Hi Stramm,

Looks like we have another prob. Anyone can see ur items in cart (not yet checkout). How can we restrict this to let the photos in cart viewable by the owner only? Also, other people can checkout whatever in the cart.

You can try to simulate it by put some photos in cart then logout. After that try login using other acc and you'll see there's photos in ur cart even though it's ur first time login. I've checked this in ver 1.3.6 and thing is still there.
Title: Re: Shopping cart
Post by: Stramm on March 27, 2008, 12:54:37 pm
That's not a problem... but expected behaviour
All items in the cart aren't stored in the database but only in a session and cookie. The cookie is independent if you're logged in or not. It's computer based. You as owner of your local PC will be recognized.

Advantage is, (main reason why you do it this way) that a user can browse your gallery as guest. When he checks out a login is required. Doing it your way, all items in the basket would be lost and the user needs to go shopping again.

Verify this with clearing your cookies and you'll see, the basket is empty. Also try to login from another computer.
 
Title: Re: Shopping cart
Post by: hwilliam on March 31, 2008, 06:26:44 am
I am 70 years old and I guess a little stupid? But where in the Photo Shop plugin is the file that contains the prices? I have it working and linking to my paypal account instead of the test account,but I can't seem to find the file with prices.....

naturephotographbybyhwilliam.com/newgallery/
Title: Re: Shopping cart
Post by: Stramm on March 31, 2008, 07:56:59 am
prices are stored in the MySQL database. Here again the relevant part from the first post of this thread

Quote
In the admin menu click 'Shop'. You'll see the shop admin. It's empty cause there are no orders yet. Click 'Config' (top, right side... just below 'Shop' in admin menu). Here you set up prices and names for your items. You can sort as well here for the display in the dropdown above each picture.
Title: Re: Shopping cart
Post by: hwilliam on March 31, 2008, 05:14:05 pm
Thanks for the quick response - that solved my problems - Is there a way to put a space in the drop down menu between USD and the price? Instead of USD40.00, I'd like 40.00 USD - No big deal..your plugin is the answer to a year's dream!
Title: Re: Shopping cart
Post by: Stramm on March 31, 2008, 07:36:51 pm
for that you'd need to modify codebase.php a little bit
find
Code: [Select]
$html.="<option value=\"{$value['id']}\">{$value['name']} - {$lang_photoshop['USD']}{$value['price']}</option>";
replace with
Code: [Select]
$html.="<option value=\"{$value['id']}\">{$value['name']} - {$value['price']} {$lang_photoshop['USD']}</option>";
Title: Re: Shopping cart
Post by: mfaizalar on April 02, 2008, 05:46:33 am
Used to play around with that kind of thing before. Interesting and gud experience lol..

for that you'd need to modify codebase.php a little bit
find
Code: [Select]
$html.="<option value=\"{$value['id']}\">{$value['name']} - {$lang_photoshop['USD']}{$value['price']}</option>";
replace with
Code: [Select]
$html.="<option value=\"{$value['id']}\">{$value['name']} - {$value['price']} {$lang_photoshop['USD']}</option>";
Title: Re: Shopping cart
Post by: hwilliam on April 02, 2008, 06:18:04 am
Used to play around with that kind of thing before. Interesting and gud experience lol..


Thanks so much....works like a charm
Title: Re: Shopping cart
Post by: innstreet on April 10, 2008, 04:03:10 am
I would like to see a 'Add All' option to this plugin. This would allow visitors to add all the photos in an album to a CD.

What I really need is a plugin that will allow a visitor to purchase an entire album. An 'Add Album to Cart' button would be added next to the album thumbnail. When the visitor checkouts though PayPal they would receive a secure link to the .rar or .zip file(s) to download. Do you have any interest in creating a plugin like this?

Best Regards,

Gregor Wylie
Title: Re: Shopping cart
Post by: DingoBlue on April 10, 2008, 02:44:52 pm
I know that images can be selected and placed in a cart which is then zipped for download.  Is it possible after checkout to bypass the payment process and send the zipped file to the registered users email address?  We are not charging for images and I cannot see a way to bypass the "paypal" process.
Regards
Title: Re: Shopping cart
Post by: Stramm on April 11, 2008, 02:27:34 pm
I would like to see a 'Add All' option to this plugin. This would allow visitors to add all the photos in an album to a CD.

What I really need is a plugin that will allow a visitor to purchase an entire album. An 'Add Album to Cart' button would be added next to the album thumbnail. When the visitor checkouts though PayPal they would receive a secure link to the .rar or .zip file(s) to download. Do you have any interest in creating a plugin like this?

Best Regards,

Gregor Wylie

actually I have slightly other plans for improving this plugin
- Paypal IPN support
- cd, print or downloadable items
- if download, a pwd protected folder will be created and the password mailed to the user.
- size of the 'downloadable' items can be set (eg. 640px, 800px, 2048px), a resized copy will be put into the download folder
- a zip will be created in addition
- support for free items
- config backend... getting rid of gateway.inc.php
- currency can be set in config

when or if I really will go to publish it here... I can't say atm
Title: Re: Shopping cart
Post by: Stramm on April 11, 2008, 02:28:01 pm
I know that images can be selected and placed in a cart which is then zipped for download.  Is it possible after checkout to bypass the payment process and send the zipped file to the registered users email address?  We are not charging for images and I cannot see a way to bypass the "paypal" process.
Regards

please read my last post
Title: Re: Shopping cart
Post by: Sy on April 11, 2008, 07:27:30 pm
Just wanted to thank you for this awesome plugin Stramm.  Also can I suggest a "coupon" discount inclusion in the next version, if that's at all possible?
Title: Re: Shopping cart
Post by: Hot Rides on April 14, 2008, 07:32:58 pm
  Critical error   
 
There was an error while processing a database query 

installed photo shop 1.3.6

on a bridged 1.4.17 with the modpak

used plugin manager, clicked install button, next page showed changes made, clicked ok, got error


site; www.hot-rides.net/coppermine/

enabled debugging;
While executing query "SELECT * FROM cpg_shop_config ORDER BY priority ASC" on 0

mySQL error:


need help fast!!!
Title: Re: Shopping cart
Post by: Stramm on April 14, 2008, 09:12:30 pm
That's not much of MySQL tells about the error... so blind guessing

remove the ASC
plugins dir... include/init.inc.php
find
Code: [Select]
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_CONFIG']} ORDER BY priority ASC");
replace with
Code: [Select]
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_CONFIG']} ORDER BY 'priority'");


Title: Re: Shopping cart
Post by: Hot Rides on April 15, 2008, 03:58:46 pm
tried that, no effect

moved the troubleshooting here to not clogged up this already enormus thread

http://forum.coppermine-gallery.net/index.php/topic,51906.0.html
Title: Re: Shopping cart
Post by: hwilliam on April 16, 2008, 05:50:54 am
Just installed Coppermine and Photoshop plug in....followed instructions for installation of photoshop. when I go to checkout all I get is the header "checkout" and nothing else. updated database...any ideas?
Title: Re: Shopping cart
Post by: Stramm on April 16, 2008, 08:15:42 am
No, maybe when I can see the site...
Title: Re: Shopping cart
Post by: hwilliam on April 16, 2008, 04:50:18 pm
Duh.....when you get old you get stupid....the whole thing was there when I scrolled to the bottom......(I'm having a problem that I guess I need to go to another thread, but on Firefox the site looks totally different and none of the themes seem to work, however on Explorer everything is as it should be) sorry...but, question.is there a paypal addition to this plugin? I really need to have clients to be able to pay that way..
Title: Re: Shopping cart
Post by: Stramm on April 16, 2008, 04:53:05 pm
a basic implementation is supported, read the very first post of this thread for more info
Title: Re: Shopping cart
Post by: ib2loud on April 17, 2008, 05:45:08 am
Weird question that may have been asked before. I have two instances of coppermine running (not the best way to do this but it works for me). What I have is one photo gallery with the cart and a gallery for merchandise with the cart.

Everything works fine except when you add something to one cart, it tries to add it to the other but gives a database error when you view either cart after viewing both galleries. Confusing I know and I thought maybe I just need to change cookie names but that didn't seem to fix it.

Thanks for any help and thanks again for the great add-on.
Title: Re: Shopping cart
Post by: hwilliam on April 17, 2008, 06:16:54 am
I see the files in the folders, but are there instructions somewhere on installing the paypal portion of the plug in?
Title: Re: Shopping cart
Post by: Stramm on April 17, 2008, 12:09:56 pm
Weird question that may have been asked before. I have two instances of coppermine running (not the best way to do this but it works for me). What I have is one photo gallery with the cart and a gallery for merchandise with the cart.

Everything works fine except when you add something to one cart, it tries to add it to the other but gives a database error when you view either cart after viewing both galleries. Confusing I know and I thought maybe I just need to change cookie names but that didn't seem to fix it.

Thanks for any help and thanks again for the great add-on.

Db error cause the cookie stored info about pics that one gallery has but not the other. Without haveing tested I suggest (as you've already done) changing the cookies on both galleries to be different, then clear cookies and retry.
Title: Re: Shopping cart
Post by: ib2loud on April 17, 2008, 02:17:10 pm
I tried that, even with different cookie names it still does the same thing

does the plugin create its own cookie that maybe I can change the name to?
Title: Re: Shopping cart
Post by: Sy on April 19, 2008, 04:03:39 pm
Hi Stramm,
  I'm just wondering, and I'm guessing it's been asked before but the search isn't showing anything that answers my question, but when I mark an order as paid or sent is anything meant to happen, because currently it's not? :-[

Thanks for any help, and apologies if I'm being thick.

Sy
Title: Re: Shopping cart
Post by: Stramm on April 19, 2008, 04:14:12 pm
yes and no... this was introduced to be able to use eg. paypal IPN or some CC gateways that send back payment info. IPN marks the item as paid, you know you can send them (or as in some custom work, create a download folder and copy resized versions of the original image there).
On my demo site you can eg. 'buy' a 'free download'. The free download is without watermark in a smaller resolution. Gets placed into your download folder and you get an email with your password. And of course it's getting marked paid, if the download image's getting cretaed, it's marked paid.

As it is now, it's a reminder for you. Nothing less, nothing more.
Title: Re: Shopping cart
Post by: Sy on April 20, 2008, 09:39:52 am
Hi,
  Thanks for getting back to me and for the info.  A manual reminder is fine for me...now I just need something to remind me to set the manual reminder PMSL ;).

Thanks again,

Sy
Title: Re: Shopping cart discounting
Post by: Gephri on April 22, 2008, 01:24:15 am
Stramm's Shopping Cart is a beautiful mod - thanks!
Finishing up on a few trial runs with PayPal as the payment processor.
Discovered two things:
1) how to fix the discount percentage that shows up as 10.5% when the coding calls for 10%
includes/functions.inc.php
Code: [Select]
//another example... 10% if the order volume is > 100USD
if($temp_price[0] >= 100) {
$discount = 0.1 * $temp_price[0];
}

2) PayPal does not show the discount when the order is processed.

Any ideas?
Title: Re: Shopping cart
Post by: Stramm on April 22, 2008, 10:03:08 am
PayPal again changed things. This time they do not allow 'handling_cart' to have a negative value (I used that as a bundeled value for discount and shipping). Means if you only use a discount, it's < 0 and therefore invalid. Checking the paypal forums it seems they plan to introduce discounts this year... when... no clue.
As a workaround it may be possible to introduce a 'discount item', no global cart var, but a true item. Maybe it's possible to give that a negative value. If that all isn't working, then the only way is to step back a shop version and use only a 'one total price' paypal checkout.

Title: Re: Shopping cart
Post by: Gephri on April 22, 2008, 10:19:42 am
Thank you very much for the thorough explanation.
If I had the skills to code a solution - I would.  But alas I but a newbie.
Title: Re: Shopping cart
Post by: Stramm on April 23, 2008, 09:23:08 am
So I did try to send negative values to paypal as an item... server doesn't accept this, as one of the paypal guys said in the forums http://www.paypaldeveloper.com/pdn/board/message?board.id=basicpayments&thread.id=1688&view=by_date_ascending&page=1

At the moment it's not possible to use discounts together with paypal. Except you calculate them before sending the data to paypal. Means, you discount each item and send that data... there may occur a rounding error so the total may differ (~ 1-2 cent). That's cause the shop discounts the total and not each item.
Or you don't send data of each item to paypal but just the discounted total.

Still paypal won't show the discount and not the initial invoice. If the paypal guys add that feature (as said in the thread) I'm going to implement it again.

Title: Re: Shopping cart
Post by: Gephri on April 23, 2008, 09:47:24 am
Has anyone figured how to add a third category to "prints" and "cd".  I'd like to also give users the chance to buy the photo's from a gift item category in the drop down menu.
Title: Re: Shopping cart
Post by: Stramm on April 23, 2008, 09:51:57 am
Rename the categories to 'cds' and 'other'
Title: Re: Shopping cart
Post by: Gephri on April 23, 2008, 11:05:42 pm
I understand the solution - but it would be helpful to have four categories (photos, cds, gifts, photo books).

The new gift category would be like photo category - single item transactions.
The new photo books category would be like cd category - multiple pictures within transaction.

So I was hoping for a little direction on copy/change/paste coding and mysql.

Others probably would benefit from this too.

Happy to help if any is needed
Title: Re: Shopping cart
Post by: Stramm on April 24, 2008, 08:34:50 am
Yes, difficult. And imo not necessary. That's the only cart I know having two categories. The only plan I had was a config option to disable the cd cart.
Title: Re: Shopping cart
Post by: Gephri on April 24, 2008, 08:44:12 am
Looks like I was updating my post - when you made yours.
ok - understand, it's difficult.
maybe I'll take a stab at it... stand back for safety!
Title: Re: Shopping cart
Post by: Gephri on April 24, 2008, 11:02:13 pm
I've been replacing the CD option for customer to PhotoBooks.
All has worked except for the checkout page that shows the items as "CD" rather than PhotoBook.

For some reason - I just can't find where to change that.  Can you point me to it?
Title: Re: Shopping cart
Post by: Stramm on April 26, 2008, 06:55:09 pm
Make a screenshot and mark what you mean
Title: Re: Shopping cart
Post by: Gephri on April 27, 2008, 07:26:21 am
thanks for taking a look Stramm.  you'll see the term "photobooks" being used where CD had been - so that customers can load multiple images to buy a photobook.

But I need to replace the term "CD" that populates the "Type" field on the checkout page
Title: Re: Shopping cart
Post by: Gephri on May 01, 2008, 07:56:47 pm
Stramm - can you see the screen shot?
Title: Re: Shopping cart
Post by: Stramm on May 01, 2008, 08:08:54 pm
yes, can see it...
in photo_shop_checkout.php find
Code: [Select]
<td>{$item_id['id']}</td>
and replace {$item_id['id']} with the text you need (photobooks)
Title: Re: Shopping cart
Post by: Gephri on May 01, 2008, 08:47:12 pm
yup - thanks Stramm!
Title: Re: Shopping cart
Post by: oderycke on May 02, 2008, 10:15:04 am
Hello Stramm

I agree with everybody, you made a tasty and usefull plug-in  :)

I installed latest version 1.3.6 and made some tests.

Using the Paypal checkout, I had a mistake in the total amount of the order transferred to paypal.

There was a cd of 25 pictures in the purchases, and what has been transferred to paypal with the per item list, is the price of the CD attached to each picture of it. The CD is 50€, so it made a total amount for paypal of 25*50€ = 1250€ instead of 50€ !

Guess there is something to change in the checkout process  ???

Cheers
Olivier
Title: Re: Shopping cart
Post by: JohannM on May 06, 2008, 07:48:13 pm
Hi Stramm

Thanx to u my site is cooking with some orders ( www.youth-sport-fotos.com )

Just one question:  In admin mode, we have to options:  1) Current Pending Orders and 2) Archived Orders.

How can I add "cancelled" or "deleted" orders ?

Thanx 'n million

Jo
Title: Re: Shopping cart
Post by: Stramm on May 06, 2008, 08:04:26 pm
There's no status id for canceled introduced atm. That needs to be coded.
What do you mean with 'deleted' orders? If you delete orders from within the admin panel, they get marked 'deleted' and just rendered invisible. With a tool like phpmyadmin you still can recover these orders.

It's a lot of work I'm afraid... search the code for 'box' and you'll find everything you'll have to change.
Title: Re: Shopping cart
Post by: oderycke on May 09, 2008, 09:33:27 pm
Hello Stramm,

I found out how to correct the price calculation transferred to paypal when a Cd is in the list of items.

In the photo_shop_checkout, where there is the paypal code, I just put a switch that changes when the first cd item is encountered. So only the price of the first cd item is taken into account.

here is what it looks like...

//pay with paypal
         if ($CONFIG['photo_shop_paypal_enable']) {
               $handling = $shipping_price-$discount;
               $paypal_items = "";
               $counter = 0;
               $cdswitch = 0;
               foreach ($shop_array as $key => $item_id) {
                  $pid = $item_id['pid'];
                  $amount = $item_id['amount'];
                  $counter++;
                  if ($item_id['id']=="CD") {
                     $size = "CD";
                     if ($cdswitch=="0") {
                        $price = $cd_price[1];
                        $cdswitch = 1;
                     } else {
                        $price = 0;
                     }
                  } else {
                     $size = $SHOP_CONFIG[$item_id['id']]['name'];
                     $price = $SHOP_CONFIG[$item_id['id']]['price'];

cheers
Title: Re: Shopping cart
Post by: oderycke on May 09, 2008, 09:39:28 pm
Hello again Stramm

Another point I cannot solve... on the shipping calculation.

I do not use any item ship, instead I have a per item shipping cost. Some at 0 and some with something. It concerns CD and prints.

For ie : print as a shipping cost of 1, CD as a shipping cost of 4

in the shopping cart, if I have only pictures on cd, the shipping cost of the CD (here 4) is never taken into account.
If I have a mix of prints and CD, only the shipping cost of the print is taken into account and appears well.

I cannot find out why the cd shipping cost is never taken into acocunt. I tried to look for some hours to the code, but could not find the trick.

Do you have a clue that may help me ?

Thanks
Title: Re: Shopping cart
Post by: Stramm on May 12, 2008, 02:16:03 pm
yes, initially this feature wa meant for print items to be able to overwrite the 'global' shipping price. Means CD always have the global shipping and items such as framed, printed images or maybe cups can have a higher shipping price.

To extend the functionality you'll need to modify plugins/photo_shop/include/init.inc.php
replace
Code: [Select]
while ($row = mysql_fetch_array($results)) {
if ($row['type']=='ship') {
$SHOP_CONFIG['ship'] = $row['price'];
}
    $SHOP_CONFIG[$row['id']] = $row;
}
with
Code: [Select]
while ($row = mysql_fetch_array($results)) {
if ($row['type']=='ship') {
$SHOP_CONFIG['ship'] = $row['price'];
}
elseif ($row['type']=='cd') {
$cd_shipping = max($cd_shipping, $row['ship']);
}
    $SHOP_CONFIG[$row['id']] = $row;
}
    $SHOP_CONFIG['CD']['ship'] = $cd_shipping;

This grabs the cd shipping from the db and makes it available in the function calculate_shipping() (if you assign different shipping values it'll take the highest)


I've not really tested this. Ther may be problems ...
Title: Re: Shopping cart
Post by: Stramm on May 12, 2008, 02:17:32 pm
Hello Stramm,

I found out how to correct the price calculation transferred to paypal when a Cd is in the list of items.

Thanks, good work
Title: Re: Shopping cart
Post by: oderycke on May 12, 2008, 02:49:57 pm
Hello Stramm

Thanks a lot for your answer about the shipping calculation, it did help  :)

Just tested, and now it behaves just as I wanted  :) :) :)

Really great !

Cheers
Olivier
Title: Re: Shopping cart
Post by: tinorebel on May 13, 2008, 02:02:54 pm
Hallo to all readers ;)

I'm using the shop and have a little esthetic question, maby someone can help.
I'm using fotogallery theme, wich hase a column on left side, this makes that last step of checkout is unproperly repersented:
If you take a look at the attached image you will understand.
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fcheckout.jpg&hash=e64dea802cd7965cc2803e36d6ec149d)
I dont know where I can solve this.
If someone point's me in right direction will be great! :D
Title: Re: Shopping cart
Post by: Choobie on May 16, 2008, 09:33:16 am
Easiest way to do that would be to add for each type all sizes.
-type 1 4x6
-type 1 5x7
-type 1 6x8
-type 1 7x9
-type 2 4x6
-type 2 5x7
-type 2 6x8
-type 2 7x9
.... that for all four types
if you look for let's say two dropdowns, one with type, the other containing the size... then this is not possible without changing a good bunch of code in nearly all files. Also db modifications would be necessary. A task that can't be done in a few minutes.

You insert this into Shop > Config area correct? Where by default your only three types are Photo, CD, and Shipping? How would you add another type? I've been looking through the codes and it seems like the types are pretty hardcoded into the plugin, or could it be as simple as creating another row in the MySQL table (_shop_config) and forcing the type to be the name you want?

Basically what I am aiming for is to have different "size sets" for different aspect ratios of photos I want to sell (2:3, 1:1, etc.). If this isn't available "out of the box" or something close to it, then I might be able to handle the additional coding if I can be pointed in the general direction. (In retrospect as I proof-read this post, I think I am coming to the realization that this will indeed involve a bit of adding onto the current shopping cart plugin).

EDIT:

Also I was wondering about the pages where PayPal redirects your customers after ordering. From gateway.inc.php:

Code: [Select]
//PayPal return URL, leave empty if you do not want to make use of the return URL
$CONFIG['photo_shop_paypal_return_url'] = '';

//PayPal cancel return URL, leave empty if you do not want to make use of the cancel return URL
$CONFIG['photo_shop_paypal_cancel_return_url'] = '';

Are you planning on writing a page for these return URLs for the next version? I feel I may need something like this for my work, and am considering writing one up. I have read through PayPal's documentation about integrating and I don't quite understand everything, but this would be a good chance for me to learn :D Under the current setup, does this plugin simply use the "Individual items to PayPal" option: https://www.paypal.com/IntegrationCenter/ic_standard_home.html#individual

And what types of security does the plugin integrate? (https://www.paypal.com/IntegrationCenter/ic_button-encryption.html) I have seen several mentions of payPal's IPN system, but this isn't active in the plug-in yet, correct?

But then in order to implement the IPN all you would have to do is have the return URL a validation script that checks the values PayPal sends, then returns it with the confirmation while posting a message to your guest that everything worked right... I'll look into it ;)

(Oh, and you also have to send a 200 OK to paypal. Can PHP handle that on its own? TO THE MANUAL!)
Title: Re: Shopping cart
Post by: wuschel_lux on May 16, 2008, 10:38:17 am
Hi all,

I have a smal problem with this great shopping cart plugin, when I use it combined with the following Mod:
- Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features...
- http://forum.coppermine-gallery.net/index.php/topic,45828.0.html (http://forum.coppermine-gallery.net/index.php/topic,45828.0.html)

Error description:
- The thumb is not longer shown in the shopping cart.

My Testgallery could be found here:
- http://www.volleyball.lu/gallery (http://www.volleyball.lu/gallery)

Can someone give me a hint? Thanks a lot in advance.

Regards, Francis
Title: Re: Shopping cart
Post by: apd183 on May 30, 2008, 06:28:29 am
I just wanted to post about a possible display bug with the latest version linked on the first post (1.3.6).  On my checkout page the total section was not right justified, and in the code it appeared that the table that contains most of the main content ended early.  On line 50 of photo_shop_checkout.php there is an endtable() that I commented out and it fixed the problem.

Code: [Select]
//start html output
pageheader($lang_photoshop['checkout']);
starttable('100%', $lang_photoshop['checkout'], 1);
//endtable();
//start all the if else
Title: Re: Shopping cart
Post by: Synthea on June 14, 2008, 06:38:38 am
I installed this on a client's website (http://www.cheastudio.com/client_proofs/index.php)
and when I go into the config and, for example, delete a line like the 4x6 photo, and hit "save new configuration"
it takes me to this page:
http://www.amywilliamsdesign.com/shoperror.jpg [Edit GauGau] Replaced hotlinked image with attachment [/Edit]
No content, just the top and bottom section is about the easiest way I can explain it.
When I click on shop, then config again, the change it made, but this kinda makes it a pain in the butt to work with.
What's going on? Thanks  :)
Title: Re: Shopping cart
Post by: Stramm on June 14, 2008, 11:14:11 am
Maybe the browser or the OS blocks meta refreshes??
Title: Re: Shopping cart
Post by: Synthea on June 14, 2008, 07:03:19 pm
Maybe the browser or the OS blocks meta refreshes??


I have another one set up on another client's website (fullofgracephotography.com) and don't have this problem.
Title: Re: Shopping cart
Post by: Stramm on June 14, 2008, 07:11:20 pm
issue with the theme?
Title: Re: Shopping cart
Post by: Synthea on June 14, 2008, 07:26:39 pm
It must be, it works when I use a default theme, but I can't for the life of me figure out what the problem is (got a migraine though, so I should step away and come back). Any possible ideas?
Title: Re: Shopping cart
Post by: Stramm on June 14, 2008, 08:00:48 pm
Maybe it's a good idea to attach your theme to your next post (zip).
Title: Re: Shopping cart
Post by: Synthea on June 21, 2008, 08:23:18 pm
Sorry I didn't come back, it was my template not the theme. I fixed it. I have a new question, my client wants to offer free shipping if picked up at her studio or a shipping fee if the package is sent directly to the client. Is this possible?
Title: Re: Shopping cart
Post by: KimberlyMon on June 26, 2008, 03:31:22 pm
Is it possible to place products from different providers?
Title: Re: Shopping cart
Post by: ib2loud on June 26, 2008, 06:41:52 pm
you can place whatever products you want
Title: Re: Shopping cart
Post by: erika_conn on July 01, 2008, 02:49:57 am
http://ceconn.com/photo_gallery

I thought I was doing great and then this happened.  Following your instructions, I added {USER_NAME}
{SITE_ID}
{ORDER_ID}
{PRICE}
{ADMIN}

in the lang/english.pnp file.  Now I get this error when signing in:
Parse error: syntax error, unexpected '{', expecting ')' in /home/cecon46/public_html/photo_gallery/lang/english.php on line 1504

Also, the saved english.php file now reads in part: $lang_photoshop_email_admin = <<<EOT
Hello {ADMIN},

{USER_NAME} just made an order on your site {SITE_NAME}. The id of that order is {ORDER_ID} and the total value {PRICE}.
<a href="{LINK}index.php?file=photo_shop/photo_shop_admin">Click to go to the order manager</a>

This looks right to me but what do I know?  Now I can't even sign in to my site. 

What did I do wrong?
Title: Re: Shopping cart
Post by: Nibbler on July 01, 2008, 03:13:53 am
Attach the file to your next post and we can tell you.
Title: Re: Shopping cart
Post by: Stramm on July 01, 2008, 08:07:25 am
use the lang file in the plugins directory... plugins/photo_shop/lang/english.php and not lang/english.php
Title: Re: Shopping cart
Post by: erika_conn on July 01, 2008, 01:00:11 pm
my url (http://ceconn.com:2082/frontend/x3/filemanager/editit.html?file=english.php&fileop=&dir=%2Fhome%2Fcecon46%2Fpublic_html%2Fphoto_gallery%2Fplugins%2Fphoto_shop%2Flang&dirop=&charset=&__cpanel__temp__charset__=iso-8859-1&baseurl=&basedir=)

Thank you for your quick response.

I also moved the files as per instructions "Finally move the images from the archive (folder images_to_move) to your themes images directory"

Just to let you know, I have the latest plugin and the latest Coppermine.
I'm not sure that link worked, so here is the file:

Code: [Select]
<?php
/**************************************************
  CPG Photo Shop Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.16
  Photo Shop version: 1.3.6
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/
if (!defined('IN_COPPERMINE'))
{
die('Not in Coppermine...');
}


if (
defined('PHOTOSHOP_ORDER_PHP'))
{
$lang_photoshop_email_order = <<<EOT
Hello {USER_NAME},

Thank you for your order at {SITE_NAME} with the order id {ORDER_ID}.
Please transfer USD {PRICE} as soon as possible.
A USD10.00 charge will be added for shipping and handling to Canada, USA and Mexico. Worldwide shipping and handling charge is USD15.00.  This price is per CD.
<a href="{LINK}">{LINK}</a>

{ADMIN}
EOT;


$lang_photoshop_email_admin = <<<EOT
Hello {ADMIN},

{USER_NAME} just made an order on your site {SITE_NAME}. The id of that order is {ORDER_ID} and the total value {PRICE}.
<a href="{LINK}index.php?file=photo_shop/photo_shop_admin">Click to go to the order manager</a>

Other placeholders you can use (blank if these user profile fields haven't been filled in):
user_profile1: {USER_NAME}
user_profile2: {USER_ADDRESS}
user_profile3: {USER_PHONE}
user_profile4: {USER_CELL}
user_profile5: {USER_EMAIL}
user_profile6: {USER_PROFILE6}

Best regards,
{ADMIN}
EOT;

$lang_photoshop_email_attach_header = <<<EOT


Here we can have the invoice header like address etc

FOTOS BY ERIKA
1300 Bloor St., SPH6
Mississauga, ON Canada
01-905-212-9111

EOT;
}

$lang_photoshop_register = array(
  
'already_member' => 'Already a member',
);



$lang_photoshop_config = array(
  
'save_cfg' => 'Save new configuration',
  
'new_item' => 'Create new item',
  
'title' => 'Shop configuration',
  
'type' => 'Type',
  
'price' => 'Price',
  
'name' => 'Description',
  
'max_items' => 'Max items on CD',
  
'priority' => 'Priority',
  
//new 1.3
  
'update_alb' => 'Update album',
  
'reset_alb' => 'Reset album',
  
'select_alb' => '&nbsp;&nbsp; ** Choose an album ** ',
  
//new 1.3.5
  
'ship_item' => 'Shipping',
  
'order' => 'Order',
  
//new 1.3.6
  
'shop_enabled' => 'Shop enabled for this album',
  
'all_albs' => 'Set prices for all albums in the (sub)category of this album',
  
'per_alb_settings' => 'Per Album Settings',


);

$lang_photoshop = array(
  
'type_chckout' => 'Type',
  
'item_id_checkout' => 'Item ID',
  
'amount_checkout' => 'Amount',
  
'total_checkout' => 'Price total',
  
'admin_title' => 'Shop'// admin menu button title
  
'uninstall' => 'Remove the table that was used to store shop data ?',
  
'USD' => 'USD',
  
'buy' => 'Add image to shopping basket:',
  
'send' => 'Add',
  
'CD' => 'Add to CD',
  
'CD_price' => 'check basket',
  
'added' => 'Item added',
  
'cart' =>'Shopping cart',
  
'boxcd' =>'Items on CD',
  
'boxphoto' =>'Items for print',
  
'go' =>'GO',
  
'save_amounts' => 'Save new amounts',
  
'empty_basket' => 'Empty basket',
  
'each' => 'each',
  
'title' => 'Title:',
  
'filename' => 'Filename:',
  
'size' => 'Size:',
  
'amount' => 'Amount:',
  
'total' => 'Total',
  
'pics' => 'pics',
  
'pricelist' => 'Pricelist',
  
'photos' => 'Photos',
  
'cds' => 'CDs',
  
'to_many_pics' => 'You have too many pics on the CD, please remove some!',
  
'on_cd' => 'On CD',
  
'for_print' => 'For print',
  
'send_order' => 'Confirm your order',
  
'goto_cart_cd' => '<a href="index.php?file=photo_shop/photo_shop_cart&box=cd">Open shopping cart</a>',
  
'email_subject_order' => 'Thanks for your order',
  
'email_subject_order_admin' => 'You got a new order',
  
'email_sent' => 'Thanks for your order.<br> We have sent you a confirmation email! <br>Your order will be processed after payment! <br>',
  
'cart_empty' => 'Your shopping cart is empty.<br> Please add some items first!',
  
'in_cart' => 'images in cart',
  
'checkout' => 'Checkout',
  
'to_go' => 'You can add %s more images to your CD till the next price level',
  
'to_go_full' => 'The CD is full for this price level',
  
'to_go_remove' => 'You have added too many images to your CD. Please remove at least %s item(s)!',
  
'shipping' => 'Shipping',
  
// gateway integration

  
'account' => 'Account Number:',
  
'routing' => 'ABA routing:',
  
'swift' => 'Swift code:',
  
'bank' => 'Bank:',
  
'wire' => 'Pay by wire transfer:',

  
'paypal' => 'Pay with Paypal:',
  
'google' => 'Pay with Google Checkout:',
  
'order_id' => 'Order ID:',

  
// discount, invoice
  
'discount' => 'Discount',
  
'myorders' => 'My Orders',

  
//1.3.6 continue button
  
'continue' => 'Continue shopping',
  );

if (
defined('PHOTOSHOP_ADMIN_PHP'))
{
$lang_photoshop_admin = array(
  
'u_orders_on_p_pages' => '%d orders on %d page(s)',
  
'otime_a' => 'Date ascending',
  
'otime_d' => 'Date decending',
  
'uid_a' => 'User ID ascending',
  
'uid_d' => 'User ID decending',
  
'oid_a' => 'Order ID ascending',
  
'oid_d' => 'Order ID decending',
  
'o_board_title' => 'Shop admin',
  
'Active' => 'Active',
  
'Archive' => 'Archive',
  
'OrdersIn'=>  'Orders in',
  
'managefolder' => 'Manage folder',
  
'orders' => 'orders',
  
'switch' => 'Switch to',
  
'go' => 'Go',
  
'Orders' => 'Orders',
  
'mark_all' => 'Mark / unmark all orders',
  
'NoOrders' => 'No orders',
  
'SelectedOrders' => 'Selected orders',
  
'markarchive' => 'Move to Archive',
  
'markactive' => 'Move to Active',
  
'delete' => 'Delete',
  
'new' => 'New order',
  
'viewed' => 'Viewed order',
  
'processed' => 'Processed order',
  
'order_id' => 'Order ID',
  
'items' => 'Items',
  
'usd_total' => 'USD total',
  
'item_price' => 'Price total',
  
'size' => 'Size',
  
'config' => 'Config',
  
'mark_unviewed' => 'Set unviewed',
  
'mark_viewed' => 'Set viewed',
  
'mark_payed' => 'Set paid',
  
'mark_unpayed' => 'Set unpaid',
  
'mark_sent' => 'Set sent',
  
'mark_unsent' => 'Set unsent',
  
'pos' => 'Paid/ sent',
  
'neg' => 'Unpaid/ unsent',
  
//new stuff 1.1
  
'contains' => 'contains',
  
'order_s' => 'order(s)',
  
'in_total' => 'In total there are',
  
'orders_stored' => 'orders stored',
  
'stored_orders' => 'Stored orders in this folder',
  
'total_orders' => 'Total orders',
  
'noitems' => 'No. items',
  
'volume' => 'Order volume',
  
'user_id' => 'User ID',
  
'sort_by' => 'Sort by',
  
'amount' => 'Amount',
  
'pid' => 'PID',
  
'price_pi' => 'price per item',
  
'usd' => 'USD',
  
'incl_ship' => 'incl. shipping %discount',
  
//1.3
  
'filename' => 'Filename',
  
//1.4
  
'download_zip' => 'Download zip'
  
);
}
?>


[Edit GauGau] Added readability of this thread by using the bbcode tags that you're suppossed to use [/Edit]
Title: Re: Shopping cart
Post by: erika_conn on July 01, 2008, 04:56:48 pm
I'll remember that for next time.  Thanks.
Title: Re: Shopping cart
Post by: Stramm on July 01, 2008, 05:49:43 pm
For me your lang file works without problems on my testbed

Quote
Hello Stramm,

Thank you for your order at Coppermine Photo Gallery with the order id 2.
Please transfer USD 6.00 as soon as possible.
A USD10.00 charge will be added for shipping and handling to Canada, USA and Mexico. Worldwide shipping and handling charge is USD15.00. This price is per CD.
http://testbed/cpg1418/

Coppermine Photo Gallery





Here we can have the invoice header like address etc



FOTOS BY ERIKA

1300 Bloor St., SPH6

Mississauga, ON Canada

01-905-212-9111





   Item ID              Type       Amount       Price total

         1               4x6            1          USD 2.00





                                                               



                                   For print: 1 pics :: 2.00USD

                                            Shipping :: 4.00USD

                                     --------------------------

                                                 Total: 6.00USD

Title: Re: Shopping cart
Post by: erika_conn on July 01, 2008, 06:04:49 pm
So, what does that mean?  Where did I go wrong? What does the Parse error message mean?
Parse error: syntax error, unexpected '{', expecting ')' in /home/cecon46/public_html/photo_gallery/lang/english.php on line 1504

Should I uninstall the plugin and reinstall and then try again?  Do you think that would be the quickest way to get to the bottom of this?
Title: Re: Shopping cart
Post by: Stramm on July 01, 2008, 06:50:39 pm
That won't help at all cause the error message means you do not have a problem in the photo shop plugin lang file but in your coppermine lang file. Most probably you've edited that one, too (as I already pointed out above). Undo the changes in the coppermine lang file or zip and attach it to your next post or replace it with a working one from the coppermine archive you've downloaded. 

Where to find the lang file you can see in the path within the error message photo_gallery/lang/english.php
Title: Re: Shopping cart
Post by: erika_conn on July 01, 2008, 07:26:21 pm
Oh, how could I have been so stupid.  Thank you, thank you a million times. :-*

Now, on to the next thing, when clicking on "Cart" I get the following error message with this headline:
There was an error while processing a database query.

followed by this note:

While executing query "SELECT * FROM cpg_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


Under that is the following: File: /home/cecon46/public_html/photo_gallery/include/functions.inc.php - Line: 249   Interestingly, there is nothing on that line.

I read some of the others who've received the same or similar error message and I tried the phpMyAdmin database repair but that did nothing.  There is a database in there called COPP1.  I have no idea how it got there.  Would that have been created by Coppermine?

I know I have to do quite a bit of work yet for this shopping cart to work properly.  I hope you don't mind showing me the error of my ways.



I'd start a new topic but I can't figure out when that tab is.  I don't seem to have one.
Title: Re: Shopping cart
Post by: Joachim Müller on July 02, 2008, 06:58:52 pm
I'd start a new topic but I can't figure out when that tab is.  I don't seem to have one.
You can't tsart a new thread on this board, as it is only for valid plugin contributions, and not for support requests. Go one level up to the plugins board - this is where your individual questions should go into.
Title: Re: Shopping cart
Post by: JohannM on July 30, 2008, 04:24:53 am
Stramm

I also encounter that the discount I configured is either allocating it to the Total of Photo's Amount or the total of CD Amount, if a customer order both photos and cd's, the discount calculation is wrong.

Please help !
Title: Re: Shopping cart
Post by: Stramm on July 30, 2008, 08:25:09 am
The discount as it is in the actual function is just an example. The array values are explained as well there
Quote
   //$cd_counter['photo']  number of pics for print
   //$cd_counter['cd']      number of pics on CD
   //$temp_price[1]      price for the CD
   //$temp_price[0]      price for the pics

So just change the function to do what you want to have
eg. discount for cds and pics
Quote
      $discount = 0.1 * $temp_price[0] + 0.1 * $temp_price[1];
Title: Re: Shopping cart
Post by: JohannM on July 30, 2008, 12:46:40 pm
Stramm

Thanks for the help ... Silly me !

e.g. :    

   if(USER_GROUP == 'Registered'){$discount = 0.10 * $temp_price[0] + 0.10 * $temp_price[1];}
   if(USER_GROUP == 'Sponsor25'){$discount = 0.25 * $temp_price[0] + 0.25 * $temp_price[1];}
   if(USER_GROUP == 'Sponsor50'){$discount = 0.50 * $temp_price[0] + 0.50 * $temp_price[1];}

This correct ?
Title: Re: Shopping cart
Post by: Stramm on July 30, 2008, 12:59:42 pm
seems to be OK to me... always depending on what you want to do ;)
Title: Re: Shopping cart
Post by: JohannM on July 30, 2008, 01:06:15 pm
Stramm, seems to work fine !  Thanx

If I understand it correctly, all orders posted to the datebase (> 1000) before the correct "number format" changes on the core files, will still indeed show incorrectly in the "Admin" and "My Orders" pages ?

Title: Re: Shopping cart
Post by: JohannM on July 31, 2008, 10:23:50 pm
Hi

How can I set the sort order for pid or photo number numeric before a copy of the shopping cart order is being mailed to the user & admin ?
Title: Re: Shopping cart wheres paypal
Post by: camster on August 01, 2008, 09:12:39 pm
shopping cart and everything seems to work great on this except I have installed 1.3.6 but can not find the paypal feature on this. I'm sure I have the right version installed because the plugin manager lists it as 1.3.6. If anyone can help me  implement paypal that would be great.

Thanks
Camster
Title: Re: Shopping cart wheres paypal
Post by: Shonna on August 15, 2008, 10:21:11 pm
shopping cart and everything seems to work great on this except I have installed 1.3.6 but can not find the paypal feature on this. I'm sure I have the right version installed because the plugin manager lists it as 1.3.6. If anyone can help me  implement paypal that would be great.

Thanks
Camster


same here
Title: Re: Shopping cart wheres paypal
Post by: Shonna on August 15, 2008, 10:51:39 pm

same here

well i found in includes/gateway.inc to change a value to 1 to enable paypal..  and the paypal button came up at checkout.. but it went to paypal sandbox and i am confused... can it not go to where you either pay by credit card or login to paypal? like a regular pay now button?
Title: Re: Shopping cart
Post by: Shonna on August 15, 2008, 10:53:31 pm
never mind.. didnt look down enough :p
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 12:48:20 pm
I installed fresh version of coppermine and then installed the photo shop plugin and the whole gallery just went blank and its like this each time I reinstall everything. When I delete the plugin manually from the server all goes back to working state however obviously I cant use the plugin. All the sql data added during installation is in the database.

gallery: http://hmr6dobl2ii0.az.pl/shop/
cpg: 1.4.19
photoshop: 1.3.6

Any ideas how I might fix this??
Title: Re: Shopping cart
Post by: Stramm on August 24, 2008, 01:14:55 pm
Please enable debug mode and post the error message.
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 01:24:29 pm
The debug mode is on and I also added this piece of code I found in some other topics about "blank gallery" in index.php

Code: [Select]
error_reporting(E_ALL);
ini_set("display_errors", 1);

and there is still nothing...

can this be a configuration problem of the server?? maybe this plugin needs some specific php.ini or other configuration that Coppermine doesnt?? Because the gallery works fine without the plugin installed, it even works fine with the plugin installed however no plugin files... Ive run this plugin on other server and it works fine, however I need to run in on this server...
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 01:29:33 pm
in administrator tools I found this info, however Im too new to coppermine to know if this is at least little helpful

Information about errors
Code: [Select]
USER:
------------------
Array
(
    [ID] => 9a99c4c967375516c3a16af5f107e589
    [am] => 1
    [lang] => polish
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => admin
    [groups] => Array
        (
            [0] => 1
        )

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

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg14x_filetypes; (0s)
    [1] => select * from cpg14x_plugins order by priority asc; (0s)
    [2] => delete from `skn63483_martinoliva`.cpg14x_sessions where time<1219573601 and remember=0; (0s)
    [3] => delete from `skn63483_martinoliva`.cpg14x_sessions where time<1218367601; (0s)
    [4] => select user_id from `skn63483_martinoliva`.cpg14x_sessions where session_id = '90f45ba52fb9aa66552c6bf9802912c4' (0s)
    [5] => select user_id as id, user_password as password from `skn63483_martinoliva`.cpg14x_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `skn63483_martinoliva`.cpg14x_users AS u INNER JOIN `skn63483_martinoliva`.cpg14x_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `skn63483_martinoliva`.cpg14x_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => 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 cpg14x_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg14x_usergroups WHERE group_id= 1 (0s)
    [10] => update `skn63483_martinoliva`.cpg14x_sessions set time='1219577201' where session_id = '90f45ba52fb9aa66552c6bf9802912c4' (0s)
    [11] => SELECT user_favpics FROM cpg14x_favpics WHERE user_id = 1 (0.001s)
    [12] => DELETE FROM cpg14x_banned WHERE expiry < '2008-08-24 11:26:41' (0s)
    [13] => SELECT * FROM cpg14x_banned WHERE (ip_addr='89.243.224.149' OR ip_addr='89.243.224.149' OR user_id=1) AND brute_force=0 (0s)
    [14] => SELECT COUNT(*) FROM cpg14x_pictures WHERE approved = 'NO' (0s)
    [15] => SELECT user_name AS user_name, aid, a.title
                                                                                FROM cpg14x_albums AS a
                                                                                LEFT JOIN `skn63483_martinoliva`.cpg14x_users AS u
                                                                                ON (category - 10000) = user_id
                                                                                WHERE category > 10000 (0.001s)
    [16] => SELECT aid, title, name FROM cpg14x_albums LEFT JOIN cpg14x_categories ON cid = category WHERE category < 10000 ORDER BY title (0.001s)
)

==========================
GET :
------------------
Array
(
)

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

==========================
VERSION INFO :
------------------
PHP version: 5.2.6 - OK
------------------
mySQL version: 5.1.26-rc-log
------------------
Coppermine version: 1.4.19(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.34 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 5.1.26-rc
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/include/mysql
MYSQL_LIBS -L/usr/local/lib/mysql -lmysqlclient_r 
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | On | On
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | exec,system,shell_exec,passthru,escapeshellcmd,escapeshellarg,proc_close,proc_open,proc_open,set_ini,ini_alter,eval,popen,dl,pcntl_exec,php_uname,posix_uname,disk_free_space | exec,system,shell_exec,passthru,escapeshellcmd,escapeshellarg,proc_close,proc_open,proc_open,set_ini,ini_alter,eval,popen,dl,pcntl_exec,php_uname,posix_uname,disk_free_space
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.051 seconds - 17 queries in 0.003 seconds - Album set : ; Meta set: ;

Warnings
Code: [Select]
/bridge/udb_base.inc.php

    * Notice line 717: Undefined variable: listArray
    * Warning line 724: Invalid argument supplied for foreach()

/include/functions.inc.php

    * Notice line 2694: Undefined variable: i
    * Warning line 2696: Invalid argument supplied for foreach()
    * Warning line 2696: Invalid argument supplied for foreach()

/include/functions.inc.php(2706) : eval()'d code

    * Warning line 1: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a sort flag
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 06:03:21 pm
can this script be blocked somehow by .htaccess ??

Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 06:40:02 pm
I disabled the plugin, installed the photo shop, and found out that it doesnt show in the Plugin Manager as installed, it doesnt show at all... so maybe during the installation something went wrong?? how can I install it manually??
Title: Re: Shopping cart
Post by: Stramm on August 24, 2008, 07:08:19 pm
I hope you uploaded the photo_shop directory into the plugins dir?
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 07:45:30 pm
omg, of course I did... can u actually try to ANSWER one of my questions?? (please)
Title: Re: Shopping cart
Post by: efekt on August 24, 2008, 08:47:33 pm
I'll bounce another idea off you... maybe this will ring a bell  :P can this be happening because this server has SAFE MODE ON??
Title: Re: Shopping cart
Post by: Stramm on August 24, 2008, 10:24:01 pm
answers to your questions
Quote
... can this be a configuration problem of the server??
Yes, it can but it musn't. If yes, then I can't tell you exactly where it is as I do not administer your box and I haven't seen such a behaviour before.

Quote
... can this script be blocked somehow by .htaccess ??
Yes, you should know better than I do as you have access to your htaccess files and most probably you've put it on your server yourself.

Quote
... so maybe during the installation something went wrong??
It may if you haven't uploaded the plugin into a wrong location (eg. with overwriting coppermines init.inc.php, functions.inc.php - that's why I ask some questiones - if you know better than I do what to ask and what to answer, then maybe you can answer your questions yourself)

Quote
... can this be happening because this server has SAFE MODE ON
not likely

Quote
... how can I install it manually??
upload it into the plugins dir, make the necessary entries to the db, the first into the plugins table (where you already deleted it once), the other entries are in one of the plugins subdirs (sql)... adapt the table names and use a tool like phpmyadmin to add them
Title: Re: Shopping cart
Post by: efekt on August 25, 2008, 02:07:00 pm
not likely

it was actually... I wrote to admins to activate my own php.ini on my account that turned of the safe mode, installed the plugin again and all works fine now... problem solved...

I didnt want to insult you Stramm if u got it that way... as I saw it: you wrote the plugin and know how it works, I have access to my files and server, and I need to bounce off you my ideas about what went wrong so you either could dismiss them or take them under consideration, however the questions needed to be answered or I would just be talking to a wall... I think I was not unresonable in taking such approach... Anyway its much better then "omg! i install and it not work, HELP"  ;D

thx for help, great plugin btw  :D
Title: Re: Shopping cart
Post by: ewa24 on August 28, 2008, 12:11:10 pm
hello, thank you very much for this greate module, it is exactly what i was looking for.
i have one question please:
if i want to sell diferent size images how do i deel with it please? say image "x.jpg" has 3 diferent dimenssions
should i upload all diferent sized images or maybe there is a module over here that i can use? then just set diferent price for diferent size?

thank you very much for your help in advance
Title: Re: Shopping cart
Post by: 2nygulla on September 02, 2008, 03:31:42 pm
I have a layout problem with my photo_shop in a fotopage that i am working on (you can look at the page om this adress: www.fyrvikafoto/galleri).
When i open it in Safari-browser (and Firefox on my mac) the "menu", were you choose picturessize and put the pictures inn the basket, are view over tre lines (se picture), instead of one. It works great inn IE and Firefox inn Windows Vista, and in Firefox on the mac i have at my workingplace.

Is this a isue related to the theam i am using (blix) or the photo_shop, and have someone a suggestion about what file i can find the code for this "menu"?

Mvh Tony Gulla
Title: Re: Shopping cart
Post by: 2nygulla on September 02, 2008, 03:34:12 pm
I have a layout problem with my photo_shop in a fotopage that i am working on (you can look at the page om this adress: www.fyrvikafoto/galleri).
When i open it in Safari-browser (and Firefox on my mac) the "menu", were you choose picturessize and put the pictures inn the basket, are view over tre lines (se picture), instead of one. It works great inn IE and Firefox inn Windows Vista, and in Firefox on the mac i have at my workingplace.

Is this a isue related to the theam i am using (blix) or the photo_shop, and have someone a suggestion about what file i can find the code for this "menu"?

Mvh Tony Gulla

The correct url for my page is: www.fyrvikafoto.no/galleri

Tony:)
Title: Re: Shopping cart
Post by: Joachim Müller on September 03, 2008, 09:09:37 am
I wasn't able to spot the "Powered by Coppermine" tag on your page. There will be no support for you unless you permanently restore the tag.
Title: Re: Shopping cart
Post by: ewa24 on September 03, 2008, 03:53:50 pm
hello,
any body please, can point me somewhere where i can read about how to deal with diferent sized images? when i want to sell.
should i upload diferent sizes? please
or maybe should i install a diferent module?

thank you very much in advance for your help
Title: Re: Shopping cart
Post by: bestmotorhead on September 03, 2008, 04:44:34 pm
Hello,
i can´t put the shop to work!
1) i have permited the plugins, they are enabled.
2) i uploaded the modify files and now i am triying to upload the photo_shop_1.3.6.zip to the plugin manager...
it tells me that it can´t be installed...
what i am doing wrong?

thanks a lot!
Title: Re: Shopping cart
Post by: 2nygulla on September 04, 2008, 05:33:08 pm
I wasn't able to spot the "Powered by Coppermine" tag on your page. There will be no support for you unless you permanently restore the tag.

Hello:)

I´m not finishd whit the page get, and will add this tag before it become public. I thougt it was there, but i se now that the maker of the theme has removed it.

I hope someone will help med with my problem, and maybe also tell me which file to putt the "Powered by Coopermine" tag?

Mvh Tony
Title: Re: Shopping cart
Post by: Stramm on September 04, 2008, 07:31:23 pm
Hello,
i can´t put the shop to work!
1) i have permited the plugins, they are enabled.
2) i uploaded the modify files and now i am triying to upload the photo_shop_1.3.6.zip to the plugin manager...
it tells me that it can´t be installed...
what i am doing wrong?

thanks a lot!

unzip and then upload the photo_shop directory into the plugins dir
Title: Re: Shopping cart
Post by: JohannM on September 08, 2008, 08:47:22 pm
Hi

Is there any way to let the cart or checkout when emailing the user and admin sort the files according to pid / filename ?

The idea is when getting the order, that all the files are sorted according to pid (in my case title) ASC.
Title: combined signup/ login form missing after installation Re: Shopping cart
Post by: GH on September 09, 2008, 02:47:11 pm
Hello, I need some help because probably I did the installation wrong:

In the description how to install everything was going fine, but may be that I did not very well understood the remarks for css_changes, what I understood was that I had to copy the lines off the txt-file changes and insert them into the style.css-File of the classic.theme-folder with this file, I did copy it on the end.

After this, when I put items in the basket and go to checkout, there should be a login form coming with the content of the field inside the custome fields (updated or not with name, adress, zip....), but I updated.

But going to checkout there was no appearing of this login form ???

Thanks and by
GH
Title: Re: Shopping cart
Post by: mafo7542 on September 18, 2008, 12:41:01 am
Hello,
I need to know how can I change (and where) character set to UTF-8.

Thanks a lot. ;)
Title: Re: Shopping cart
Post by: Stramm on September 18, 2008, 08:33:07 am
If utf-8 doesn't work, then probably the language file needs to be saved in utf-8. Open it with a text editor and save in the encoding you need.
Title: Re: Shopping cart
Post by: mafo7542 on September 18, 2008, 11:53:26 am
Damn, thanx. I forgot about it. I saved file in utf-8 and it work.
 :)
Title: Finetuning
Post by: oreste on November 05, 2008, 04:59:21 pm
anyone willing to modify this code for me?
german speaking programmers preferred ...

 oreste(x)oreste(d)com
Title: Re: Shopping cart
Post by: Jacked on November 08, 2008, 10:50:31 pm
Everything works great, except I'm a total newb when it comes to paypal. How do I get it to sync with the checkout/order confirm instead of it going to sandbox?

It's probably something so easy but I can't figure it out lol  ???
Title: Re: Shopping cart
Post by: Stramm on November 09, 2008, 11:07:13 am
1st post of this thread:
Quote
New version (1.2 uploaded on 10/03/2006)
 - added bridge compatibility (should work without the need to configure anything, beta status)
 - added a paypal gateway (configure and enable it in include/gateway.inc.php, beta status)
 - fixed 2 bugs related to the shipping costs addition
Title: Re: Shopping cart
Post by: Jacked on November 10, 2008, 01:34:58 am
Yeah - thanks. I already knew how to enable it, and had it enabled, it was just the configuration that wasn't working.
But it turned out I was doing everything correctly, it was just an issue with paypal.
Thanks though!  ;D
Title: Re: Shopping cart
Post by: Synthea on November 12, 2008, 07:33:05 pm
Issues with options ordering in admin:

When I am modifying my client's options in Shop, the first 4 only let me move them down (only the down arrow is showing), but all the rest below that let me move them up, or down, until one of them is moved into the top 4th slot, then the the ability to go up more is removed? Trying to search for this but I'm not finding anything and it happens on 3 of my client's sites. Very frustrating!
Title: Re: Shopping cart
Post by: Synthea on November 13, 2008, 08:38:48 pm
I'm also having a problem with the check out process. When an item is placed in the cart and the customer clicks on the "X items in cart" and tries to check out from there, a page comes up wanting a username and password with the button saying "Authenticate".

But when the customer clicks on Checkout from the menu, there's no problems. Unfortunately this will confuse a lot of people and my client needs this resolved *today*.
Title: Re: Shopping cart
Post by: Stramm on November 14, 2008, 11:27:21 am
Issues with options ordering in admin:

When I am modifying my client's options in Shop, the first 4 only let me move them down (only the down arrow is showing), but all the rest below that let me move them up, or down, until one of them is moved into the top 4th slot, then the the ability to go up more is removed? Trying to search for this but I'm not finding anything and it happens on 3 of my client's sites. Very frustrating!

That issue is corrected in the new version of the shop (not yet published)
Title: Re: Shopping cart
Post by: Stramm on November 14, 2008, 11:38:46 am
I'm also having a problem with the check out process. When an item is placed in the cart and the customer clicks on the "X items in cart" and tries to check out from there, a page comes up wanting a username and password with the button saying "Authenticate".
I can't replicate this behaviour with the shop version 1.3.6. Codingwise it's not likely, too, as the check if the user is logged in or not doesn't depend in any kind on the type of link or where it is placed. It's a check in photo_shop_checkout.php that's using Coppermines base functions for that.

But when the customer clicks on Checkout from the menu, there's no problems. Unfortunately this will confuse a lot of people and my client needs this resolved *today*.
If you need time critical support you should hire a programmer. I'm coding in my free time and I even clearly stated in the shops announcement thread (this very thread) that I won't give support for it. However I did most of the time. Still that's no reason to demand immediate support or to PM me unasked.
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 05:21:28 pm
Quote
That issue is corrected in the new version of the shop (not yet published)
Thanks, I'll gladly wait for it if I ca fix the other issue.


Quote
Still that's no reason to demand immediate support or to PM me unasked.
I was stating a sense of urgency, most definitely NOT demanding (I understand it can be hard to differentiate but it is what it is) and did not see any rules that I couldn't PM someone without a written invitation.  If you don't want to be hired a simple no thank you would suffice.

Unfortunately, I can't resolve it. I can duplicate it every time and it does it when I click on continue shopping and all the other buttons, even when I totally uninstall and reinstall everything and use different versions of both Coppermine and Photo Shop. Off to see if I can find a programmer.

Title: Re: Shopping cart
Post by: Stramm on November 14, 2008, 06:17:17 pm
Check cookie issues (clear cookies and retry). Another point could be subdomain issues. www.domain.com is not domain.com -> means if one button sends you to domain.com and the other to www.domain.com then this may be a problem.

That's what happens when I click the checkout button - if it's different for you, then the easiest fix would be to remove one of the buttons.

Case 1: I'm logged in
 - a) clicking checkout from within the cart (below item list) -> checkout confirmation page
 - b) clicking checkout from within the menu  -> checkout confirmation page

Case 2: I'm not logged in
 - a) clicking checkout from within the cart (below item list) -> signup and login page
 - b) clicking checkout from within the menu -> signup and login page


Quote
and did not see any rules that I couldn't PM someone without a written invitation
From the registration page (rules you agreed to on signing up)
Quote
11. Post publicly
Sending private messages to supporters or devs, asking for help or support is a bad idea. The whole point of a support board is that others can see your questions and the replies. There is no individual support by email or private message. If sensitive information like an admin account is needed, the supporter will ask for it.

Quote
If you don't want to be hired a simple no thank you would suffice.
You didn't say you intended to hire me so I haven't had any chance to say: 'No thanks!'.

Quote
and my client needs this resolved *today*
Quote
I was stating a sense of urgency, most definitely NOT demanding
Ok, maybe I got you wrong here
Title: Re: Shopping cart
Post by: Joachim Müller on November 14, 2008, 07:19:47 pm
I was stating a sense of urgency, most definitely NOT demanding (I understand it can be hard to differentiate but it is what it is)
I felt the same way Stramm did - your posting sounded exactly as Stramm said.

and did not see any rules that I couldn't PM someone without a written invitation. 
Really? That's amazing. As Stramm pointed out, it's part of the board rules that you agreed to respect when signing up. Additionally, it's available in the very board navigation: the link "board rules" (between the menu items "Search" and "Profile") would have lead you to
11. Post publicly
Sending private messages to supporters or devs, asking for help or support is a bad idea. The whole point of a support board is that others can see your questions and the replies. There is no individual support by email or private message. If sensitive information like an admin account is needed, the supporter will ask for it.

In other words: you are not allowed to send a PM or email to the supporters, devs or anyone else on this forum unless you have explicitely been given permission to do so.
The only exception to this rule are security-related issues that have an impact on the most recent stable release: if you have discovered a security flaw in coppermine, you're allowed to contact one of the devs directly to alert him of the potential flaw.
Review your attitude!
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 07:24:11 pm
Quote
You didn't say you intended to hire me so I haven't had any chance to say: 'No thanks!'.

That was in the PM.

I apologize my intent was misunderstood, it's often difficult to convey meaning in text.
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 07:31:58 pm
Check cookie issues (clear cookies and retry). Another point could be subdomain issues. www.domain.com is not domain.com -> means if one button sends you to domain.com and the other to www.domain.com then this may be a problem.

That's what happens when I click the checkout button - if it's different for you, then the easiest fix would be to remove one of the buttons.

Case 1: I'm logged in
 - a) clicking checkout from within the cart (below item list) -> checkout confirmation page
 - b) clicking checkout from within the menu  -> checkout confirmation page

Case 2: I'm not logged in
 - a) clicking checkout from within the cart (below item list) -> signup and login page
 - b) clicking checkout from within the menu -> signup and login page


Thank you for still taking time to look into this, all the buttons go to www.domain.com I've made sure to clear cookies and cache and tried it on 2 browsers.
When logged out, the same problem exists. Any of the buttons (continue shopping, empty basket, etc) send me to the "authenticate" page.
Title: Re: Shopping cart
Post by: Stramm on November 14, 2008, 07:38:34 pm
post a link to the gallery... I still can't replicate what you report
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 07:41:42 pm
www.fullofgracephotography.com/testingcart
Title: Re: Shopping cart
Post by: Stramm on November 14, 2008, 07:51:06 pm
from what I see I'd say you use a modified version of the shop
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 08:23:21 pm
I don't know why, but I installed it elsewhere www.fullofgracephotography.com/test2 and added the Photo Shop before updating the tempate, and it works fine now, I did change the address to the CSS file to the complete URL, so maybe that was it? Thanks for the help!
Title: Re: Shopping cart
Post by: Synthea on November 14, 2008, 11:33:46 pm
Last issue then I'll be gone. My client wants to have be able to have customers add an image (free) to the cart to be placed on birth announcement (not free).... I got everything figured out except how to make the line show for the free image. I noticed Stramm's site has 2 options for a free image, but I'm not able to replicate it on the clients. Tried leaving it completely blank, 0.00, and entering "free". Thanks once again.
Title: Re: Shopping cart
Post by: Stramm on November 15, 2008, 11:17:31 am
this feature is part of the new version
Title: Re: Shopping cart
Post by: Synthea on November 26, 2008, 12:32:05 am
Same cart, new issue. My client's site got hacked (only this Photo Shop for Coppermine was affected/messed with)... everything seems to be working again but I can't get paypal to show the correct amount...
This is the price list for images on CD(please note that everything worked prior to this hacker attack):

Quote
CDs
1 Full Resolution Image - USD 20.00 (max items on CD 1)
2 Full Resolution Images - USD 40.00 (max items on CD 2)
3 Full Resolution Images - USD 60.00 (etc)
4 Full Resolution Images - USD 80.00
5 Full Resolution Images - USD 100.00
6 Full Resolution Images - USD 120.00
7 Full Resolution Images - USD 140.00
8 Full Resolution Images - USD 160.00
9 Full Resolution Images - USD 180.00
10 Full Resolution Images - USD 200.00
11 Full Resolution Images - USD 220.00
12 Full Resolution Images - USD 240.00
13 Full Resolution Images - USD 260.00
14 Full Resolution Images - USD 280.00

The cart shows the correct total, like if the customer orders 2 images on CD, it shows as $40+ shipping, but when the customer goes to paypal, the total is $80+shipping within paypal.

Title: Re: Shopping cart
Post by: greggan on November 27, 2008, 09:21:09 pm
Is there any easy way to to change for example "Photo" or "CD" in the buy drop down menu to something else like "tif file" or "jpg file" ?
I would also like to be able to auto attach download link to customer invoice (I prefer to thrust my customers to pay within 30 days of ordering)
Is this possible and would you like to do it for us?
 
Title: Re: Shopping cart
Post by: Jasondt2001 on November 30, 2008, 12:43:46 am
Re: Taxes added

Mr. Stramm thank you so much for the incredible plugin, I and my users have found it very useful and just as important DEPENDABLE!
I am the 'web person' for a small photography 'strore' for my mother and wife.
They would like to implement a 'tax' feature on checkout.
I do realize that there has been a post you made to a German gentleman about how to implement it (http://forum.coppermine-gallery.net/index.php/topic,32231.msg213217.html#msg213217). I followed the steps and it will NOT show on my screen.
I'm very eager to learn how to fix it but unfortunately I'm a green horn to PHP.

What I would like is it to add 8.25% tax to the tot-price and show that amount in the check out screen (right before you confirm your order) and it show the tax amount to the user in their email.

Here's the steps I've done so far...

In the functions.inc.php I've added
Code: [Select]
$tax = number_format(($tot_price*.825),2); Directly under the $tot_price = field

Code: [Select]
<br/>Incl. MWSt.: {$tax}{$lang_photoshop['USD']}&nbsp;&nbsp; right beneath the {total_price}

Code: [Select]
$out['text'] .= sprintf("%+63s\n", 'Incl. MWSt: '.$tax.$lang_photoshop['USD']); Right above the return $out[template]; field.

I then went into my english.php section and added
 
Code: [Select]
'tax' => "Total Taxable", right under the $lang_photoshop_register = array( section

I would appreciate your help very much, I wish i was more proficient and knew exactly what you needed from me to help you but unfortunately I do not.
Please tell me if there's anything else you require from me, sir.

If you'd like a link to my gallery I'll be more than happy to PM you the information if you so request.

Thankfully,

Jason
Title: Re: Shopping cart
Post by: greggan on December 03, 2008, 04:58:50 pm
Is it possible to use multiplier or %  + and - amounts etc in the price calculation?
Like putting -50  or +10%   in the price field of shop configuration

Regards/ Stefan
Title: Re: Shopping cart
Post by: Jasondt2001 on December 09, 2008, 03:28:10 am
Stramm, I FOUND IT!! I put it in the right place (The tax forms) and it works almost exactly how I need it too!

One thing I DO need that I can't for the life of my figure out is I have the calculation worked out on the appropriate tax amount...how or where do I put $tax to get it to add automatically to $total_order??
I SWEAR I've been SCOURING the net and any book I can find on PHP to learn myself, but, It hasnt helped...
Title: Re: Shopping cart
Post by: Stramm on December 09, 2008, 08:35:22 am
In Germany tax is 19%
Code: [Select]
$tax = number_format(($tot_price/119*19),2);
For a tax of eg 25% change it to
Code: [Select]
$tax = number_format(($tot_price/125*25),2);
Title: Re: Shopping cart
Post by: gabzee on December 10, 2008, 10:15:02 pm
Hi I was search but can't find.
How can I move the shopping plugin buttons(images in cart, checkout...), somewhere else in theme?

Tnx
Title: Re: Shopping cart
Post by: Stramm on December 11, 2008, 08:14:58 am
Hi I was search but can't find.
How can I move the shopping plugin buttons(images in cart, checkout...), somewhere else in theme?

Tnx

That info you can find in the first post of this thread.
Quote
New version (1.1 uploaded on 08/09/2006)
 - added shipping costs
 - added support for a tag in template.html {CART_MENU}, either add that to your template or the cart will be inserted after the sub menu
- fixed all known bugs
Title: Re: Shopping cart
Post by: animas on December 11, 2008, 09:13:18 am
I was wondering if Modpack 1 ( http://stramm.st.funpic.org/displayimage.php?album=lastup&cat=0&pos=0 ) and Photo Shop (http://stramm.st.funpic.org/albums/userpics/10001/photo_shop_1_3_6.zip) are different. Does the modpack include photo shop plugin already?
Title: Re: Shopping cart
Post by: Jasondt2001 on December 13, 2008, 02:13:43 am
In Germany tax is 19%
Code: [Select]
$tax = number_format(($tot_price/119*19),2);
For a tax of eg 25% change it to
Code: [Select]
$tax = number_format(($tot_price/125*25),2);

Hello again Stramm, I sure appreciate your help!

What I'm wanting to do is add the tax to the total amount tag.
I've added all the numbering (and function to create the correct tax amounts). I have "Tax" shown where i want it on the display screen, but, I want to add the $tax amount to the $total_price tags so it will show the tax in the TOTAL amount area.

I guess what I'm trying to do is to make it display $tax+$total_price= X

Thanks for the help, I'm learning alot! The keytags and info you put in the software really help me see what does what when I look through it!

- Jason
Title: Re: Shopping cart
Post by: Stramm on December 13, 2008, 09:26:28 am
the total price is including the tax... just read that line
Code: [Select]
$tax = number_format(($tot_price/125*25),2);
Title: Re: Shopping cart
Post by: Jasondt2001 on December 13, 2008, 07:42:26 pm
the total price is including the tax... just read that line
Code: [Select]
$tax = number_format(($tot_price/125*25),2);

Ok, Got it!! Thank you!

Looks like I'm going to have to learn how to add 2 classes together and display them as the total!

Thanks for your help, I just read it wrong. :)

Merry Christmas!

- Jason
Title: Re: Shopping cart
Post by: metalguy639 on December 16, 2008, 09:02:55 am
I have 2 problems with this plugin. I've coded a skin for a client from a psd file. They already have this plugin installed on their site. I have 2 issues that I need to clear up.

1. How do I change the buttons to be links? Where is the code for this what file is it in? The little checkout menu and what have you has buttons but the theme we have done does not & I need to change this to make it stay all the same for my client.

2. After I click continue to checkout everything goes nuts in the theme. Its all out of whack. How do I solve this? Is the css meant to solve this problem that was provided in the plugin or is there some other way to solve it?

Thanks
Title: Re: Shopping cart
Post by: Stramm on December 16, 2008, 09:13:48 am
2. http://forum.coppermine-gallery.net/index.php/topic,53041.msg257802.html#msg257802
1. codebase.php - function photoshop_user_menu() - that's mainly pure html. So it should be no problem for you to modify it as needed.
Title: Re: Shopping cart
Post by: metalguy639 on December 16, 2008, 10:06:28 am
2. http://forum.coppermine-gallery.net/index.php/topic,53041.msg257802.html#msg257802

Did not work it made it WAYYYY worse :( I've attached screen shots of before & after I click on the checkout button.

1. codebase.php - function photoshop_user_menu() - that's mainly pure html. So it should be no problem for you to modify it as needed.

Worked & its now fixed, thanks.
Title: Re: Shopping cart
Post by: metalguy639 on December 16, 2008, 10:07:55 am
Sorry but apparently I cannot edit my last post...I attached the same shot twice, here's the other screen shot the after I click shot.
Title: Re: Shopping cart
Post by: Stramm on December 16, 2008, 10:53:15 am
in the before-viewcart.jpg I can't spot a problem... please point it out more clearly where you see an issue
Title: Re: Shopping cart
Post by: metalguy639 on December 16, 2008, 11:10:13 am
Its in the after view cart. I put the before view so you could see what it should look like just to give you an idea.
Title: Re: Shopping cart
Post by: Stramm on December 16, 2008, 12:54:31 pm
please zip your theme and attach it to your next post
Title: Re: Shopping cart
Post by: metalguy639 on December 16, 2008, 01:46:42 pm
I'm sorry but I cannot do that. As I said this is a theme for a client not a hobby site or just someone who is doing this in their spare time, this is a client's business site. I cannot post the theme in open forum for everyone to get it. This theme is a custom theme for that site only.

The theme is set in tables and I put the gallery code inside the center part of the table so just like the regular themes it should all fit in the center just like everything else. If you PM me your e-mail or something I can send you the files but I cannot post them on open forum. Thanks
Title: Re: Shopping cart
Post by: metalguy639 on December 18, 2008, 03:53:19 am
please zip your theme and attach it to your next post

Stramm I talked to my client adn they gave the ok for me to upload a zip file of the skin. Please let me know if we can fix this problem. Thanks.
Title: Re: Shopping cart
Post by: jaus on December 20, 2008, 11:03:16 pm
I have been experimenting with the paypal capability of the plugin on my test server and I am having trouble with making the paypal return url work.   I have specified a return url in gateway.inc.php, and when posting a payment to the paypal sandbox I get the "Return to ... " button.  Looking at the rollover url the root of my coppermine installation gets inserted at the front of my specified url (I assume thats intended), but when I click the return button the paypal sandbox url gets inserted as a prefix to that.

For example if I put 'index.php' in the url parameter, the return button in the sandbox will try to go to :

https://www.sandbox.paypal.com/us/cgi-bin/http%3A%2F%2Flocalhost%2FJoeAustinPhotography%2Fcpg1418%2Findex.php?merchant_return_link=Return+to+Joe+Austin%27s+Test+Store

Which results in a "404 - Webpage not found" error

Is there something I am missing in using the return url parameter?

I don't see any discussion of problems with it in this thread.

Thanks,
Joe.
Title: Re: Shopping cart
Post by: georgeandjacks on December 21, 2008, 07:17:36 am
Hello,

Thank you Stramm for making this excellent plugin and for all the support.

I was wondering if it is possible to add the "Add image to shopping basket" form to the top description bar on the Enlargeit plugin here http://forum.coppermine-gallery.net/index.php/topic,53290.0.html (http://forum.coppermine-gallery.net/index.php/topic,53290.0.html) and if so, how would I go about doing it?

Link to my gallery is: http://ederphotography.site50.net/cpg1419/ (http://ederphotography.site50.net/cpg1419/)

Thanks in advanced
Title: Re: Shopping cart
Post by: Stramm on December 21, 2008, 09:21:29 am
Stramm I talked to my client adn they gave the ok for me to upload a zip file of the skin. Please let me know if we can fix this problem. Thanks.

I haven't had time to look into that till now. But I'll post the new shop version today. Most probably it'll fix your problem.
Title: Re: Shopping cart
Post by: Stramm on December 21, 2008, 09:22:28 am
I have been experimenting with the paypal capability of the plugin on my test server and I am having trouble with making the paypal return url work.   I have specified a return url in gateway.inc.php, and when posting a payment to the paypal sandbox I get the "Return to ... " button.  Looking at the rollover url the root of my coppermine installation gets inserted at the front of my specified url (I assume thats intended), but when I click the return button the paypal sandbox url gets inserted as a prefix to that.

For example if I put 'index.php' in the url parameter, the return button in the sandbox will try to go to :

https://www.sandbox.paypal.com/us/cgi-bin/http%3A%2F%2Flocalhost%2FJoeAustinPhotography%2Fcpg1418%2Findex.php?merchant_return_link=Return+to+Joe+Austin%27s+Test+Store

Which results in a "404 - Webpage not found" error

Is there something I am missing in using the return url parameter?

I don't see any discussion of problems with it in this thread.

Thanks,
Joe.


The new version (somewhen up today) will fix that. It's a known problem.
Title: Re: Shopping cart
Post by: Stramm on December 21, 2008, 11:54:12 am
new version is up
new version: http://forum.coppermine-gallery.net/index.php/topic,57206.0.html