Payment模块:一个简单的Drupal Commerce替代方案

最近在OSTraining我们做了针对Drupal Commerce的全面的攻略。你可以观看30节课程的视频教程和下载“Building E-commerce Sites with Drupal Commerce”电子书。

然而,Drupal Commerce是一个企业级的解决方案,但是大多数OSTraining的学员们可能需要的只是一个简单的电子商务方案。


Payment模块支持差不多六个支付网关(PayPal, Stripe, iDEAL,, Ogone, Rabo OmniKassa)。

在这个教程里,我们将展示如何使用Payment模块,并且启用Paypal支付。 Continue reading Payment模块:一个简单的Drupal Commerce替代方案

Drupal Template File

There are already have some Drupal core function let us using templates. As the following.  For Drupal 6, Drupal 6 Template Suggestions will help. If you want customise more flexible conditions, have a look on Working with template suggestions .

For Node:

Just use the following file name rules to template drupal:

  1. page.tpl.php (global)
  2. page-front.tpl.php (front page)
  3. page-node-edit.tpl.php (node edit)
  4. page-node-[#].tpl.php (specific node)
  5. page-node.tpl.php (nodes – global)
  6. page-[internal/path].tpl.php (specific path)
  7. page-node-[content type].tpl.php  (specific content type)

If not add the page prefix, like the following, then it will use page prefixed tpl file as their parent template( which already have layout including header and footer  )

  1. node.tpl.php
  2. node-[#].tpl.php
  3. node-[content type].tpl.php

For block:

take a look at this page:

Drupal 7

In Drupal 7 template files are searched in the following order:

  • block–block–[block-id].tpl.php
  • block–[module]–[delta].tpl.php
  • block–[module].tpl.php
  • block–[region].tpl.php
  • block.tpl.php

If the block delta key uses a hyphen, (-), replace this with an underscore (_).

Drupal 7 Template (Theme Hook) Suggestions

Drupal 5 & 6

In Drupal 5 and 6, template files are searched in the following order:

  • block-[module]-[delta].tpl.php
  • block-[module].tpl.php
  • block-[region].tpl.php
  • block.tpl.php

For example, the user login block has a delta of ‘0’. If you put it in the left sidebar, when it’s rendered, PHPTemplate will search for the following templates in descending order:

  • block-user-0.tpl.php
  • block-user.tpl.php
  • block-left.tpl.php
  • block.tpl.php