Checkout display Unit Price and Total price with GST

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339859

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 4.1.0
-- PHP version -- : 7.3.27
-- Browser(s) name and version -- : Brave Version 1.20.110 Chromium: 88.0.4324.192 (Official Build) (64-bit)

In the checkout can I show the unit price and then the total price with the tax added to it?

Attachments:

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

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

Hi,

Yes, in the HikaShop configuration, under the Checkout tab, you have your checkout workflow.
There, you have the "cart" view settings. And among them you have the "Price with tax" which allows you to display these two prices either with taxes or without taxes.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339879

Hi Nicolas,

Thank you, yes, yes I had the option turned on, that's why I came to you to see if there is another way!

So with it turned off I get the unit price.




When I turn it on, I get the Unit price with Tax, I want the unit price $6.69 and not $7.36 and the total Price $7.36 (incl Tax).




Does this make sense?

Mark

Attachments:

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

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

Hi,

Ok.
So supposing that this setting is turned on, you can edit the file show_block_cart via the menu Display>Views.
There, you can change the code:

echo $this->getDisplayProductPrice($product, true);
to:
$this->options['price_with_tax'] = 0;
echo $this->getDisplayProductPrice($product, true);
$this->options['price_with_tax'] = 1;

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339918

Nicolas,

This line "echo $this->getDisplayProductPrice($product, true);" is not in my checkout show_block_cart code?



Mark

Attachments:

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

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

Hi,

First, beware that your browser search might not be able to search inside the code editor.
So your screenshot doesn't prove that the line of code I'm talking about isn't in the view file.
Please check manually.
If you really don't have it, then it means that you have an old view override of show_block_cart on your website and you would have to delete the override to redo it with the latest version of the view file.

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

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339943

Nicolas,

The search function works fine and fines anything inside of the code editor.
This is a new installation of HikaShop Business and there have been no changes edits to any of the display files only have made custom fields.
I have attached the code of the show_block_cart.

So what now?
Regards,
Mark

Attachments:

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

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

Hi,

I do see the line I'm talking about in the file you provided:
i.imgur.com/G4IcURg.png

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339972

Hi Nicolas,

Please accept my sincere apology for not looking through the file before sending it.

Ok I have modified the file, selected a product with tax to the shopping cart, gone to finalise my order and get a syntax issue.

Please see attached.

Regards,
MSF

Attachments:

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

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

Hi,

The error is not with the code change I provided.
It's with the other line that has been changed.
As you can see in your first screenshot, the variable $onchange has been changed to $on-change and that's why PHP is giving you that error.
This is probably done automatically by a security extension you have installed on your website which does that to prevent potentially hacking attempts. So I would recommend you check with the support of that extension what can be done so that it doesn't interfer with that area of HikaShop. The simplest is to temporarily deactivate that extension when you're changing code in view overrides.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 8 months ago #339987

Thanks Nicolas,

Found it, RSFirewall does a check on updated php files :)

Great wonderful support as usual.

It works prefect now.
Thank you.

I am sure I will have other questions.

Attachments:

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

  • Posts: 135
  • Thank you received: 5
2 years 7 months ago #340375

Hi,

How do I get the subtotal to be the value less tax in the checkout system?

So I have:
Subtotal : $5:57
GST: $0:56
Total: $6:13

Attachments:

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

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

Hi,

Go in the HikaShop configuratoin, and under the Checkout tab, in the settings area of the "cart" view, turn off the "show taxed prices" setting.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 7 months ago #340476

Hi,

Have set as suggested and still didnt work?

See attached

Regards,
MSF

Attachments:
Last edit: 2 years 7 months ago by markfell. Reason: Missing image :)

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

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

Hi,

The unit price is without taxes while the total price is with taxes.
That's not possible by default so I suspect that you've made a view override for the show_block_cart view file via the menu Display>Views. And the reason the subtotal doesn't abid to that setting must be linked to that view override.
Try renaming the file templates/YOUR_TEMPLATE/html/com_hikashop/checkout/show_block_cart.php to somehting else via FTP in order to disable it and it should hopefully work.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 7 months ago #340647

Hi

yes I had changed the show_block_cart as you had suggested, to

$this->options['price_with_tax'] = 0;
echo $this->getDisplayProductPrice($product, true);
$this->options['price_with_tax'] = 1;
So I could see unit price for each product and then tax.

Now I get the subtotal, GST, and total correct but now the single product goes back to Unit Price Only.

See attached

Attachments:
Last edit: 2 years 7 months ago by nicolas.

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

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

Hi,

Then, instead of having the "show taxed prices" setting turned on and the code I gave before to remove the tax on the price without taxes, you can have that setting turned off, and change the line:

echo $this->getDisplayProductPrice($product, false);
to:
$this->options['price_with_tax'] = 1;
echo $this->getDisplayProductPrice($product, false);
$this->options['price_with_tax'] = 0;
in that same show_block_cart so that the product total price is with taxes.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
2 years 7 months ago #340731

Nicolas,

perfect as normal, code works perfectly.

M

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

Time to create page: 0.111 seconds
Powered by Kunena Forum