[checkout] 0.4.3beta - new features

alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2008-12-27 12:01

Here's the first beta for checkout version 0.4.3.

New features include:

Postage bands: assign higher rates for each service to heavier/larger products

Option sets: different products can have different sets of options, so you have the customer choose one out of (matt, gloss, lustre) for some products, and say one out of (red, green, blue) for others.

Accessories: this is going to need a bit of explanation. An accessory is basically an item that appears all the time on the Cart page. Let's use the example of a picture frame. To set up the feature, make yourself a 'hidden' album for accessories somewhere, using the hide items module. Upload a photo of the picture frame as a photo in that album. Then go to Edit Photo, the Checkout tab. Make the existing products all invisible for this photo, and under the "Offer this Item as an Accessory" section put the colours of the picture frame that you want to stock as the options. Then when you go to the cart page you have the choice of adding quantities of the frame in any/all colours to the order.

As usual I'd ask people to try this out on their test installations, and report any difficulties -thanks.

Oh, and I've not updated the po files yet.

EDIT: fixed a minor bug with postage rates (beta2)

EDIT: beta3, see below.

EDIT: code now released to the community repository.

 
Burnouts

Joined: 2007-01-31
Posts: 34
Posted: Sat, 2009-01-03 04:05

I get this when i press checkout

Quote:
postageBand = 1

0

Array
(
[0] => Array
(
[type] => Australia Wide
[price] => Array
(
[1] => 15
[2] =>
)

)

)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2009-01-03 09:47

thanks - I'll get that fixed.

 
treycentric

Joined: 2008-01-08
Posts: 6
Posted: Thu, 2009-01-08 00:00

Just out of curiosity, (since I've been manually hacking it in for every update for the last few versions), can you add a feature to the checkout module to specify a minimum order amount required to process (in my case, I require all orders to be a minimum of $25). The hack I've been doing hard codes a $25 check within the checkout pages. The only thing that would be needed in addition to what I've done is to parameterize it to use a new setting specified on the configuration page. I can send you what I have if you want to look at it. If you could drop it into 0.4.3 that would be great. Thanks for all you're doing on this. I love this module and it just keeps getting better and better.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-01-08 00:06

Sounds sensible, and straightforward. I'll see what I can do.

 
paulcobb

Joined: 2006-05-04
Posts: 122
Posted: Thu, 2009-01-08 17:44

Confirming also that when clicking 'continue to checkout'
The next page has this text at the top

postageBand = 1

Array
(
[0] => Array
(
[type] => Letter post
[price] => Array
(
[1] => 1.00
[2] => 2.00
)

)

[1] => Array
(
[type] => Special delivery
[price] => Array
(
[1] => 2.00
[2] => 4.00
)

)

)

Paul

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-01-08 18:21

Yes, sorry, it's some debugging info that got left in by mistake.

here's a version with treycentric's minimum order value feature, no (as far as I can see) extraneous output, and a couple of other changes to templates to improve the 'accessories' feature. (See updated code in first post.)

 
paulcobb

Joined: 2006-05-04
Posts: 122
Posted: Thu, 2009-01-08 21:48

Issues as I see them in no particular order, and not exhaustive - yet!

1, Extraneous output no more!

2. Relating to text in the descriptive text field below each item in 'products and prices' in checkout configuration - on step 1 of checkout procedure there is no separator between 'product-price-quantity' text and the above.

3. When minimum order value set - on checkout step 1 - the warning text is visible but no indication of what the minimum order value is!
Would it not be better to have the text as a warning but still allowing the transaction to continue?
EDIT - and make the total the minimum order value until it is exceeded.

Paul

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-01-08 22:10

Hi Paul,

1. Hurrah

2. Not quite sure I see - can you post a screenshot (perhaps I'm looking with the wrong theme?)

3. I think if people want a minimum order value, they should be putting some static text in the various templates to that effect (I see a bit of template editing as par-for-the-course if not an absolute requirement for this module) for instance in the terms and conditions, and in the cart contents block, which is likely to be more satisfactory all round when done in the style and at the position that the admin prefers. So I've gone for the lightest touch possible on the programming side, and not put the order value in the warning.

Also I'm 50:50 about bumping the order value up instead of throwing the user back to the selection page - it makes the accounting trickier to charge more for an order than the value of the products - where do you put the surcharge? as a special 'item'? or do you make the existing items more expensive?

I've just been experimenting and, you can use negative discounts to place a surcharge on orders under a certain amount. Use the first discount for orders *over* the threshold and have a zero discount. Then the second discount is for all orders and has a negative discount which gets added as a surcharge for all orders that don't match the first discount. Make both discounts apply by default. The wording is rather awkward (as you'll see if you try it) on the confirm page, but the logic appears to be correct. If there's any interest I can try to tidy up the appearance?

 
paulcobb

Joined: 2006-05-04
Posts: 122
Posted: Thu, 2009-01-08 22:56

2. Screen shot attached

3. Yes - what you say re templates is fair enough.
My feeling is that if you have a minimum order, whatever you order it ought to be 'automatic'.

As you say where do you put the surcharge?
I think the ordered items should be left intact and an invisible item added until the minimum order value is reached.

If the discounting logic is sound then maybe that would be the way to go??? (are you saying that you have updated the .zip file to try?).
I'm not actually too fussed myself regarding minimum order value but it it helps others then why not :-)

 
treycentric

Joined: 2008-01-08
Posts: 6
Posted: Thu, 2009-01-08 23:00

On mine, I didn't add a surcharge so that the order was a minimum amount, I just wouldn't let the user continue until they added enough products to meet or exceed the minimum required amount. Also, in mine I showed an error message that indicated that at least $25 must be spent (my minimum). I assumed this string would just include a variable to be populated by the setting on the configuration page and keep the user on the first checkout page (the one where products are added) until enough products were added to exceed the specified minimum amount.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-01-09 07:52
Quote:
2. Screen shot attached

I see the screen shot but I don't see the problem with it - could you annotate it to show what's wrong?

Checkout doesn't have facility for 'invisible' items, and I don't think the feature is important enough to justify rolling changes through into four or five code files and templates, so my decision is to stick to throwing the user back to the select page if the order doesn't meet the minimum requirements (just like if you haven't set a postage choice). The error message doesn't show the minimum amount, but that facility is available within the template if you want to edit it.

I haven't altered the discount code to do surcharges - I was just suggesting that would be a different way to do things.

 
jelzo

Joined: 2008-04-10
Posts: 67
Posted: Mon, 2009-01-19 00:24
alecmyers wrote:
Option sets: different products can have different sets of options, so you have the customer choose one out of (matt, gloss, lustre) for some products, and say one out of (red, green, blue) for others.

Hi Alec,

First, I would like to thank you for all the great work you put into this module.

- I need a system to have user or group specific prices and let the prices change when the users are logged in. I.e.-> User 1 buys item one for €10,- and user 2 buys it for €20,-. So, when the user is logged in, the price for user 2 on the photo page is €20,-.

Thanks in advance.

- Jelle

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2009-01-19 08:45
Quote:
- I need a system to have user or group specific prices and let the prices change when the users are logged in. I.e.-> User 1 buys item one for €10,- and user 2 buys it for €20,-. So, when the user is logged in, the price for user 2 on the photo page is €20,-.

Easy to do by modifying some code, but not available as a standard feature. How good's your php?

 
trins321
trins321's picture

Joined: 2009-01-13
Posts: 7
Posted: Mon, 2009-01-19 15:46

Hi.
First of all great work Alec on this checkout module, i have the 0.43 version installed and is working ok,
but I have following error, when doing maintainance - database backup. (but if I remove the checkout module from /modules folder,
then backup is finished with no problems)

My gallery 2.3 is embed in joomla 1.5.8.

Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.4 apache2handler
Webserver = Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.4
Database = mysql 5.0.45-community-nt, lock.system=database
Toolkits = Exif, Thumbnail, Gd, LinkItemToolkit, Dcraw, NetPBM, ImageMagick, Ffmpeg, SquareThumb, jpegtran
Acceleration = none/900, none/1800
Operating system = Windows NT DATA 5.2 build 3790
Default theme = matrix
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; sl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)

DATABASE BACKUP ERROR:

Error (ERROR_STORAGE_FAILURE)

* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage.class at line 494 (GalleryCoreApi::error)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 589 (GalleryStorage::search)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 470 (GalleryDatabaseExport::_exportData)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 341 (GalleryDatabaseExport::_exportTable)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 195 (GalleryDatabaseExport::_exportModule)
* in E:\xampp\htdocs\marketplace\modules\core\classes\DatabaseBackupTask.class at line 66 (GalleryDatabaseExport::exportToXmlFile)
* in E:\xampp\htdocs\marketplace\modules\core\AdminMaintenance.inc at line 128 (DatabaseBackupTask::run)
* in ??? at line 0 (AdminMaintenanceController::runTask)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryTemplateAdapter.class at line 1091
* in E:\xampp\G2data_93480sdfg346sdf33\smarty\templates_c\%%964382990\matrix\%%3A^3A8^3A818B59%%theme.tpl.php at line 59 (GalleryTemplateAdapter::trailer)
* in E:\xampp\htdocs\marketplace\lib\smarty\Smarty.class.php at line 1255
* in E:\xampp\htdocs\marketplace\modules\core\classes\GallerySmarty.class at line 61 (Smarty::fetch)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryTemplate.class at line 241 (GallerySmarty::fetch)
* in E:\xampp\htdocs\marketplace\main.php at line 506 (GalleryTemplate::display)
* in E:\xampp\htdocs\marketplace\main.php at line 104
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryEmbed.class at line 189
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\models\gallery.php at line 70 (GalleryEmbed::handleRequest)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\view.php at line 364 (G2BridgeModelgallery::getG2)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\views\gallery\view.html.php at line 30 (JView::get)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\controller.php at line 310 (G2BridgeViewgallery::display)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\controller.php at line 19 (JController::display)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\controller.php at line 236 (G2BridgeController::display)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\g2bridge.php at line 20 (JController::execute)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\helper.php at line 162
* in E:\xampp\htdocs\joomla15\includes\application.php at line 124 (JComponentHelper::renderComponent)
* in E:\xampp\htdocs\joomla15\index.php at line 68 (JSite::dispatch)

I would really like to use this module, but is there any ideas, why my error is showing up? I would really appriciate some help..

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2009-01-19 16:31

I've just run a backup on two vastly different Gallery installations, both with checkout installed (one very large, one very small, one on windows/apache/MSSQL, one on debian/apache/mysql) and it completed successfully both times. So I don't yet see evidence of a problem with the checkout module.

If I were you my next step would be to insert lines into modules/core/classes/GalleryStorage.class at line 494 so the code reads (from line 491)

if ($recordSet) {
	    return array(null, new GallerySearchResults($recordSet));
	} else {
            echo ("<pre>the following search failed to return a recordset:\n");
            print_r($query);
            print_r($data);
            echo("</pre>");
	    return array(GalleryCoreApi::error(ERROR_STORAGE_FAILURE), null);
	}

And see what that turns up.

 
trins321
trins321's picture

Joined: 2009-01-13
Posts: 7
Posted: Mon, 2009-01-19 20:06

Hi. Thanks for your reply Alec. I hope I understood your instructions correctly, but just in case I uploaded modified GalleryStorage.class as atachment.

When i ran database backup again the error changed a bit:

Error (ERROR_STORAGE_FAILURE)

* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage.class at line 499 (GalleryCoreApi::error)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 589 (GalleryStorage::search)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 470 (GalleryDatabaseExport::_exportData)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 341 (GalleryDatabaseExport::_exportTable)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryStorage\GalleryDatabaseExport.class at line 195 (GalleryDatabaseExport::_exportModule)
* in E:\xampp\htdocs\marketplace\modules\core\classes\DatabaseBackupTask.class at line 66 (GalleryDatabaseExport::exportToXmlFile)
* in E:\xampp\htdocs\marketplace\modules\core\AdminMaintenance.inc at line 128 (DatabaseBackupTask::run)
* in ??? at line 0 (AdminMaintenanceController::runTask)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryTemplateAdapter.class at line 1091
* in E:\xampp\G2data_93480sdfg346sdf33\smarty\templates_c\%%964382990\matrix\%%3A^3A8^3A818B59%%theme.tpl.php at line 59 (GalleryTemplateAdapter::trailer)
* in E:\xampp\htdocs\marketplace\lib\smarty\Smarty.class.php at line 1255
* in E:\xampp\htdocs\marketplace\modules\core\classes\GallerySmarty.class at line 61 (Smarty::fetch)
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryTemplate.class at line 241 (GallerySmarty::fetch)
* in E:\xampp\htdocs\marketplace\main.php at line 506 (GalleryTemplate::display)
* in E:\xampp\htdocs\marketplace\main.php at line 104
* in E:\xampp\htdocs\marketplace\modules\core\classes\GalleryEmbed.class at line 189
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\models\gallery.php at line 70 (GalleryEmbed::handleRequest)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\view.php at line 364 (G2BridgeModelgallery::getG2)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\views\gallery\view.html.php at line 30 (JView::get)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\controller.php at line 310 (G2BridgeViewgallery::display)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\controller.php at line 19 (JController::display)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\controller.php at line 236 (G2BridgeController::display)
* in E:\xampp\htdocs\joomla15\components\com_g2bridge\g2bridge.php at line 20 (JController::execute)
* in E:\xampp\htdocs\joomla15\libraries\joomla\application\component\helper.php at line 162
* in E:\xampp\htdocs\joomla15\includes\application.php at line 124 (JComponentHelper::renderComponent)
* in E:\xampp\htdocs\joomla15\index.php at line 68 (JSite::dispatch)

Nadaljuj...

the following search failed to return a recordset:
SELECT g_id, g_date, g_security, g_buyerId, g_host, g_languageCode, g_postage, g_postageType, g_discount, g_discountDescription, g_amount, g_firstName, g_lastName, g_email, g_recipientName, g_telephone, g_address1, g_address2, g_address3, g_address4, g_address5, g_addressZip, g_addressCountry, g_custNotes, g_custComments, g_paymentPlugin, g_timeConfirmed, g_timePaid, g_timeCleared, g_timeFulfil, g_timeFulfilled, g_timeCompleted, g_timeHold, g_timeProblem, g_timeDownloaded, g_downloadAttempts FROM g2_CheckoutTransaction ORDER BY g_id ASC, g_date ASC, g_security ASC, g_buyerId ASC, g_host ASC, g_languageCode ASC, g_postage ASC, g_postageType ASC, g_discount ASC, g_discountDescription ASC, g_amount ASC, g_firstName ASC, g_lastName ASC, g_email ASC, g_recipientName ASC, g_telephone ASC, g_address1 ASC, g_address2 ASC, g_address3 ASC, g_address4 ASC, g_address5 ASC, g_addressZip ASC, g_addressCountry ASC, g_custNotes ASC, g_custComments ASC, g_paymentPlugin ASC, g_timeConfirmed ASC, g_timePaid ASC, g_timeCleared ASC, g_timeFulfil ASC, g_timeFulfilled ASC, g_timeCompleted ASC, g_timeHold ASC, g_timeProblem ASC, g_timeDownloaded ASC, g_downloadAttempts ASCArray
(
)

Am I right in my assumption that the problem is in the database?

Could it be that error in database started with early versions of checkout and I need to delete this old tables first? And then reinstall with the new checkout plugin? If so which tables do I need to remove?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2009-01-19 20:21
Quote:
Am I right in my assumption that the problem is in the database? If so which tables do I need to edit?

Whoaa.... why is it that whenever there's a problem with Gallery people want to jump right in and start "editing the database"? You want to? Fine, go ahead. Edit some tables, any ones will do, see if that helps.

Quote:
Could it be that error in database started with early versions of checkout and I need to delete this old tables? And then reinstalled this new version?

Well, unlikely. checkout, like all Gallery modules, has upgrade code so no matter which version of checkout you start with, upgrading to the latest version updates all the db tables to be the same as if you'd started with the very latest version. I know, because it's a total PITA to add the extra code to make that happen - but it's there.

However, you said above that "if I remove the checkout module from /modules folder, then backup is finished with no problems" - I thought you meant you uninstalled the module and the backup worked. Do you mean to say you were just removing the code without uninstalling properly?

I've tested the query in your post, and it works fine (on my mysql installation). You could try the same, open phpMyAdmin on your db and run the following query (do try to resist the temptation to start changing things though):

Quote:
SELECT g_id, g_date, g_security, g_buyerId, g_host, g_languageCode, g_postage, g_postageType, g_discount, g_discountDescription, g_amount, g_firstName, g_lastName, g_email, g_recipientName, g_telephone, g_address1, g_address2, g_address3, g_address4, g_address5, g_addressZip, g_addressCountry, g_custNotes, g_custComments, g_paymentPlugin, g_timeConfirmed, g_timePaid, g_timeCleared, g_timeFulfil, g_timeFulfilled, g_timeCompleted, g_timeHold, g_timeProblem, g_timeDownloaded, g_downloadAttempts FROM g2_CheckoutTransaction ORDER BY g_id ASC, g_date ASC, g_security ASC, g_buyerId ASC, g_host ASC, g_languageCode ASC, g_postage ASC, g_postageType ASC, g_discount ASC, g_discountDescription ASC, g_amount ASC, g_firstName ASC, g_lastName ASC, g_email ASC, g_recipientName ASC, g_telephone ASC, g_address1 ASC, g_address2 ASC, g_address3 ASC, g_address4 ASC, g_address5 ASC, g_addressZip ASC, g_addressCountry ASC, g_custNotes ASC, g_custComments ASC, g_paymentPlugin ASC, g_timeConfirmed ASC, g_timePaid ASC, g_timeCleared ASC, g_timeFulfil ASC, g_timeFulfilled ASC, g_timeCompleted ASC, g_timeHold ASC, g_timeProblem ASC, g_timeDownloaded ASC, g_downloadAttempts ASC

In my case I get

Quote:
642 total, Query took 0.0106 sec

which is all 642 current rows in my transaction table. With a bit of luck you'll get an error instead; if you do, post it here.

 
trins321
trins321's picture

Joined: 2009-01-13
Posts: 7
Posted: Tue, 2009-01-20 12:25

Hey Alec, Just wanted to let you know I was able to fix checkout plugin easy by uninstalling the plugin, deleting and reinstalling. The troubles stared, becouse my upgrade to 2.3 didnt finished correctly due to java script errors, which are now fixed..
Tnx for help

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2009-01-20 12:54

Glad you got it sorted.

 
elfnmajic

Joined: 2009-01-29
Posts: 3
Posted: Thu, 2009-01-29 22:06

First, just a great job alecmyers. Very nice.

I do have a bug with 4.3 & google checkout 4.0. I've removed the prior version which worked fine and reinstalled. 4.3 only will allow the checkout if it is an 'SITE ADMIN'. I've checked the permissions and they are fine on root and albums for everybody and registered users ([checkout]Purchase item & [checkout]Purchase album but unless the user is a 'SITE ADMIN' your not worthy of the google checkout icon ;-) Otherwise it's working great if your an ADMIN.

I'm going to poke around the code and database to see what's up.

John

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-01-29 22:19
Quote:
4.3 only will allow the checkout if it is an 'SITE ADMIN'.

I think that's unlikely, as I've been taking many orders from the public via Google's Checkout for some months now!

Check that you're not running checkoutgoogle in "Test" mode - which (correctly) restricts display of the Google checkout option to admins.

 
elfnmajic

Joined: 2009-01-29
Posts: 3
Posted: Thu, 2009-01-29 23:50

No, I'm not running it in test mode. (Was the first thing I checked ;-). I loaded a fresh copy of 2.3 on another virtual server and reloaded checkout and then google.checkout and it works fine.

Again took a backup copy of the original on a different virtual server, unload and then delete the old version of checkout + google.checkout, confirm database records are gone then reload checkout + checkout.google and I have same issue. BTW if I was in test mode the google screen would indicate it with the watermark. Works with admin users though.

I'm going to look at it later this evening when I get some time.
Again thanks for all your work on this project.

John

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-01-30 08:47

I shall look forward to your finding the defect then!

 
Lisa11

Joined: 2009-01-31
Posts: 1
Posted: Sat, 2009-01-31 05:10

Before reading your article I don't have any idea about this . Thank's for giving me knowledge about a new thing.

Lisa11

 
jelzo

Joined: 2008-04-10
Posts: 67
Posted: Tue, 2009-02-03 12:45

Hi alec,

I have stored user-specific prices in a variable, lets say $cb_item1_price, cb_item2_price, cb_item3_price etc... Is there a way to use these prices with checkout? How? I promise to donate if i can fix this issue! Thanks in advance.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2009-02-03 12:52

No simple way, no. BTW isn't the amount of work that the Gallery team has already put into G2 isn't incentive enough to make a donation? Are you trying to bribe me to help you? Do you think I'm bothered if you donate or not?

 
jelzo

Joined: 2008-04-10
Posts: 67
Posted: Tue, 2009-02-03 19:37

Well im not trying to bribe you. :P I just need Gallery2 for a specific reason, and can't use it if i can't get this to work. I have now added {php}echo $cb_item1_price;{/php} to the price field of an item. You can't expect me to donate for something i can't use. I'm not living the american dream you know ;).

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2009-02-03 20:09
Quote:
You can't expect me to donate for something i can't use.

I'm not part of the Gallery development team, and I have no interest or expectations as to whether you donate at all.

 
nocloo

Joined: 2005-08-18
Posts: 37
Posted: Fri, 2009-02-06 05:58

Alec has done some tremendous work on the Checkout modules among others and especially being there to help many of us on various problems with the Checkout modules. He wasn't paid for the contributions he has made so far to the Gallery community and have done it on his own time/money, which we all have to be thankful for.

I'm sure you can hire some competent people to do the job you need, just remember the module is free and doesn't come with any guarantee nor personal support. Many has freely contributed to the Gallery project to make it what is is today, yet very few get the thank you they deserve. Many has sadly quit contributing because of the comments like yours and the time it takes to do the work for free. If you are not please with it, you don't have to use it. They are not here to make money, but simply sharing and make things better for all. That's the spirit of Open Source Software. I'm using Alec's module and have been happy with it and thank you Alec for all the time you spent on it.

 
natnatnat

Joined: 2009-03-12
Posts: 3
Posted: Thu, 2009-03-12 03:20

Discounts.

My client would like to offer a volume discount for all prints EXCEPT for canvases.
For example, purchase > $200 worth of gloss or matt prints & receive 20% off your order. Discount does not apply to prints ordered on canvas.

Any help would be most appreciated.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-03-12 09:02

You'll need to do some coding. How good is your knowledge of php and the Gallery API?

 
natnatnat

Joined: 2009-03-12
Posts: 3
Posted: Thu, 2009-03-12 12:46

Thanks for replying.

I am not exactly an expert but I've been able implement other people's hacks and modify some code, esp within the themes, to get things looking the way I want:
http://www.2photographic.com.au/gallery2/gallery2embedded.php
I'm not sure where that puts me on the scale of PHP literacy?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-03-12 13:33

Well... do you want to do it the correct way, or implement a nasty hack?

 
natnatnat

Joined: 2009-03-12
Posts: 3
Posted: Fri, 2009-03-13 01:05

I prefer to do things the correct way - where possible.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-03-13 07:32

Then to do that you'll need to write a new Gallery module to use the interfaces built into the checkout module to implement the discount in your preferred manner. You'll also want to add a user interface, probably in the edit photo -> checkout tab so admins can set which discounts do/don't apply to which items.

 
ASNet0007

Joined: 2006-10-17
Posts: 177
Posted: Fri, 2009-03-13 09:57

alec on your site the postage is always visible while selecting item quantities. On my site it only appears after I have selected continue to checkout, and then the user is told 'Your order requires postage. Please confirm your selection'. Have you changed the code on your site to always display the postage options?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-03-13 10:10
Quote:
Have you changed the code on your site to always display the postage options?

No; my site has a default quantity of 1 for an item that requires postage. You therefore rarely see a cart whose contents don't require postage, so it always shows.

If you want it always to show, it's a pretty trivial change.

 
ASNet0007

Joined: 2006-10-17
Posts: 177
Posted: Tue, 2009-03-17 11:08

Could you help me with this change. I am no good at coding but can follow instruction just about.
Cheers

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2009-03-17 11:18

Change modules/checkout/Select.inc line 133 from:

		$offerPostage = false;

to

 	        $offerPostage = true;
 
magicrob

Joined: 2009-01-07
Posts: 6
Posted: Wed, 2009-03-18 08:32

Is there anyway to only allow certain payment types to certain user groups?

Basically I would like to do this:

Usergroup1
- Accept payment via Email = 30day invoice
- Payment via Paypal

Usergroup 2
- Payment via Paypal only

Usergroup 3
- Accept payment via Email = list of images, no direct download

The first two I want to give access to download images once the email order has been submitted or once the paypal payment has cleared.

The third I want that submitted and I'll process that one manually.

EDIT:- I suppose to look at this a different way, is there a way to allow certain groups to download before payment clears?

EDIT #2:- Hrmmm I could achieve the same by creating a gallery permission couldn't I and then adding a condition to check in the module?

EDIT #3:- New Permission + Module Check = Best option. Much better :)

Here's what I did:

/checkoutdownload/module.inc - From line 82

//	return null;
	if (!isset($currentVersion)) {
	    /* Initial install.  Register our permissions */
	    $permissions[] = array('allowDownloadPrePurchase', $gallery->i18n('[checkoutdownload] Allow download before payment item'), 0, array());
	    foreach ($permissions as $p) {
		$ret = GalleryCoreApi::registerPermission($this->getId(), 'checkoutdownload.' . $p[0], $p[1], $p[2], $p[3]);
			if ($ret) {
		    	return $ret;
			}
   	    }
	}

then in:
/checkoutdownload/classes/CheckoutDownloadHelper.class - down the bottom

	if (!$checkoutParams['allowDownloadsPrePurchase']  && !$transaction->getFlagCleared() && isset($permissions[$item->getId()]['checkoutdownload.allowDownloadPrePurchase'])) {
	    return array (null, 'notPaid');
        }
 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-03-18 09:26

You could modify checkoutemail and checkoutpaypal to have their own permissions, then include a permissions check in the ...PaymentPlugin.class in function getVariables() I suppose.
Personally I'd set a variable $availableToThisuser and then test for it in the template (eg. Payment.tpl) or just set $active to false if the permission is absent.

Edit: DOH - I've just thought of the problem with doing this (and with your suggestion above) - permissions are set on a per-item/album basis, so what would you do if a user has in the basket one item that can be purchased via paypal, and one item that can't? Or one item that's available for download-before-payment, and one that isn't?

Not insurmountable difficulties, but need careful thought to give operation consistent with reasonable behaviour.

 
magicrob

Joined: 2009-01-07
Posts: 6
Posted: Fri, 2009-03-20 03:02

Yes that is a problem, but it's ok, I'm setting the permission at the root level so it's over every item.

Basically one group of users is on a 30 day invoice. They can purchase whatever they want, and can download straight away and pay within 30 day.

The rest need to front cash before we release images to download :) AFAIK that happens automagically via PayPal and if they're paying by invoice, Bank Account which we need to reconcile manually then click the payment cleared button.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-03-20 11:09
Quote:
Yes that is a problem, but it's ok, I'm setting the permission at the root level so it's over every item.

I agree it's a neat hack... I was considering implementing it in the next release after reading what you've done, but only if I (or someone) can think of a consistent way to implement it.

OK, I've thought of a sensible way of doing it now. I'll see what I can come up with.

 
trins321
trins321's picture

Joined: 2009-01-13
Posts: 7
Posted: Thu, 2009-08-20 15:20

Hi Alec,

I have a question about this checkout module.. Is there an option to remove "Offer this Item as an Accessory" option when editing the prices from user album? Well at least so that accessory options arent visible to users in their album?

Best regards,

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-08-20 16:26
Quote:
Is there an option to remove "Offer this Item as an Accessory" option when editing the prices from user album? Well at least so that accessory options arent visible to users in their album?

There's no formal option; you could try editing the template and making the relevant fields hidden, I suppose.