Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show price including tax rates in front-end. #74

Open
luukgruijs opened this issue Sep 7, 2014 · 4 comments
Open

Show price including tax rates in front-end. #74

luukgruijs opened this issue Sep 7, 2014 · 4 comments

Comments

@luukgruijs
Copy link

Hi,
I would like to show the price of a product including tax. The tax is now shown during checkout.

In Holland company's don't have to pay the tax. So then it wouldn't be a problem. But since my shop is for consumers it would be nice to see the total price per product before the checkout.

Do you have any idea's?

@luukgruijs luukgruijs reopened this Dec 1, 2014
@luukgruijs
Copy link
Author

i cant seem to find the place where the modification is added to the totalprice. As described above, i basically only like to display the tax, but it shouldn't be added to the totalprice. Any ideas?

@stevie-mayhew
Copy link
Member

Hey @luukgruijs

We tend to just do this as a simple extension on order:

Order:
  extensions:
    - 'OrderExtension'
<?php

class OrderExtension extends DataExtension
{
    public function GSTAmount()
    {
        $order = Cart::get_current_order();
        $subtotal = $order->Total();

        return number_format($subtotal->getAmount() * 3/23, 2);
    }
}

@luukgruijs
Copy link
Author

Thanks for your reply,
I doesn't seem to work with a copy and past. Can you explain what you did?

@stevie-mayhew
Copy link
Member

Once you've added the above extension and yml config, and have performed a ?flush=1 you can add something like the following to your OrderFormCart.ss. You might need to copy that file out of swipestripe and into your theme includes folder.

(includes ${$GSTAmount} $TotalPrice.Currency GST)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants