# Agregar campo de texto debajo del precio

**URL:** <https://foro.wpargentina.org/t/agregar-campo-de-texto-debajo-del-precio/2037>\
**Category:** WooCommerce\
**Created:** [2 Mayo, 2020 21:00 UTC](https://foro.wpargentina.org/t/agregar-campo-de-texto-debajo-del-precio/2037 "2020-05-02T21:00:46Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Mariano\_Genco](https://foro.wpargentina.org/user_avatar/foro.wpargentina.org/mariano_genco/32/1988_2.png) [@Mariano\_Genco](https://foro.wpargentina.org/u/Mariano_Genco)\
**Post date:** [10 Abril, 2021 16:30 UTC](https://foro.wpargentina.org/t/agregar-campo-de-texto-debajo-del-precio/2037/11 "2021-04-10T16:30:33Z")

</div>

Hola que tal actualizo el codigo. Perdon si no les anduvo el anterior.

```
 add_filter( 'woocommerce_get_price_html', 'change_displayed_sale_price_html', 10, 2 );
    function change_displayed_sale_price_html( $price, $product ) {
		
		
        if( $product->is_type('simple') ){
            
             $regular_price = (float) $product->get_regular_price(); // Regular price
             $sale_price = (float) $product->get_price(); // Active price (the "Sale price" when on-sale)

         
             $precision = 2; // Max number of decimals
            
                $cuotapreciosale = round (($sale_price + ($sale_price / 100 * 20)) / 18, $precision);
                $price .= sprintf( __('<br><span style="font-size:15px;color:#d66d50;"> <b>18</b> CUOTAS SIN INTERES DE $%s</span>', 'woocommerce' ), $cuotapreciosale );
             
             }
        return $price;
		
		
    }

```

Cualquier consulta especifica al tema, mensaje privado, no hay problema!

El codigo es intuitivo. Por un lado tiene la cuenta matematica en donde cambian el 18 por el que necesitan segun las cuotas.

Luego abajo en la variable **$price** hay una etiqueta que le da formato al texto.

Para agregar el codigo pueden bajar el plugin Code Snippets

> **[Code Snippets](https://wordpress.org/plugins/code-snippets/)**
>
> An easy, clean and simple way to run code snippets on your site.

Espero que este les sea de utilidad ya. Saludos a todos!

---

_[View the full topic](https://foro.wpargentina.org/t/agregar-campo-de-texto-debajo-del-precio/2037)._
