Checkout wont allow $0.00 cost items to be downloaded.

surjer1

Joined: 2008-11-15
Posts: 5
Posted: Mon, 2008-12-08 12:05

I was hoping site visitors would be able to add some of the free photo's to their cart. Is this not possible?

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3870
Posted: Mon, 2008-12-08 13:05

Describe how you've set up your products/options/download-option, what you're doing, how you expect it to function, and how it does in fact function.

Login or register to post comments
surjer1

Joined: 2008-11-15
Posts: 5
Posted: Tue, 2008-12-09 00:02

Sorry for the lack of detail. I will try to explain it further. Thanks for the reply by the way..

Under "Checkout eCommerce Settings" - "Products and Prices" I created an option called "Digital Download" @ a price of 0.

Under "Checkout Downloadable Items Settings" my "Digital Delivery" option shows up and I have a checkmark next to "Downloadable"

I dont have a check mark next to allow download before payment clears as there are other options for physical prints to be ordered.

The way I would like this to work is visitors can download the low resolution version of the image for free. They should also have the option to purchase a high resolution print if they want to..

What happens now is if they select a physical print the checkout process works as planned. If they select only a digital download they get to the screen which expects a payment option but no payment option is displayed cause the cart is $0.00 which makes sense. Im betting this is happening due to me having the "Dont allow download before payment clears but how do I get around that for the Higher Resolution PAID photo's.

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3870
Posted: Tue, 2008-12-09 08:46
Quote:
If they select only a digital download they get to the screen which expects a payment option but no payment option is displayed cause the cart is $0.00 which makes sense.

The checkoutemail payment option (only) does allow orders with $0 value, and progresses them immediately to "payment cleared" status after the customer details have been entered in that case, so the download can be made immediately. So you should install and use that. You must have at least one payment option that the customer can use for the order status to be changed to "payment cleared" which is a prerequisite for downloading - except when the "Allow download before payment" option is checked.

Two customizations you might want to make (they can both be done by template editing) are firstly to prevent checkoutemail displaying if the order value is non-zero (i.e. you don't want to give people the option to pay by cheque) and further (it only makes sense for a non-zero order value) *not* to ask for customer details if you really don't want to trouble people to enter their details and you don't care to have a record of who's downloading from your site. But those would be custom modifications for you to make, as they're not going to be something everybody wants. I can describe in outline how to do those if you want.

It doesn't really have anything to do with the "Allow download before payment" option. In your situation this option is not useful as it applies to all downloads, including the ones you want people to pay for - as you have seen.

Login or register to post comments
Soulcage

Joined: 2009-02-19
Posts: 6
Posted: Thu, 2009-02-19 03:45
Quote:
I can describe in outline how to do those if you want.

I'm interested to hide checkoutemail when orders are non-zero. Alecmyers - can you please describe the process?

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3870
Posted: Thu, 2009-02-19 09:37
Quote:
I'm interested to hide checkoutemail when orders are non-zero. Alecmyers - can you please describe the process?

Sure.

Edit the Payment.tpl file, look for the line (currently line 5) that reads

{if $payment.paymentVariables.active}

and change it to

{if $payment.paymentVariables.active && $payment.paymentVariables.orderTotal == 0}

Follow the usual procedure for modifying template files; see the header of the file for details, if you're not sure.

Login or register to post comments
Soulcage

Joined: 2009-02-19
Posts: 6
Posted: Fri, 2009-02-20 22:23

Hmmm - the code makes sense but doesn't seem to work for me. The button still shows up despite the change. I've moved the template properly, as other changes do appear (random text, etc.) Interestingly, when I embed {$payment.paymentVariables.orderTotal} within a cell of the table in Payment.tpl, it does not print out any value, as I would expect. Any ideas?

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3870
Posted: Fri, 2009-02-20 22:25

You've saved the change to the master Payment.tpl, instead of editing your (pre-existing) local/Payment.tpl file.

Alternatively, you're using Gallery 2.3 and you haven't flushed the template cache (no-longer happens automatically for template file changes). You can temporarily disable the template cache in site admin -> performance (I think) which you should do while editing templates, then reenable it after.

Login or register to post comments
Soulcage

Joined: 2009-02-19
Posts: 6
Posted: Fri, 2009-02-20 23:14

The change should be made in Payment.tpl within the checkoutemail/templates/local directory - correct? I've made the change here with no luck. Template caching is turned off, as when I add random text to the html, it appears on the screen.

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 3870
Posted: Fri, 2009-02-20 23:30

Oh, my error then.

Try additionally adding these lines to checkoutemail/classes/CheckoutEmailPaymentPlugin.class, at line 58:

	list ($ret, $transaction) = GalleryCheckoutApi::getCurrentTransactionForPayment();
	if ($ret) {
	    return array($ret, null);
	}
	$transactionId = $transaction->getId();
	
	$orderTotal = $transaction->getAmount();

and also change lines 77 ff. to read

	return array(null, array('paymentButtonText' => $paymentButtonText, 
				'paymentText' => $paymentText,
                                'orderTotal' => $orderTotal,
				'active' => $active));

I'll schedule something like that into an update for checkoutemail soon - but that might get you going. (I haven't tested it - let me know if it works.)

EDIT: corrected filename as per post below.

Login or register to post comments
Soulcage

Joined: 2009-02-19
Posts: 6
Posted: Sat, 2009-02-21 00:21

That did it! BTW - the file to edit is CheckoutEmailPaymentPlugin.class (there is another file called CheckoutEmailEmailPlugin.class in the same directory). Thanks!

Login or register to post comments