开发者

Add option to add extra fees to Ubercart checkout?

开发者 https://www.devze.com 2023-04-12 05:14 出处:网络
I have a Drupal website with the UBERCART module to accept donations in the form of adopting a book in my library. I need to add an option in the cart page before the checkout to add an entry to the c

I have a Drupal website with the UBERCART module to accept donations in the form of adopting a book in my library. I need to add an option in the cart page before the checkout to add an entry to the cart with t开发者_如何学Che value of 3% of the total order to cover the payment transaction fees.

It could be a check box that says..

[_] I wish to add 3% to cover the online transfer fees.

Any Ideas of how to implement this? Thanks


I'm not sure how to set up an optional fee, but for required fees, this module will do it: https://drupal.org/project/uc_fee

Unfortunately there seems to be no version for Drupal 7 yet.

Also, it's a little quirky in some ways...for example, if you want to create a fee to be applied to all products of a particular class, by default that fee gets applied at the cart level, meaning that that a long as the cart contains at least one product of the type you specified when creating the conditional action, the fee will be applied to the other products in the cart as well. If the fee only should be applied once per order then you can just set Max Applications to zero, otherwise...

The process to apply a fee to each product in the cart of a particular class is as follows:

  1. Create a fee at Store administration > Fees with a price of zero
  2. Click the "conditions" link next to the fee (again, from Store administration > Fees) and say the cart needs to contain at least one product of your desired class
  3. Go to Store administration > Products > Manage classes, click "edit" for your desired class, go to the Fees tab and override the price to be whatever the fee should be.
  4. Create products of that class. If your products are already created, it appears you need to edit each already-existing product and override the fee there (on the Fees tab); unfortunately the product-class override only appears to apply to products created after the setting was changed.


I realise it's a long time since this question was posted, but it came up in search when I was trying to solve a similar problem. Since it hasn't been satisfactorily answered after all this time, I thought I'd share the solution I found for my own problem.

There is some sample module code here:

http://www.stevenalanwilson.com/articles/open-drupal-pages-using-built-overlay

I created my own module with this code to allow customers to specify if they live in a rural area. If they check the box, a $5 rural delivery fee is added to the cost of their order. The label on the checkbox and the value of the fee can be set by changing the code in the module.

The scenario asked here would need some additional coding to calculate the 3% fee based on the value of the order, which shouldn't be too hard to achieve.


if you are using drupal 6 then visit these link in your site

Administer -> Store administration -> Configuration -> Shipping quote settings

then visit the "quote method" where you can define your shipping quote setting

once you understand the method for creating shipping charges, you can apply whatever shipping rate you want to charge.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号