Drupal commerce checkout的流程由多个page组成,每个page上面可以有多个pane。模块可以定义自己提供的pane,一个例子是commerce_customer.module里面的commerce_customer_commerce_checkout_pane_info函数。
每个pane里面定义的form可以通过callback显示,一个例子是commerce_customer.checkout_pane.inc里面的commerce_customer_profile_pane_checkout_form函数。
每个pane里面定义的form是可以通过admin管理页面设置的,因此需要定义这个pane的settings_form。模块可以定义模块提供的pane的相应settings_form。一个例子是commerce_customer.checkout_pane.inc的commerce_customer_profile_pane_settings_form函数。而commerce_checkout.admin.inc里面的commerce_checkout_pane_settings_form函数定义了一个公共的settings_form。
提交settings_form时,执行的代码在commerce_checkout.admin.inc的commerce_checkout_pane_settings_form_save_submit函数。重置settings_form时,执行的代码在commerce_checkout.admin.inc的commerce_checkout_pane_settings_form_reset_submit函数。
本文详细介绍了Drupal Commerce模块中Checkout流程的工作原理。重点阐述了如何通过自定义pane来扩展Checkout流程,包括如何创建和配置form以及设置管理界面。
774

被折叠的 条评论
为什么被折叠?



