- Posts: 54
- Thank you received: 0
Default Tax Drop Down when adding new products
- eileensemporium
-
Topic Author
- Offline
Less
More
9 years 10 months ago #255510
by eileensemporium
Default Tax Drop Down when adding new products was created by eileensemporium
-- HikaShop version -- : HikaShop Business 2.6.4 [1610121552]
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.4
Is it possible to change the order the list of tax categories when creating a new product? The none is always default so either adding 'selected' to my drop down options or changing the order would help.
I notice that you can have a none category with a tax rate applied I don't have that category with tax, would re-creating that help? If so how would I do that thanks?
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.4
Is it possible to change the order the list of tax categories when creating a new product? The none is always default so either adding 'selected' to my drop down options or changing the order would help.
I notice that you can have a none category with a tax rate applied I don't have that category with tax, would re-creating that help? If so how would I do that thanks?
Please Log in or Create an account to join the conversation.
9 years 10 months ago #255516
by nicolas
Replied by nicolas on topic Default Tax Drop Down when adding new products
Hi,
By default, it's the last tax category that you created that is preselected when you create a new product.
None should never be available unless you deleted all your tax categories or messed with the category tree data.
You can see that on our demo website if you create a new product:
demo.hikashop.com/administrator/index.ph...trl=product&task=add
So if you deleted all your tax categories, recreating one would have it selected by default.
By default, it's the last tax category that you created that is preselected when you create a new product.
None should never be available unless you deleted all your tax categories or messed with the category tree data.
You can see that on our demo website if you create a new product:
demo.hikashop.com/administrator/index.ph...trl=product&task=add
So if you deleted all your tax categories, recreating one would have it selected by default.
Please Log in or Create an account to join the conversation.
- eileensemporium
-
Topic Author
- Offline
Less
More
- Posts: 54
- Thank you received: 0
9 years 10 months ago #255568
by eileensemporium
Replied by eileensemporium on topic Default Tax Drop Down when adding new products
The tax category I use is the same for all products and was added last.
If you could tell me the location of the form for entering the default I'll modify it for my needs - thanks
If you could tell me the location of the form for entering the default I'll modify it for my needs - thanks
Please Log in or Create an account to join the conversation.
9 years 10 months ago #255579
by nicolas
Replied by nicolas on topic Default Tax Drop Down when adding new products
Hi,
It's done in the file administrator/components/com_hikashop/views/product/view.html.php with the code:
It's done in the file administrator/components/com_hikashop/views/product/view.html.php with the code:
Code:
$categoryClass = hikashop_get('class.category');
$mainTaxCategory = 'tax';
$categoryClass->getMainElement($mainTaxCategory);
$query = 'SELECT category_id FROM '. hikashop_table('category'). ' WHERE category_type = ' . $db->Quote('tax') . ' AND category_parent_id = '.(int)$mainTaxCategory.' ORDER BY category_ordering DESC';
$db->setQuery($query);
$product->product_tax_id = $db->loadResult();
The following user(s) said Thank You: eileensemporium
Please Log in or Create an account to join the conversation.
- eileensemporium
-
Topic Author
- Offline
Less
More
- Posts: 54
- Thank you received: 0
9 years 10 months ago #255971
by eileensemporium
Replied by eileensemporium on topic Default Tax Drop Down when adding new products
It turned out to be easier than that - I noticed that there is an order by in the query (ORDER BY category_ordering DESC) so I just created a dummy unpublished category and sorted the order of the categories accordingly, now the default category is the one I require
Please Log in or Create an account to join the conversation.
9 years 6 months ago #264990
by Udo
Replied by Udo on topic Default Tax Drop Down when adding new products
Hi,
I understand the last tax category created is preselected when creating a new product.
This is very impractible.
Until recently all products in my shop used the same tax category, But I had to add a new tax category for a few products. I will use this new tax category for these products only.
Now this tax category is preselected in every new product and I have to correct this in every new product. Mistakes are unavoidable.
So I've looked for a way to get the default tax category preselected.
Using the solution of eileensemporium doesn't work. It results in preselecting None.
Nicolas suggests deleting all tax categories and creating new ones.
Having 800 products this is no way to go.
Is there really no other way? Perhaps an override of a view?
Thanks,
Udo
I understand the last tax category created is preselected when creating a new product.
This is very impractible.
Until recently all products in my shop used the same tax category, But I had to add a new tax category for a few products. I will use this new tax category for these products only.
Now this tax category is preselected in every new product and I have to correct this in every new product. Mistakes are unavoidable.
So I've looked for a way to get the default tax category preselected.
Using the solution of eileensemporium doesn't work. It results in preselecting None.
Nicolas suggests deleting all tax categories and creating new ones.
Having 800 products this is no way to go.
Is there really no other way? Perhaps an override of a view?
Thanks,
Udo
Please Log in or Create an account to join the conversation.
9 years 6 months ago #265008
by nicolas
Replied by nicolas on topic Default Tax Drop Down when adding new products
Hi,
As you can read in this thread, the system doesn't use the last created tax category but the one with the higher ordering (which is the last one by default, unless you change the ordering of the tax categories).
So change the ordering of the tax categories on the tax categories listing and you'll be done easily.
As you can read in this thread, the system doesn't use the last created tax category but the one with the higher ordering (which is the last one by default, unless you change the ordering of the tax categories).
So change the ordering of the tax categories on the tax categories listing and you'll be done easily.
Please Log in or Create an account to join the conversation.
9 years 6 months ago #265052
by Udo
Replied by Udo on topic Default Tax Drop Down when adding new products
Hi,
It's as easy as that!
I've tried reordering the tax categories before, but then I put the default tax category on position 1.
Now I've put it on the last position. And hurray, it's preselected in new products.
Thanks a lot!
Udo
It's as easy as that!
I've tried reordering the tax categories before, but then I put the default tax category on position 1.
Now I've put it on the last position. And hurray, it's preselected in new products.
Thanks a lot!
Udo
Please Log in or Create an account to join the conversation.
Time to create page: 0.197 seconds