Is it possible to use the lowest tax rate for the shipping tax?

  • Posts: 290
  • Thank you received: 22
2 years 2 months ago #344851

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.2.2
-- PHP version -- : 8.1.10

Hi, in the shipping settings there is an option to use the highest rate of the order as tax on the shipping costs.
Is there a possibility to use the lowest rate of products in the order?

And would it be possible to show that amount of tax on the shipping costs somewhere?

Thank you very much.

Last edit: 2 years 2 months ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 2 months ago #344853

Hi,

We can add that option for the next version of HikaShop.

To display the amount of tax on the shipping costs on the checkout, you can edit the file show_block_shipping via the menu Display>Views and add the code:

$this->currencyClass = hikashop_get('class.currency');
echo '('.$this->currencyClass->format($shipping->shipping_price_with_tax-$shipping->shipping_price,hikashop_getCurrency()).')';
after the line:
echo $this->checkoutHelper->getDisplayPrice($shipping, 'shipping', $this->options);

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

  • Posts: 290
  • Thank you received: 22
2 years 2 months ago #344881

Hi Nicolas,

Thank you for making that possible in the next version.

The change in the view gives met a critical error when viewing the cart :

CRITICAL 81.207.92.120 error Uncaught Throwable of type Error thrown with message "Call to a member function format() on null". Stack trace: #0 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include()
#1 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2726): Joomla\CMS\MVC\View\HtmlView->loadTemplate()
#2 [ROOT]/components/com_hikashop/views/checkout/view.html.php(364): hikashopView->loadTemplate()
#3 [ROOT]/templates/yootheme/html/com_hikashop/checkout/show_block_cart.php(355): CheckoutViewCheckout->getDisplayProductPrice()
#4 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include('/home/swanndev/...')
#5 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2726): Joomla\CMS\MVC\View\HtmlView->loadTemplate()
#6 [ROOT]/components/com_hikashop/views/checkout/view.html.php(282): hikashopView->loadTemplate()
#7 [ROOT]/components/com_hikashop/views/checkout[TMP]l/show.php(42): CheckoutViewCheckout->displayBlock()
#8 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include('/home/swanndev/...')
#9 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2726): Joomla\CMS\MVC\View\HtmlView->loadTemplate()
#10 [ROOT]/libraries/src/MVC/View/HtmlView.php(203): hikashopView->loadTemplate()
#11 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2681): Joomla\CMS\MVC\View\HtmlView->display()
#12 [ROOT]/components/com_hikashop/views/checkout/view.html.php(53): hikashopView->display()
#13 [ROOT]/libraries/src/MVC/Controller/BaseController.php(639): CheckoutViewCheckout->display()
#14 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2404): Joomla\CMS\MVC\Controller\BaseController->display()
#15 [ROOT]/components/com_hikashop/controllers/checkout.php(65): hikashopController->display()
#16 [ROOT]/components/com_hikashop/controllers/checkout.php(228): checkoutController->display()
#17 [ROOT]/components/com_hikashop/controllers/checkout.php(81): checkoutController->show()
#18 [ROOT]/libraries/src/MVC/Controller/BaseController.php(672): checkoutController->step()
#19 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2382): Joomla\CMS\MVC\Controller\BaseController->execute()
#20 [ROOT]/components/com_hikashop/hikashop.php(88): hikashopController->execute()
#21 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): require_once('/home/swanndev/...')
#22 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(73): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()
#23 [ROOT]/libraries/src/Component/ComponentHelper.php(355): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()
#24 [ROOT]/libraries/src/Application/SiteApplication.php(200): Joomla\CMS\Component\ComponentHelper::renderComponent()
#25 [ROOT]/libraries/src/Application/SiteApplication.php(241): Joomla\CMS\Application\SiteApplication->dispatch()
#26 [ROOT]/libraries/src/Application/CMSApplication.php(294): Joomla\CMS\Application\SiteApplication->doExecute()
#27 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()

Not sure why this is but you can probably see why ;-)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 2 months ago #344884

Hi,

Not sure why either. My code shouldn't be able to output that error message. It looks like you made a typo. Could you double check the modification ?

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

  • Posts: 290
  • Thank you received: 22
2 years 2 months ago #344953

Hi Nicolas,

A collegue pointed to something and remove the $this part and now it's working.
Thanks !

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

  • Posts: 290
  • Thank you received: 22
2 years 1 month ago #345350

Hi, after using this we noticed that the displayed tax amount was wrong.

We had 3 shipping methods that were offered in our example :

  • pickup (free)
  • normal shipping price € 1,21 with tax where 0,21 is the tax amount
  • other shipping option € 36,97 with tax where € 6,42 is the tax amount
The second option is automatically selected because it is linked to the zone in my address but it's the third option that it takes the taxes from that we display at the bottom of the cart.

So I'm a bit confused on why that is and more important how to fix / change this behaviour.

We use only manual shipping and I would assume that the cheapest option would be selected first but it's the one that has a zone assigned.
Is this by design? And could it be changed in any way? (not a priority, just nice if this would be possible).

Thanks again for the feature in 4.6.2

(after some more testing it looks like it's taking the tax of the last shipping method).

Last edit: 2 years 1 month ago by nico.van.leeuwen. Reason: extra test

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345360

Hi,

Could you provide :
- the url of the shop
- instructions to reproduce the problem
- screenshot of the settings of the shipping methods
so that we can reproduce the issue and understand the situation ?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345500

Hi,

We got your backend access and were able to login.

I see the tax issue with that one product. I tried to reproduce the issue with the same settings on my end but I didn't get the problem.
Could you also provide a FTP access in order to debug the situation ?

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
2 years 1 month ago #345579

Hello nico.van.leeuwen,

As previously requested by Nicolas without providing FTP access we won't be able to progress on your subject.
Awaiting your elements.

Regards

The following user(s) said Thank You: nico.van.leeuwen

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

  • Posts: 290
  • Thank you received: 22
2 years 1 month ago #345602

Hi Philip,

Sure no problem.
I will send it to support like I did with the account.
Sorry I respond so late but I did not get a notification of you update for some reason.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345611

Hi,

Thank you for the FTP access.
I found the issue and made a patch for it. It's now working on your website (note that you need to logout/login to see the change on the frontend).
We've also included the patch in HikaShop's install package so for anyone else reading this, if you have the 4.6.2 or earlier and the same issue, download again the install package on our website and install it on yours to get the patch.

The following user(s) said Thank You: nico.van.leeuwen

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

  • Posts: 290
  • Thank you received: 22
2 years 1 month ago #345618

Hi, thanks for the fabulous support in fixing this.

I've tested and it all seems correct now.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum