Magento Forum

   
Fixed Product Tax
 
nuranto
Member
 
Total Posts:  35
Joined:  2008-09-30
 

Hi there!

I’m currently working on an add-on.
In this add-on, I have to add product.. This is ok, it works.
But I also have to add Fixed Product Tax, and for that, I fail ...

I have created my FPT (as an attribute), named “deee”.
Manually, it’s ok.
But when I try something like that :

$productModel->setData("deee", array(array(
                                                     
"website_id"    => 0,
                                                     
"country"         => 'FR',
                                                     
"state"         => '*',
                                                     
"value"         => $myproductModel->getData('myproducts_ecotaxe'),
                                                     
"website_value" => $myproductModel->getData('myproducts_ecotaxe')
                                               )));
This doesn’t work, my FPT is not added.

However, FPT structure is almost the same as tier price attribute, and when i try :

$productModel->setData("tier_price", array(array(
                                        
'website_id' => 0,
                                        
'cust_group' => 32000
                                        
'price_qty' => 3,
                                        
'price' => 3,
                                        
'delete' => ''
                                    
)));

This works…
But i’m pretty sure the case of FPT is different, but i don’t know in which way…

Do you (understand the problem and) have an idea about a solution ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxmin
Member
 
Total Posts:  68
Joined:  2008-12-26
Czech Republic
 

Hi,

do you know how to get or update FPT using magento API?

 
Magento Community Magento Community
Magento Community
Magento Community
 
aronchi
Member
 
Avatar
Total Posts:  49
Joined:  2009-05-20
Reggio Emilia - Italy
 

Hi,
maybe it’s too late and you already found a solution to your problem, anyway this could be useful for someone else:

The Data structure for fixed product taxes is the following:

[your_attribute_code] => Array
                (
                    
[0] => Array
                        (
                            
[website_id] => 0
                            [country] 
=> US
                            [state] 
=> 
                            
[price] => 0.25
                            [delete] 
=> 
                        )
                    ...
                    
[n] => Array
                        (
                            
[website_id] => 0
                            [country] 
=> US
                            [state] 
=> 
                            
[price] => 0.25
                            [delete] 
=> 
                        )
                )

Regards,
Alessandro Ronchi

 
Magento Community Magento Community
Magento Community
Magento Community
 
prabhatwiki
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2010-08-02
Ghaziabad
 

Hey guys!
I was searching about Fixed Product Tax or WEEE for magento but there is not very good help out there.

So I worked out on this and applied in one of my project.

In order to configure that we need to enable FPT from admin panel.
System> Configuration > Tax >Fixed Product Tax

Select Enable “Yes”.

Now we can create a new attribute related to this.
And assign that to any of the product.

Here is a nice tutorial on FPT or WEEE.

http://bit.ly/lzMdTo

I hope it will help you.  grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
VanGilsWeb
Sr. Member
 
Total Posts:  97
Joined:  2010-03-26
 
prabhatwiki - 29 April 2011 08:25 AM

Hey guys!
I was searching about Fixed Product Tax or WEEE for magento but there is not very good help out there.

So I worked out on this and applied in one of my project.

In order to configure that we need to enable FPT from admin panel.
System> Configuration > Tax >Fixed Product Tax

Select Enable “Yes”.

Now we can create a new attribute related to this.
And assign that to any of the product.

Here is a nice tutorial on FPT or WEEE.

http://bit.ly/lzMdTo

I hope it will help you.  grin

Manually this works fine, but when you have a lot of products (about 10.000) adding FPT manually is a LOT of work!
Is there a way to configure a fixed FPT for each catagory? So FPT is added automatically to all products?

 
Magento Community Magento Community
Magento Community
Magento Community
 
abhaya
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2012-06-04
Poland
 

I have the same problem - how to update this FPT values for 1000 products ? It doesn;t work in mass edit mode neither. I tried to export products with manually created FPT but I can\’t see fpt column in exported csv file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jason_neumann
Jr. Member
 
Total Posts:  9
Joined:  2013-01-02
 

As far as i can tell the Magento API doesn\’t currently support updating FPTs. Though it isn\’t that hard to add a function to the API to do this. The xml to get the new function added is kind of annoying, but here\’s a sample api.xml file:

<?xml version=\"1.0\"?>
<config>
    <
api>
        <
resources>
            <
weee>
                <
model>weee/api</model>
                <
title>Fixed Product Tax Resource</title>
                <
methods>
                    <
update>
                        <
title>update fpt</title>
                        <
method>update</method>
                    </
update>
                </
methods>
            </
weee>
        </
resources>
        <
v2>
            <
resources_function_prefix>
                <
weee>weee</weee>
            </
resources_function_prefix>
        </
v2>
    </
api>
</
config>
and then the wsdl.xml file:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<definitions xmlns:typens=\"urn:{{var wsdl.name}}\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"
                 
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\"
                 
name=\"{{var wsdl.name}}\" targetNamespace=\"urn:{{var wsdl.name}}\">
    <
message name=\"updateWeeeRequest\">
        <
part name=\"sessionId\" type=\"xsd:string\" />
        <
part name=\"product_id\" type=\"xsd:int\" />
        <
part name=\"attribute_code\" type=\"xsd:string\" />
        <
part name=\"website_id\" type=\"xsd:int\" />
        <
part name=\"country\" type=\"xsd:string\" />
        <
part name=\"state\" type=\"xsd:string\" />
        <
part name=\"price\" type=\"xsd:double\" />
    </
message>
    <
message name=\"updateWeeeResponse\">
        <
part name=\"status\" type=\"xsd:boolean\" />
    </
message>
    <
portType name=\"{{var wsdl.handler}}PortType\">
        <
operation name=\"weeeUpdate\">
            <
documentation>add a fpt to an item</documentation>
            <
input message=\"typens:updateWeeeRequest\" />
            <
output message=\"typens:updateWeeeResponse\" />
        </
operation>
    </
portType>
    <
binding name=\"{{var wsdl.handler}}Binding\" type=\"typens:{{var wsdl.handler}}PortType\">
        <
soap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\" />
        <
operation name=\"weeeUpdate\">
            <
soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />
            <
input>
                <
soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />
            </
input>
            <
output>
                <
soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />
            </
output>
        </
operation>
    </
binding>
    <
service name=\"{{var wsdl.name}}Service\">
        <
port name=\"{{var wsdl.handler}}Port\" binding=\"typens:{{var wsdl.handler}}Binding\">
            <
soap:address location=\"{{var wsdl.url}}\" />
        </
port>
    </
service>
</
definitions>
lastly, just create an Api.php file in Weee/Model with this in it:
class Mage_Weee_Model_Api extends Mage_Api_Model_Resource_Abstract {
    
public function update($product_id$attribute_code$website_id$country$state$price{
        $product 
Mage::getModel(\'catalog/product\');
        
$product->load($product_id);
        
$product->setData($attribute_code, array(array(
            
\'website_id\' => $website_id,
            
\'country\' => $country,
            
\'state\' => $state,
            
\'price\' => $price
        
)));

        
$product->save();
        return 
true;
    
}
}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top