- Posts: 73
- Thank you received: 3
tax category not considered in the producttemplate
11 years 7 months ago #190460
by ced1870
tax category not considered in the producttemplate was created by ced1870
-- HikaShop version -- : 2.3.5
-- HikaMarket version -- : 1.5.1
-- Joomla version -- : 3.3.6
Hi
I have update the tax rules using the package available on hikashop.com that creates a new category "Electronic goods & services "
I have edited the product template to use this category for all new products.
I have tested by creating a new product from the frontend of hikamarket and the tax category is set to "none", so not according to the setting.
CEd
-- HikaMarket version -- : 1.5.1
-- Joomla version -- : 3.3.6
Hi
I have update the tax rules using the package available on hikashop.com that creates a new category "Electronic goods & services "
I have edited the product template to use this category for all new products.
I have tested by creating a new product from the frontend of hikamarket and the tax category is set to "none", so not according to the setting.
CEd
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190464
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic tax category not considered in the producttemplate
Hi,
Can you please edit the file "components/com_hikamarket/views/product/view.html.php" and replace
By
So it will force the product_type instead of removing it ; so it should display the product tax category selection.
Regards,
Can you please edit the file "components/com_hikamarket/views/product/view.html.php" and replace
Code:
if(!empty($template_id)) {
$product->product_id = 0;
unset($product->product_type);
unset($product->product_code);
}
Code:
if(!empty($template_id)) {
$product->product_id = 0;
$product->product_type = 'main';
unset($product->product_code);
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190475
by ced1870
Replied by ced1870 on topic tax category not considered in the producttemplate
I have no view "product", only the productmarket, then in the file I have these lines which are not totally the same:
l.604
I have made the changes anyway and it does not work. My test :
- log as vendor in frontend >> create a new product, don't change anyting and save
- go in the admin side to check the tax rule, and still on "none"
Because the tax rule can not be changed from the vendor in frontend, it must take the default setting from the template
l.604
Code:
if(!empty($template_id)) {
$product->product_id = 0;
unset($product->product_code);
}
I have made the changes anyway and it does not work. My test :
- log as vendor in frontend >> create a new product, don't change anyting and save
- go in the admin side to check the tax rule, and still on "none"
Because the tax rule can not be changed from the vendor in frontend, it must take the default setting from the template
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190482
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic tax category not considered in the producttemplate
Hi,
Okay, your problem is different than your first explanation let me think.
Regarding the current code ; I can't reproduce your issue. If there is no "product_tax_id" in the product, HikaMarket will copy the value from the product template.
In the HikaMarket product class, for the function "frontSaveForm"
will remove the product_tax_id for the product if the vendor does not have the right to edit it.
Below in the function, the product template is loaded if we are creating a new product ; and the copy of the template is made in the current product
For what I read and what I tested ; I can't reproduce your issue so I think that there is a missing information which would explain what the real problem is.
Regards,
Okay, your problem is different than your first explanation let me think.
Regarding the current code ; I can't reproduce your issue. If there is no "product_tax_id" in the product, HikaMarket will copy the value from the product template.
In the HikaMarket product class, for the function "frontSaveForm"
Code:
if(!hikamarket::acl('product_edit_tax')) { unset($product->product_tax_id); }
Below in the function, the product template is loaded if we are creating a new product ; and the copy of the template is made in the current product
Code:
if(!empty($template)) {
foreach($template as $k => $v) {
if(!in_array($k, array('product_code','product_alias')) && !isset($product->$k))
$product->$k = $v;
}
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190498
by ced1870
Replied by ced1870 on topic tax category not considered in the producttemplate
ok my be my explanations were not so good 
I don't know which information could be missing. Setting the tax category in the product template shall apply it when creating a new product
if I check the code in the product class, there is no tax_id on the product object
this is what I get
if you tell me where to investigate to find how the tax_id is retrieved, I can try
I don't know which information could be missing. Setting the tax category in the product template shall apply it when creating a new product
if I check the code in the product class, there is no tax_id on the product object
this is what I get
Code:
object(stdClass)#1058 (13) { ["product_name"]=> string(0) "" ["categories"]=> string(1) "2" ["product_published"]=> string(1) "1" ["compatibility"]=> string(9) "Joomla! 3" ["responsive"]=> string(1) "0" ["demo_url"]=> string(0) "" ["photos_url"]=> string(0) "" ["author_name"]=> string(0) "" ["author_url"]=> string(0) "" ["themepositions"]=> string(0) "" ["product_id"]=> int(0) ["product_type"]=> string(4) "main" ["product_vendor_id"]=> string(2) "10" }
if you tell me where to investigate to find how the tax_id is retrieved, I can try
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190501
by ced1870
Replied by ced1870 on topic tax category not considered in the producttemplate
update :
if I set the var_dump($product); just before the return $status, I get more in the object but still no tax_id ...
if I set the var_dump($product); just before the return $status, I get more in the object but still no tax_id ...
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190504
by ced1870
Replied by ced1870 on topic tax category not considered in the producttemplate
I have found something strange near line 320
template_id will always be null in this case ...so the loop
will never be executed
Code:
$template_id = null;
if(!empty($template_id))
Code:
foreach($template as $k => $v) {
if(!in_array($k, array('product_code','product_alias')) && !isset($product->$k))
$product->$k = $v;
var_dump($k);
}
The following user(s) said Thank You: Jerome
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190508
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic tax category not considered in the producttemplate
Hi,
Wah, I missed that bug was in the previous release.
In line 320, please replace the
By what should be his right content
And it will fix the issue..
Sorry for the inconvenient
Regards,
Wah, I missed that bug was in the previous release.
In line 320, please replace the
Code:
$template_id = null;
Code:
$template = null;
Sorry for the inconvenient
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190602
by ced1870
Replied by ced1870 on topic tax category not considered in the producttemplate
I have changed this by my side, don't forget to update it for the next release 
Have a good day
CEd
Have a good day
CEd
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190606
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic tax category not considered in the producttemplate
Hi,
I won't ; it's already commit since several weeks
(But I though that I made a new package with that fix...)
Regards,
I won't ; it's already commit since several weeks
(But I though that I made a new package with that fix...)
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.385 seconds