AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: franz2008 on January 02, 2012, 10:29:27 PM

Title: About the Per Item Shipping Option
Post by: franz2008 on January 02, 2012, 10:29:27 PM
hi there

i just wanna ask if is there any possible to make a Handling fee for Per Item Shipping (other than Shipping cost)

i have some images for it :

(http://img100.imageshack.us/img100/2226/54249103.jpg)

and this one too:

(http://oi42.tinypic.com/vxlt0o.jpg)

i hope you could help me on it

Thanks
Title: Re: About the Per Item Shipping Option
Post by: franz2008 on January 04, 2012, 03:12:00 AM
is there anyone who can help me???
Title: Re: About the Per Item Shipping Option
Post by: elpas0 on January 04, 2012, 04:21:23 AM
hi there

it is easy to implement

1. edit extensions\default_per_item_shipping\config.xml

find
<item id="default_per_item_shipping_cost">
            <type>input</type>
            <default_value></default_value>
        </item>

and insert after it
        <item id="default_per_item_shipping_fee">
            <type>input</type>
            <default_value>0</default_value>
        </item>

we add new parameter in extension config.

2. add translation for this parameter.
edit extensions\default_per_item_shipping\admin\language\english\default_per_item_shipping\default_per_item_shipping.xml

<definition>
    <key>default_per_item_shipping_fee</key>
    <value><![CDATA[Fee:]]></value>
  </definition>


3. now we need to change shipping cost calculation
edit extensions\default_per_item_shipping\storefront\model\extension\default_per_item_shipping.php

find
$quote_data['default_per_item_shipping'] = array(
        'id'           => 'default_per_item_shipping.default_per_item_shipping',
        'title'        => $this->language->get('text_description'),
        'cost'         => $this->config->get('default_per_item_shipping_cost') * $this->cart->countProducts(),
          'tax_class_id' => $this->config->get('default_per_item_shipping_tax_class_id'),
'text'         => $this->currency->format($this->tax->calculate($this->config->get('default_per_item_shipping_cost') * $this->cart->countProducts(), $this->config->get('default_per_item_shipping_tax_class_id'), $this->config->get('config_tax')))
      );


and change it to
$quote_data['default_per_item_shipping'] = array(
        'id'           => 'default_per_item_shipping.default_per_item_shipping',
        'title'        => $this->language->get('text_description'),
        'cost'         => $this->config->get('default_per_item_shipping_cost') * $this->cart->countProducts() + $this->config->get('default_per_item_shipping_fee') ,
          'tax_class_id' => $this->config->get('default_per_item_shipping_tax_class_id'),
'text'         => $this->currency->format($this->tax->calculate($this->config->get('default_per_item_shipping_cost') * $this->cart->countProducts() + $this->config->get('default_per_item_shipping_fee'), $this->config->get('default_per_item_shipping_tax_class_id'), $this->config->get('config_tax')))
      );


Title: Re: About the Per Item Shipping Option
Post by: franz2008 on January 05, 2012, 12:22:30 AM
Thank you so much for it and it works  :) :)
Title: Re: About the Per Item Shipping Option
Post by: scutty99 on December 04, 2012, 03:21:43 AM
Hi,

I have entered the info as per instructions but where do I put in the value for the handing charge, as it does not add anything at the moment?

sorry I am new to this

Pete
Title: Re: About the Per Item Shipping Option
Post by: abolabo on December 04, 2012, 12:36:30 PM
Quote from: scutty99 on December 04, 2012, 03:21:43 AM
Hi,

I have entered the info as per instructions but where do I put in the value for the handing charge, as it does not add anything at the moment?

sorry I am new to this

Pete

hi.
Do you see additional field fee after changing of extensions\default_per_item_shipping\config.xml on extension edit page?