- Posts: 8
- Thank you received: 0
Additionals not shown in order view
12 years 7 months ago #145936
by tommytom
Additionals not shown in order view was created by tommytom
-- url of the page with the problem -- : /index.php/my-acount/order/show
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.5.3
-- Browser(s) name and version -- : Chrome 33
-- Error-message(debug-mod must be tuned on) -- :
Notice: Undefined property: stdClass::$name in /var/www/explorationgeochemsite/components/com_hikashop/views/order/tmpl/show.php on line 389
Notice: Undefined variable: config in /var/www/explorationgeochemsite/components/com_hikashop/views/order/tmpl/show.php on line 404
Hi,
I am using additional cost via a plugin using the onAfterCartProductsLoad callback. Here is a sample of the code:
The handling fees are taken into account and processed in the total order amount. BUT they are not shown in the order. If I look at the file components/com_hikashop/views/order/tmpl/show.php I see 2 issues:
line 389 is currently
But, shouldn't $additional->name be $additional->order_product_name instead ?
Also, line 404 is
but $config has not been defined here thus causing a problem.
Can you please let me know what to do ?
Thanks for your help
-Tom
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.5.3
-- Browser(s) name and version -- : Chrome 33
-- Error-message(debug-mod must be tuned on) -- :
Notice: Undefined property: stdClass::$name in /var/www/explorationgeochemsite/components/com_hikashop/views/order/tmpl/show.php on line 389
Notice: Undefined variable: config in /var/www/explorationgeochemsite/components/com_hikashop/views/order/tmpl/show.php on line 404
Hi,
I am using additional cost via a plugin using the onAfterCartProductsLoad callback. Here is a sample of the code:
Code:
function onAfterCartProductsLoad(&$cart) {
$handlingfees = new stdClass();
$handlingfees->name = 'Handling fees';
$handlingfees->value = '';
$handlingfees->price_currency_id = hikashop_getCurrency();
$handlingfees->price_value = 25.95;
$handlingfees->price_value_with_tax = 25.95;
$cart->additional['handlingfees'] = $handlingfees;
}
The handling fees are taken into account and processed in the total order amount. BUT they are not shown in the order. If I look at the file components/com_hikashop/views/order/tmpl/show.php I see 2 issues:
line 389 is currently
Code:
if(in_array($additional->name, $exclude_additionnal)) continue;
Also, line 404 is
Code:
if($config->get('price_with_tax')){
Can you please let me know what to do ?
Thanks for your help
-Tom
Please Log in or Create an account to join the conversation.
12 years 7 months ago #145973
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Additionals not shown in order view
Hi,
Thanks for the report, it will add the fix in HikaShop 2.3.0
With the two modifications (and yes it is "order_product_name") the additional should be listed in the front-end order.
Regards,
Thanks for the report, it will add the fix in HikaShop 2.3.0
With the two modifications (and yes it is "order_product_name") the additional should be listed in the front-end order.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: tommytom
Please Log in or Create an account to join the conversation.
12 years 7 months ago #146221
by tommytom
Replied by tommytom on topic Additionals not shown in order view
Hello,
Another question in the same subject: is there a way to have the taxes applied to the additionals ? My customer tells me that he want to charge taxes on the handling fees.
Thanks !
Another question in the same subject: is there a way to have the taxes applied to the additionals ? My customer tells me that he want to charge taxes on the handling fees.
Thanks !
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 7 months ago #146342
by Mohamed Thelji
Replied by Mohamed Thelji on topic Additionals not shown in order view
Hi,
The solution will be to set the "Product tax category" option of your shipping method to the same tax category that you have set through the "product tax category" of your products.
The solution will be to set the "Product tax category" option of your shipping method to the same tax category that you have set through the "product tax category" of your products.
Please Log in or Create an account to join the conversation.
12 years 7 months ago #146355
by tommytom
Replied by tommytom on topic Additionals not shown in order view
Thanks Mohamed, But this is not the issue.
If you read the thread, you will see that I am adding additionals costs via a plugin. Those cost are "Handling fees" not shipping.
What I would like to know is: is there a way to apply taxes on additionals when adding those through the plugin ?
-Tom
If you read the thread, you will see that I am adding additionals costs via a plugin. Those cost are "Handling fees" not shipping.
What I would like to know is: is there a way to apply taxes on additionals when adding those through the plugin ?
-Tom
Please Log in or Create an account to join the conversation.
12 years 6 months ago #146533
by nicolas
Replied by nicolas on topic Additionals not shown in order view
The taxes are not completely handled by HikaShop for the additionals as we didn't need that so far for all the plugins we made using the additionals. So you would have to change the code a bit everywhere additional are used in HikaShop so that the taxes would be taken into account.
Please Log in or Create an account to join the conversation.
12 years 6 months ago #146564
by tommytom
Replied by tommytom on topic Additionals not shown in order view
Hi Nicolas, thanks for this info.
I guess then, that my option is to use the plugin to add a specific product to the cart (instead of the additional). This product could be the handling fees and I imagine that the rest of hikashop would take care of the taxes if the product is correctly defined right ?
I guess then, that my option is to use the plugin to add a specific product to the cart (instead of the additional). This product could be the handling fees and I imagine that the rest of hikashop would take care of the taxes if the product is correctly defined right ?
Please Log in or Create an account to join the conversation.
12 years 6 months ago #146810
by Eliot
Replied by Eliot on topic Additionals not shown in order view
Hi there,
You could indeed do so. Another option would be to load the main take of Hikashop in your plugin and directly calculate the additional price including the taxes. The result displayed might not be perfect (depending on where you display these costs) but it's a possibility.
You could indeed do so. Another option would be to load the main take of Hikashop in your plugin and directly calculate the additional price including the taxes. The result displayed might not be perfect (depending on where you display these costs) but it's a possibility.
Please Log in or Create an account to join the conversation.
Time to create page: 0.266 seconds