• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Change the name of tax on frontend

Knowledge Base
2
18
1.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Deepanjali last edited by 29 Aug 2020, 06:07

    I want to change the name of the tax to display GST @5% instead of tax@5% in the checkout section,Also I want to change delivery charges to transportation.
    In which file can I make these changes?

    1fbbebb6-14b4-4ae5-a817-4758c57b466b-image.png

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by devansh-webkul 31 Aug 2020, 08:37 31 Aug 2020, 08:35

      Hi @Deepanjali,

      Please look at the file at path 'packages/Webkul/Velocity/src/Resources/views/shop/checkout/total/summary.blade.php'.

      Change The Below Lines,

      @if ($cart->selected_shipping_rate)
          <div class="row">
              <span class="col-8">{{ __('shop::app.checkout.total.delivery-charges') }}</span>
              <span class="col-4 text-right">{{ core()->currency($cart->selected_shipping_rate->base_price) }}</span>
          </div>
      @endif
      
      @if ($cart->base_tax_total)
          @foreach (Webkul\Tax\Helpers\Tax::getTaxRatesWithAmount($cart, true) as $taxRate => $baseTaxAmount )
              <div class="row">
                  <span class="col-8" id="taxrate-{{ core()->taxRateAsIdentifier($taxRate) }}">{{ __('shop::app.checkout.total.tax') }} {{ $taxRate }} %</span>
                  <span class="col-4 text-right" id="basetaxamount-{{ core()->taxRateAsIdentifier($taxRate) }}">{{ core()->currency($baseTaxAmount) }}</span>
              </div>
          @endforeach
      @endif
      

      To

      @if ($cart->selected_shipping_rate)
          <div class="row">
              <span class="col-8">Transportation</span>
              <span class="col-4 text-right">{{ core()->currency($cart->selected_shipping_rate->base_price) }}</span>
          </div>
      @endif
      
      @if ($cart->base_tax_total)
          @foreach (Webkul\Tax\Helpers\Tax::getTaxRatesWithAmount($cart, true) as $taxRate => $baseTaxAmount )
              <div class="row">
                  <span class="col-8" id="taxrate-{{ core()->taxRateAsIdentifier($taxRate) }}">GST {{ $taxRate }} %</span>
                  <span class="col-4 text-right" id="basetaxamount-{{ core()->taxRateAsIdentifier($taxRate) }}">{{ core()->currency($baseTaxAmount) }}</span>
              </div>
          @endforeach
      @endif
      

      After that run php artisan vendor:publish --all --force

      Note: I hardcoded values with 'Transportation' and 'GST'. If you need translation support than you need to add values in translation.

      1 Reply Last reply Reply Quote 1
      • D
        Deepanjali last edited by 31 Aug 2020, 09:34

        Running the command undid all the customisations I did to the CSS of the website,
        Is there a way to restore my setting or do I have to redo the entire work?

        1 Reply Last reply Reply Quote 0
        • devansh-webkul
          devansh-webkul last edited by 31 Aug 2020, 10:13

          Hi @Deepanjali,

          You need to do all your css changes in the packages folder. So that all your changes go to the resources folder.

          If you are doing directly in the resouces folder then all you changes will ger overwritten.

          There is no way to get those changes back unless and until you are using some good IDE just like PHPStorm.

          1 Reply Last reply Reply Quote 0
          • D
            Deepanjali last edited by 1 Sept 2020, 04:55

            I'm using VS Code and wrote my changes directly into velocity.css in the public directory, how can I make these permanent?

            1 Reply Last reply Reply Quote 0
            • devansh-webkul
              devansh-webkul last edited by devansh-webkul 1 Sept 2020, 19:36 1 Sept 2020, 19:36

              Hi @Deepanjali,

              Well if you want to make your changes i am assuming that you are familiar with node js as well.

              Step 1: Go to the folder packages/Webkul/Velocity and open terminal here and run npm install. This will install all your dependencies.

              Step 2: After that, you need to run the command npm run watch. This will monitor all your changes and reflect back to the public folder directly.

              Step 3: Now add all your CSS in this file and see the changes in the browser.
              Important Note: These changes are also temporary right now.

              Step 4: When you are all done with your changes. Then run this command npm run prod. This will compile all your changes.

              Step 5: After that, you need to run php artisan vendor:publish --all --force. This will brings the latest velocity.css file.

              D 1 Reply Last reply 2 Sept 2020, 10:10 Reply Quote 0
              • D
                Deepanjali last edited by 2 Sept 2020, 10:09

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • D
                  Deepanjali @devansh-webkul last edited by 2 Sept 2020, 10:10

                  @devansh-webkul said in Change the name of tax on frontend:

                  npm run watch

                  I'm stuck on the npm rum watch for about 10 minutes now, although it should have taken only about 10seconds. How do I get past this?
                  d9ff3220-9be4-4768-afe7-17a2cde084d8-image.png

                  1 Reply Last reply Reply Quote 0
                  • devansh-webkul
                    devansh-webkul last edited by 3 Sept 2020, 04:51

                    Hi @Deepanjali,

                    Well, I am not seeing any problem in this screenshot. Your file watcher is now on.

                    Just minimize this and do your changes in the packages/Webkul/Velocity/src/Resources/assets/sass/app.scss in this file. As I said in step 3.

                    D 1 Reply Last reply 3 Sept 2020, 09:39 Reply Quote 0
                    • D
                      Deepanjali @devansh-webkul last edited by 3 Sept 2020, 09:39

                      Hi @devansh-webkul ,
                      I'm making changes to "public\themes\velocity\assets\css\velocity.css" and "bootstrap.min.css"
                      so I tried running these commands in "public\themes\velocity" but after step 5,
                      My changes are restored to default.
                      (I think it is because of the npm run watch not terminating normally)
                      Note: I made the changes while the file watcher was on, then I terminated it forcefully to run npm run prod

                      1 Reply Last reply Reply Quote 0
                      • devansh-webkul
                        devansh-webkul last edited by 3 Sept 2020, 10:54

                        Hi @Deepanjali,

                        No npm run watch only for development purpose. You need to do changes in this path packages/Webkul/Velocity/src/Resources/assets/sass/app.scss. I have mentioned earlier also.

                        Now when you done with the changes. Then run npm run prod and after that php artisan vendor:publish --all --force.

                        D 1 Reply Last reply 4 Sept 2020, 07:53 Reply Quote 0
                        • D
                          Deepanjali @devansh-webkul last edited by 4 Sept 2020, 07:53

                          Hi @devansh-webkul,
                          Thank you so much! I was able to do the changes in the file.

                          1 Reply Last reply Reply Quote 0
                          • D
                            Deepanjali last edited by 4 Sept 2020, 07:58

                            Another thing regarding taxes, How can I add another tax name?

                            1 Reply Last reply Reply Quote 0
                            • devansh-webkul
                              devansh-webkul last edited by devansh-webkul 5 Sept 2020, 08:37 5 Sept 2020, 08:37

                              Hi @Deepanjali,

                              For this, you need to refer here,

                              Screenshot from 2020-09-05 14-04-06.png

                              Please take a look.

                              D 2 Replies Last reply 7 Sept 2020, 05:58 Reply Quote 0
                              • D
                                Deepanjali @devansh-webkul last edited by 7 Sept 2020, 05:48

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • D
                                  Deepanjali @devansh-webkul last edited by 7 Sept 2020, 05:58

                                  @devansh-webkul I have 2 tax rates in the tax category, but I want to apply the second rate on the amount after the calculation with the first one:
                                  fb2d83d5-7eca-4818-97da-d0de14c2ee25-image.png

                                  How can I custom my tax rate to work on a different amount?

                                  1 Reply Last reply Reply Quote 0
                                  • devansh-webkul
                                    devansh-webkul last edited by 7 Sept 2020, 07:43

                                    Hi @Deepanjali,

                                    1. Just add both taxes to the same tax category.
                                    2. After that add tax category to the product.
                                    3. Then, it will automatically calculate for you.
                                    D 1 Reply Last reply 7 Sept 2020, 07:48 Reply Quote 0
                                    • D
                                      Deepanjali @devansh-webkul last edited by 7 Sept 2020, 07:48

                                      @devansh-webkul This is exactly what I've done but I guess there is a bug:
                                      My fixed shipping rate(Transportation) is getting copied in Marine cover:
                                      eb2e59ae-7fb5-4a16-8055-1db7585729b8-image.png

                                      1 Reply Last reply Reply Quote 0
                                      4 out of 18
                                      • First post
                                        4/18
                                        Last post