What I would like to have is the sentence “Entre em contacto connosco para saber preços Aqui” just in product page, not in shop page. Please take a look in this page: http://www.kepaweleurope.com/shop/soutien-mamoplastia-85/
Does anybody can help me?
Thanks in advance
Miguel
2 Answers
The short description template is /templates/single-product/short-description.php :
<?php
/**
* Single product short description
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $post;
if ( ! $post->post_excerpt ) return;
?>
<div itemprop="description">
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
</div>
You can override this (or any woo template) : http://docs.woothemes.com/document/template-structure/ by copying the file into your theme… so woocommerce/single-product/short-description.php
. Then you can edit it as you like.
EDIT: If I understand your question you would do this:
<?php
/**
* Single product short description
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $post;
?>
<div itemprop="description">
Entre em contacto connosco para saber preços Aqui
</div>
Or you could filter woocommerce_short_description
. Or you could define your own woocommerce_template_single_excerpt()
function which is pluggable, or remove it entirely from its hook. There really are many ways to do this, but the template override tends to be the simplest to understand.
EDIT: Here’s a very basic example of how to filter the short description (and in general filtering anything is always the same process)
Edit again: this goes in your theme’s functions.php
function wpa_98244_filter_short_description( $desc ){
global $product;
if ( is_single( $product->id ) )
$desc .= ' add some extra text to the short description';
return $desc;
}
add_filter( 'woocommerce_short_description', 'wpa_98244_filter_short_description' );