Tags/topics: 
3
Answers
Vote up!
0
Vote down!

commerce default tax in inline entity form

Hi
when adding a productvariation I want to make my tax (btw_21) the default setting.

I added this to template.php but it doesn't work.

function blueblot_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'commerce_product_ui_product_form':
$form['commerce_price']['und']['0']['include_tax']['#default_value'] = 'btw_21';

//hide the tax dropdown if you like
$form['commerce_price']['und']['0']['include_tax']['#access'] = FALSE;
break;
}

'commerce_product_ui_product_form' is this correct for a standard commerce product form?

thx
Kris

Asked by: Kris Obbers
on March 26, 2014

3 Answers

Vote up!
0
Vote down!

hi dnz

sorry but no luck.
when I go to admin/commerce/config/taxes/commerce_default_tax_rate, I can select the default rate.

but when I add a new product node/add/fabrics the dropdown for 'Include tax in this price' still points to 'none'.
I have 2 custom product variation types (maybe this has something to do with it?)

thx for the follow up.

Kris

Answer by: Kris Obbers
Posted: Mar 31, 2014
Vote up!
0
Vote down!

Just to confirm - the tax that you set as default appears in the dropdown, it's just not selected?

The custom product types shouldn't be an issue, it's been tested on a few sites with different product types. I can't replicate the problem, any other hints you can give me? Anything else that might be unusual in your set up?

A patch was provided today for another issue, so version 1.2 is now out. You could try that too if you still haven't had any luck.

I'm not getting notifications from this site when there are new responses to questions so if you can post back to your issue on the project page that would really help.

Cheers.

Andy @ BlueFusion
Posted: Apr 2, 2014