Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Aplicando descuento en cascada - VueJS

Necesito mostrar descuentos sobre descuentos, hasta ahora he logrado mostrar el descuento principal en el producto, pero necesito que este descuento se acumule en los valores.

Por favor, alguien podría ayudarme a aplicar estos descuentos correctamente.

Aquí un ejemplo del descuento en este momento:

Aplicar descuento por cada descuento en el producto

 <template> <div class="samurai-single-product-dcto"> <p v-for="discount in discounts" :key="discount.id"> <span class="title-promotion">{{discount.titulo}}:</span> <strong class="price-promotion"> {{discountPrice(singleProduct.selectedProduct.precio,discount.descuentoCupon) | toCurrency }} </strong> <strong class="text-iva">{{$store.getters.showIva}}</strong> </p> </div> </template> <script> import { mapState } from 'vuex'; import _ from 'lodash'; export default { name:'SamuraiSingleProductDcto', computed:{ ...mapState({ singleProduct:'singleProduct', discounts(state){ let result = state.singleProduct.selectedProduct.descuentos.filter(element => (element.tipoCupon && !element.codigoCupon)); return _.uniqBy(result, 'id'); } }) }, methods:{ discountPrice(price, discount){ let priceResult = this.$store.getters.removeIva(price); let discountResult = 1 - (discount / 100); return Math.round( priceResult * discountResult); } } } </script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!