Download & Extend

free order with recurring product

Project:UC Free Order Payment Method
Version:6.x-1.0-beta4
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

I want to be able to make an order completely free
I have been successful in making the initial value of the order £0 but the product had a recurring payment attached to it and I want this to be £0 as well so the order goes through completely free as at the moment it goes to paypal still due to the recurring payment.

Comments

#1

I am having the same problem, i have actually coupon codes + recurring payments, so if the user use a coupon to get lets say the first month free, uc still uses paypal as the payment method even if the order is $0.00 because of the recurring fee

Not sure what to do here.

#2

Anyone have any solutions to this problem?

#3

subscribing

#4

Subscribing

#5

Status:active» needs review

Hi everyone, we were struggling with the same problem, and i think implemented a good solution.

The development was sponsored by Levia IT. The developers who worked on this are:

The free payment method needed to be recognized by recurring module as a payment method that could do recurring billing. so we implemented the hook_recurring_info.

here is what we needed to insert:

<?php
/*
* Implementation of hook_recurring_info (from uc_recurring, optional support for CIM-style recurring payments)
*/
function uc_free_order_recurring_info() {
 
$items = array();
 
$items['free_order'] = array(
   
'name' => t('Free Order standalone'),
   
'payment method' => 'free_order',
   
'module' => 'uc_recurring',
   
'fee handler' => 'free_order',
   
'renew callback' => 'uc_free_order_renew',
   
'process callback' => 'uc_free_order_proc',
   
'own handler' => FALSE,
   
'menu' => array(
     
'charge' => UC_RECURRING_MENU_DEFAULT,
     
'edit' => UC_RECURRING_MENU_DEFAULT,
     
'cancel' => UC_RECURRING_MENU_DEFAULT,
    )
// Use the default user operation defined in uc_recurring.
 
);
  return
$items;
}

function
uc_free_order_renew($order, &$fee) {      return true; }
function
uc_free_order_proc($order, &$fee) {      return true; }
?>

Here are the steps:

  1. Add this code to the uc_free_order.module (if you are not sure how to do this download a patched version from here ).
  2. go to http://example.com/admin/store/settings/payment/edit/recurring and make sure where it says Valid payment methods for orders with recurring fees: that free payment method is selected

P.S. Also maybe someone with proper permission level could apply this as a patch to the module.

nobody click here