Created
November 23, 2012 15:01
-
-
Save claudiosanches/4136019 to your computer and use it in GitHub Desktop.
WooCommerce - Customizar o summary do content-single-product.php
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 characters
<?php | |
// Colar no functions.php | |
// Para remover os hooks | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing' ); | |
/* | |
No content-single-product.php você vai colocar as funções onde quer manualmente: | |
Exemplo: | |
Mostrar título: | |
<?php woocommerce_template_single_title(); ?> | |
Mostrar preço: | |
<?php woocommerce_template_single_price(); ?> | |
Mostrar resumo: | |
<?php woocommerce_template_single_excerpt(); ?> | |
Mostrar botão de adicionar no carrinho: | |
<?php woocommerce_template_single_add_to_cart(); ?> | |
Mostrar as informações do campo meta (geralmente tags, categorias e sku): | |
<?php woocommerce_template_single_meta(); ?> | |
Mostrar mostrar botões de compartilhamento (você deve configurar isso nas configurações do woocommerce): | |
<?php woocommerce_template_single_sharing(); ?> | |
Cada função leva para um template diferente do WooCommerce. | |
Como por exemplo o woocommerce_template_single_title() chama o template single-product/title.php | |
Para alterar como aparece o title, basta personalizar o template ou copiar o código e usar direto no content-single-product.php | |
Você entra informações dessas funções no arquivo woocommerce-template.php | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment