Created
December 1, 2012 20:59
-
-
Save claudiosanches/4185057 to your computer and use it in GitHub Desktop.
Revisions
-
claudiosanches created this gist
Dec 1, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ <?php /** * Custom simple product price format. * * Adds credit cart parcels in price html. * * @param string $price Old price format. * * @return string Price format with credit card parcels. */ function cs_custom_simple_product_price_html( $price ) { global $product; $parcels = 10; // Edit the number of parcels here! $parcel_price = $product->get_price() / 10; $html = '<span class="parcels">' . $parcels . 'x </span>'; $html .= woocommerce_price( $parcel_price ) . '<br />'; $html .= '<span class="without-interest">' . __( 'sem juros' ) . '</span><br />'; $html .= woocommerce_price( $product->get_price() ); return $html; } add_filter( 'woocommerce_price_html', 'cs_custom_simple_product_price_html' );