Additionals not shown in order view

  • Posts: 8
  • Thank you received: 0
10 years 8 months ago #145936

-- 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:

    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
if(in_array($additional->name, $exclude_additionnal)) continue;
But, shouldn't $additional->name be $additional->order_product_name instead ?

Also, line 404 is
if($config->get('price_with_tax')){
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

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 8 months ago #145973

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,


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.

  • Posts: 8
  • Thank you received: 0
10 years 8 months ago #146221

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 !

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 8 months ago #146342

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.

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 0
10 years 8 months ago #146355

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

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #146533

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.

  • Posts: 8
  • Thank you received: 0
10 years 8 months ago #146564

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 ?

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
10 years 8 months ago #146810

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum