News:

AbanteCart v1.4.2 is released.

Main Menu
support

About the Per Item Shipping Option

Started by franz2008, January 02, 2012, 10:29:27 PM

Previous topic - Next topic

franz2008

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 :



and this one too:



i hope you could help me on it

Thanks

franz2008


elpas0

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')))
      );



franz2008

Thank you so much for it and it works  :) :)

scutty99

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

abolabo

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?
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Forum Rules Code of conduct
AbanteCart.com 2010 -