[cpg1.4.x]: Shopping cart (new version) - Page 7 [cpg1.4.x]: Shopping cart (new version) - Page 7
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[cpg1.4.x]: Shopping cart (new version)

Started by Stramm, December 21, 2008, 11:43:01 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Fabricio Ferrero

My bad...  :-X

I read it very quickly searching for "category", I didn't find the word and I wrongly assumed that it was not possible.

Thanks,
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Graham66

I have recently created a Coppermine site and have installed the Photo_Shop shopping cart plug-in.  I am not a PHP programmer and had no experience of it at all until I started on my site a couple of weeks ago, but so far, generally so good, and thank you so much for the work which has gone into these products.

Two questions, if I may please:

1.  I have the shopping cart enabled on one gallery only, and this is how I want to keep it.  If I create a new gallery, or (more importantly) another user creates a User Gallery, it is created with the shopping cart enabled, which is not what I want at all.  Is it possible to modify anything such that the default for a new gallery is that the shopping cart is inactive unless and until expressly enabled by the administrator, even if it is active on other galleries?

2.  I am afraid the apostrophe raises its ugly head again!  I have seen that it used to be an issue with the main Coppermine configuration that odd characters would be generated when the site title and certain other words contained an apostrophe, but that this was fixed.  My site is called "Graham's photography galleries".  The problem is that when emails are created as a result of a user confirming an order, the "from" field of the confirmatory email appears as "Graham's photography galleries".

The problem seems to arise from one of the Photo_Shop PHP files, since the confirmatory email which is sent if a new user creates an account correctly shows as "Graham's photography galleries".  I assume this is something which would need to be corrected in photo_shop_checkout.php.  I have read the old threads about how this was corected for the main programme and have tried copying in the HTML_SUBST code which was used previoulsy, but unfortunately this is not working and I am not suffieintly skilled in PHP to know what to try next.  Any guidance as to how to fix this, which I suspect is something fairly simple for those who know how, would be much appreciated.

Thank you for any help you can give on these.  My site is at www.a1rat.com/coppermine, and there is a dummy user account test/test.
The shopping cart is enabled only in the Chichen Itza gallery (this is only as a test to get things working properly - I am not actually selling anything yet!).

Graham

Stramm

With a small change (unfortunately it'll need another query) it's possible to change to function of the 'per album settings' in the shops config.
By default the system looks up if there's an entry in the db for a certain album. If not, it shows the album. If there is an entry, it may mean that the album should not be displayed or that this album should show different prices.
We just invert the meaning of the checkbox 'Shop enabled for this album'. If the checkbox is checked, then the shop is disabled for that album.


To do that find in codebase.php
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_PRICES']} WHERE aid={$pic_data['aid']}");

    while ($temp_data = mysql_fetch_array($results)) {
if($temp_data['gid']=='-1') return $pic_data;
$SHOP_CONFIG[$temp_data['gid']]['price']=$temp_data['price'];
}
mysql_free_result($results);


and replace with


$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_PRICES']} WHERE aid={$pic_data['aid']} AND gid=-1");

$temp_data = mysql_fetch_array($results);
if(!$temp_data['gid']=='-1') return $pic_data;
else
{
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP_PRICES']} WHERE aid={$pic_data['aid']}");
    while ($temp_data = mysql_fetch_array($results)) {
$SHOP_CONFIG[$temp_data['gid']]['price']=$temp_data['price'];
}
}

mysql_free_result($results);


For your second question.... make sure the lang file is saved as utf-8

Graham66

Thank you for your prompt reply.

The reversal of the meaning of the checkbox works perfectly.  To tie in with this, I altered 'shop_enabled' in line 95 of english.php to read "=> 'Shop disabled for this album',", so that the text against the checkbox reflects the checked or unchecked status.

In relation to the apostrophe problem, however, I have checked the file format, and this is apparently not the source of the problem.  In fact, I did not expect it to be, although I did re-save the lang file, to check.  The problem occurred right from the very first test I did of the cart, before I had altered any of the files in the plug-in, and therefore before I had had the opportunity to change the encoding (assuming that the files in the distribution package were encoded in this way).  Do you have any other suggestions, please?

Thank you for your help

Graham

Stramm

Yep, working while registering but not for eg. ecards

to fix that find in photo_shop_checkout.php
if(cpg_mail($user_info['user_email'], $subject, $mail_body, 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'] )) {

and replace with
if(cpg_mail($user_info['user_email'], $subject, $mail_body)) {


Please report back if it works and if you recognize any drawbacks.

Graham66

Thank you for the fix.  I have made the change, and this broadly works.  Certainly for my gallery name with an apostrophe, it is fine.  I have, however, found one instance in which is does not work.  As an experiment, I created a new user with a name which contains an apostrophe (the name I used was "test's control", but I am sure this does not matter), and then had this user send an ecard.  The outcome was that the email subject appeared correctly as "An e-card from test's control for you", but the email sender showed as "test's control".  The text within the body of the email was fine, however.

This is clearly a far less important issue than previously - how many users would ever register with an apostrophe in their user name and then send an ecard, I wonder? - but I wanted this to work.  I seem to have solved the issue by including, after the exisiting line 32 of mailer.inc.php, the line:

$sender_name = strtr($sender_name, array_flip($HTML_SUBST));

In the limited time I have had to try this out, it seems to work, at least for ecards.  Hopefully it will not have any adverse knock on effects, but if I discover any, I will let you know.

Many thanks for your help in sorting this out.

Graham


feline

Stramm, the widow of an WWII ex-prisoner of war in Germany is back. 
Making an item cost 0.00 does not work for me.  What can I do to have a unique price list for each album?
Ruth

http://arthursphoto.com/coppermine/cpg1.4.21/cpg14x/index.php

Aeronautic

Hey Stramm,

Got a strange one.

Brand new install over the weekend.

Running:
Coppermine Photo Gallery 1.4.21 (stable)
Same version of your Mod Pack
Plug-ins:
Name Final_Extract2 v1.0     
Name Keywords_add v1.1   
Name Copy /Paste BB Code image url v1.2   
Name Photo Shop v1.4.0 

For reference, another thread I had open that is now solved, but insight into my troubleshooting so far:

http://forum.coppermine-gallery.net/index.php/topic,59102.0.html

While I've got this exact same set-up running correctly elsewhere, at this new gallery, now that I've got no more full-size images popping up incorrectly like this (just two copies of a scrap test file with diff file names):

http://www.pupandhorse.com/dog-pictures/displayimage.php?pos=-2

instead, they are displaying like this:

http://www.pupandhorse.com/dog-pictures/displayimage.php?pos=-4

Unlike the other correct install, your shop plug-in no longer "knows" how big the upload was and is only offering the smallest file size for purchase (see link just above).

I'm trying to get the link above to display just like it is now without a javascript call to a fullsize image, but, with the cart offering purchase of files up to the full size (as in the first link drop down choices). Make sense?

Thank you for your great contributions and help!

Stramm

I can't open your site so I'm just guessing...
-permissions (check the orig_ and the fullsized image, check if the orig_ has been created, If php can't read the orig, it'll use the fullsized image to determine the dimensions; if that's resized to a smaller size [and if this size is approx your smallest offer in the shop, you'll have the solution]) --> change file/ folder permission [coppermine config and/ or FTP] --> you also may try to http upload an image and try if that works

Aeronautic

Thanks for the speedy reply Stramm.

Orig file is there - but - it got re-sized...

Ah... digging further. My bad! Here is what happened (don't let this happen to you!) ;)

While testing I put the file up there again without the permission change to the actual file (via FTP/batch). Saw it was still not doing what I wanted it to do (per my other thread). Changed the permission by hand on the file. Ran the Admin tool. Changed "everything" on the re-size. Voila, re-sized original - not what I wanted.

Just uploaded via FTP/batch. Changed permission on the actual file. Added it via batch. All is good in the world. My thanks to you again Stramm.

If you PM me your IP I'll double check the firewall is not blocking it for some odd reason just in case you'd like to take a look.

Stramm

k, I'm glad you find the solution for your problem.

And it seems that this is a region based block (as another supporter based in Europe wasn't able to view your site, too).

Aeronautic

Re: Block - was the other supporter not in South America? Should you wish to PM me the IP I'll be sure you can get in. Our server's security has tightened of late.

Again, my thanks for your help and the many contributions (mod, plug-ins, etc.)

feline

When I discovered the reason that putting o.oo in the shop configeration did not work for me I felt silly.  The table that appears BELOW on the screen after a save of the shop config is the place to remove prices with a 0.00.  Then I can select album, delete prices on items not wanted (0.00) and update album.  Works great! 
Ruth

feline

An item is added to the shopping basket.  Then the box "1 image in cart" is clicked.  The new screen shows a minipic and item details.  Can the 'pricelist' under these details be preventeds from showing?  All album prices show on the pricelist and I do not want all pricing to show.   Thanks.

Stramm

in photo_shop_cart.php find
photoshop_pricelist();
and comment it out
//photoshop_pricelist();

Aeronautic

I thought I'd share a tip I'm using. I've noticed some customers were confused about the need to click the paypal button to complete the checkout so I modified the language file and took the opportunity to tweak a couple of other messages at the same time. This is appropriate for my stock photo business, but may not be fully appropriate for all users. Please take or leave any of it.

It:

1) Encourages customers to click the paypal button to checkout with any major credit card and reminds them no paypal account required.
2) Tells them to look in their spam folder for the confirmation e-mail that is coming.
3) Reminds them that their purchase binds them to the terms of the site license.

In:

yoursite/pathtocpg/plugins/photo_shop/lang/english.php

Look around line 137 or so for this code:

'email_sent' => 'Thanks for your order.<br> We have sent you a confirmation email! <br>Your order will be processed after payment! <br>',

And consider making the changes here:

'email_sent' => 'Thank you for your order - it is almost complete!<p> We are sending you a confirmation email - check your SPAM folder! <p>Your order will be processed automatically after your payment.<p><font color="red"><i>IMPORTANT</i></font> - YOU MUST CLICK THE PAYPAL BUTTON NOW TO COMPLETE THE ORDER WITH ANY MAJOR CREDIT CARD - NO PAYPAL ACCOUNT NEEDED. <p><font color="red"><i>NOTICE</i></font>:Your purchase indicates your agreement to be bound by our <a href="http://www.YOURSITE.com/pathto/YOURTERMS.html" title="license - click to read" target="_blank"><font color="blue">license terms</font></a>. (a new window will open)<br>',

JackDeth

First of all, thanks Stramm. Great plugin! I found it just when I needed it for a photographer friend.

Everything, so far, appears to work pretty well. However, I've run into what appears to me to be a bug, but if not maybe you can explain.

When a user adds several pictures to the shopping cart, then click the button to view cart, you see the list of pictures. In the fourth column you have an "Amount" listed with a box and a 1 there.

I assume when you say "Amount" you really mean Qty (quantity)??

If this is the case, the user tries to change the quantity to order more than one picture (they will be sent prints) and then clicks "Save New Amounts", but nothing changes and it reverts back to a 1 again.

How do we get around this since he wants to sell multiple prints? Thanks in advance!


TRS

genesisncc

#137
Hello

I have recently setup a WorldPay Merchant account with the Royal Bank of Scotland

I am currently running the coppermine gallery on our site http://www.genesisphotographers.org.uk/gallery

I would like to add the functionality of WorldPay as this would be a big help to me. WorldPay have told me its quite simple just need the total amounts to be added to a HTML redirect script file from the final checkout page.

Does anyone know a way of integrating WorldPay?

These are the details i have from them:

---

Dear Mr McDonough,

I am pleased to inform you that your application is now at the final stage. Once you are ready to start trading, please make sure you have completed the following steps:
1. You have completed the technical integration of your website with our Payment Service and have made a test purchase/order to check that your integration is working correctly
2. Your integration is set to work in test mode (your store is set to 'test' or your testMode parameter equals '100', e.g. <input type=hidden name="testMode" value="100">)
3. Your website fully complies with our website rules (we will not be able to activate your installation until your website is fully compliant). Our website rules can be found on our support website at http://www.worldpay.com/support/content.php?page=startup&sub=website
** Please note you should not submit your activation request until you have completed steps 1-3 above. Failure to do so will result in a delay in activating your installation to take payments **
4. You have submitted an activation request. To submit your activation request, you will need to log in to the Merchant Administration Interface (MAI) and follow the instructions outlined in our Test and Go Live guide http://www.worldpay.com/support/kb/mergedProjects/testandgolive/tgl5201.html
Within two working days of receiving your activation request we will place a test purchase/order on your website using the instructions you provide in the MAI and check that your website meets our requirements (if we encounter any issues during our testing we will contact you by email).
After successfully testing your website, we will activate your installation and send confirmation to you by email (please follow the instructions outlined in this email to start accepting live payments on your website).
If you have any queries or require further information about connecting your website to our Payment Service, please refer to our support website http://www.worldpay.com/support/content.php?page=technical
Best regards,
XXXX [Edit GauGau 2009-05-23 17:28 h UTC+2] Removed name as per request [/Edit]
Customer Services Administration

---

Many Thanks

Graham McDonough

tinorebel

Hallo to all readers, big up to Stramm for this excelent plug-in.

I am using this shop on my website, a small photostock selling images, with good resoults.
I just thought it would be great to have a link in the e-mail sent to the clients if they want to pay with pay-pal.
Is it possible to include in the e-mail the link to pay-pal?

I dont understand coding enoughf but maby it could be an easy and usefull mod.
If someone can give me a hint it would be greatly appreciated.

Live long and prosper!
www.tripodart.net

Stramm

Quote from: genesisncc on May 12, 2009, 02:38:46 PM
Hello

I have recently setup a WorldPay Merchant account with the Royal Bank of Scotland

I am currently running the coppermine gallery on our site http://www.genesisphotographers.org.uk/gallery

I would like to add the functionality of WorldPay as this would be a big help to me. WorldPay have told me its quite simple just need the total amounts to be added to a HTML redirect script file from the final checkout page.

Does anyone know a way of integrating WorldPay?

Pretty easy.... edit photo_shop_checkout.php

before
//pay by wire
add
if ($CONFIG['photo_shop_cc_enable'] && $order_price > 0) {
$msg_box_txt .= <<<EOT


EOT;
}


Between the EOTs write the html necessary for your billing system. Have a llok at the paypal and google versions. These should teach you what to do.
Finally enable Credit Card payment in the shop config.