Once you save this code and enable your new module you will see your new line item type under STORE->CONFIGURATION->LINE ITEM TYPES That's all there is to creating a new custom line item type. 'add_form_submit_value' => t ( 'Add Payment' ), 'description' => t ( 'A payment or Donation' ), Please these two files into a folder called customer_commerce. Your module will start with the following two files: custom_ and custom_commerce.module. There are many resources available to help you get started, our quick start article is Creating a Basic Drupal 7 Module. If you’re not familiar with creating a custom module for Drupal yet it’s actually quite easy. For this example, we’ll call our module custom_commerce. This not only provides a more concise way to achieve our goal, but it also allows us to put all of the pieces needed into one module, which is great for organization.įirst, let’s create our custom module. Although you can achieve this with contrib modules like Commerce Custom Line Item Types, we prefer to create our own module that will contain all of the logic needed for our payments. To accept payments of varying amounts in Drupal Commerce you will need a custom line item type as well as a few other customizations. There are different ways to handle this with Drupal Commerce and here we’ll outline the method we've adopted for use and explain how to implement it yourself. For example, service payments, down payments or donations. The websites we build often require accepting a payment for something that isn't a product.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |