Jump to content

[Help] Order Fee Module - Additional Features and Bugfixes


Recommended Posts

We have bought the Fees and Reductions Modules here: http://addons.prestashop.com/en/13517-extra-one-time-only-order-fee.html

We have been in contact with the developer, and are still awaiting their support on a bugfix and a possible price quote for additional features. 

This module works great mostly, but we are looking to extend the functionality a bit.

Often our customers order many quantities of an item, in many different colors.
We need a setup fee applied to each instance of the product.

There is a quantity field for the fee, and indeed attached to the array in the code is a quantity attribute...

    public function hookDisplayCartRuleOrderDetail(&$params)
    {
        if (!isset($params['discounts']) || empty($params['discounts'])) {
            return;
        }
        
        $fees = array();
        $discounts = $params['discounts'];
        
        foreach ($discounts as $index => $discount) {
            $object = new CartRule($discount['id_cart_rule']);
            
            if (($object->is_fee & self::IS_FEE) && ($object->is_fee & self::CONTEXT_ALL)) {
		$fees[] = array(
                    'obj' => $object,
                    'name' => $discount['name'],
                    'quantity' => 1,
                    'value_unit' => $discount['value'],
                    'value' => $discount['value']
                );
                
                unset($discounts[$index]);
            }
        } 

I believe I need a check here, to make the quantity equal to the number of duplicate item in the cart.
I am not the strongest in php, nor super fluent with the prestashop architecture. 
Perhaps someone can lead me in the right direction.

Hard changes to the quantity aren't being displayed or computed; so it's also possible I am not in the right place in the code. 

post-1290471-0-54398600-1479763134_thumb.jpg

------------------

Also:

We are experiencing another bug when fees are compounded with voucher based cart rules. 
 
Once a setup fee is over 30.00$, for every penny over it is subtracting a penny from the discount applied by the voucher / cart rules. 
 
For instance; 
 
We have a 40.00 voucher discount applied to an item.
This works fine, until we apply a setup fee of 30.00$ or more. 
The 30.00 setup fee affects the voucher discount; changing the applied voucher discount from 40.00 to 39.99
Similarly, a setup fee of 40.00 subtracts even more; changing the applied voucher discount from 40.00 to 29.99
 
I poured over the javascript, related database tables, related tpl and php files...and cannot locate the collision. 

Any help, would be appreciated.
 
post-1290471-0-80787200-1479763135_thumb.jpg
Edited by heliumdream (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...