Converting E-Commerce 4.7 modules to 5.0

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
gordon's picture


Overview of E-Commerce API changes

  1. paymentapi() - new admin flag is being past to payment gateways. - removed
  2. paymentapi() - add destination to payment page
  3. hook_store_email_send() removed
  4. Standard admin paths: admin/store and admin/ecsettings

New admin flag added to paymentapi()

The call to the paymentapi() has been changed to include an admin flag which tells the payment gateways that it is being called from a store administration page and that it can include additional options when processing.

An example of this would be if there is a cheque module. The user will only be presented where to send the cheque, but when the store receives the cheque they will make the payment and enter the drawer, bank, cheque number and other information to create the deposit report.

The paymentapi will change from:-

<?php
function hook_paymentapi(&$txn, $op, $arg3 = '') {
}
?>

to

<?php
function hook_paymentapi(&$txn, $op, $admin = FALSE, $arg4 = '') {
}
?>

This method is going to be removed in favour of the new #access flag in the formapi.

Add destination to payment page

For the paymentapi() the "payment page" option, this can include a in $arg4 the destination to goto after the page has been completed.

This is used when making payments to transactions after the checkout process has completed. This will return the users back to where the user was before they started the "make payment" process.

hook_store_email_send() removed

With the changes to user_mail, drupal_mail() is basically the same as store_email_send(). This function has been removed and the new hook_mail_alter() can be used to do the same thing.

Clean admin paths

All admin pages have consistent paths. There are two blocks for E-Commerce in the site administration: "E-Commerce store" and "E-Commerce settings". Please note that the number of tokens in the path has changed in many cases, so changes how you use arg() may be required.

E-Commerce store - admin/store - is for day to day tasks of the store owner or administrator.
E-Commerce settings - admin/ecsettings - is for configuration settings that are done once or only rarely.

Comments

hook_mail_alter

moshe weitzman's picture

ecommerce might want to get rid of its custom mail customizing hooks and just use hook_mail_alter()

I have now removed the

gordon's picture

I have now removed the store_email_send() and it is now using the drupal_mail() instead.

--
Gordon Heydon

I'm very interested to know

harrisben's picture

I'm very interested to know the progress of e-commerce in terms of it's readiness for Drupal 5.0 (beta 1). If there is a list of fixes/additions from 4.7 to the 5.0 release I'd also love to see that (in the vain hope that tangibles can now have subproducts).

I'm assuming that gordon

sime's picture

I'm assuming that gordon won't make an announcement until at least Drupal core 5.0 is released. And even then, well, it'll be ready when it's ready :-P

I don't see much work happening on subproducts I'm afraid. I might be wrong.

miultistep for checkout

moshe weitzman's picture

i mentioned before that the new multi_step forms seems ideal for the plggable checkout process in e-commerce. just let modules form alter themselves into the checkout.

e-Commerce Module

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: