Accueil
Favicon BulgaWeb
Close menu
Tutoriels
Plugins
Blog
Liens utiles
Boutique
Contact
Connexion
Favicon BulgaWeb
  • Accueil
  • Tutoriels
  • Plugins
  • Blog
  • Liens utiles
  • Boutique
  • Contact

Les fonctions sont montrées à titre d'exemple. L'avantage des bloc de code et fonctions est qu'elle permette par exemple de changer la taille du titre (h1 ou h2, ...) voir de personnaliser la sortie comme pour le stock qui est différent dans la fonction que l'originale. Les blocs en rouge sont les résultats du code dans les blocs et au dessus la fonction.

Accueil / Music / Single
WooCommerce Hook : do_action( 'woocommerce_before_main_content' );
Accueil / Music / Single
WooCommerce Hook pour les notices : do_action( 'woocommerce_before_single_product' );
Promo !
single-1.jpg
WooCommerce Hook :
do_action( 'woocommerce_before_single_product_summary' );
Promo !
single-1.jpg

Single

global $product;
echo '<div class="woo-title">Titre du produit : <h2>' . $product->get_title() . '</h2></div>';

Titre du produit :

Single

3,00€ 2,00€

<?php

global $product;
$currency = get_woocommerce_currency_symbol();
$price = get_post_meta( get_the_ID(), '_regular_price', true);
$sale = get_post_meta( get_the_ID(), '_sale_price', true);
?>

<?php if($sale) : ?>
<p class="product-price-tickr"><del><?php echo $currency; echo $price; ?></del> <?php echo $currency; echo $sale; ?></p>
<?php elseif($price) : ?>
<p class="product-price-tickr"><?php echo $currency; echo $price; ?></p>
<?php endif;
echo 'Price : ' . wc_price($product->get_price_including_tax(1,$product->get_price()));

?>

€3 €2

Price : 2,00€

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.

global $product;
echo 'Description : ' . $product->get_description();

Description : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.

This is a simple, virtual product.

global $product;
echo 'Short description : ' . $product->get_short_description();

Short description : This is a simple, virtual product.
UGS : woo-single Catégorie : Music

global $product;
echo '<div class="woo-cat">Categories : ' . $product->get_categories() . '</div>';

Categories : Music
UGS : woo-single

Informations complémentaires

<?php
global $product;
echo '<div class="woo-desc">Description : ' . $product->get_description() . '</div>';
?>

Description : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.

<?php
global $product;
echo '<div class="woo-desc">En stock : ' . $product->get_stock_quantity() . '</div>';
?>

En stock :
Copyright © 2019 - 2023 Bulgaweb
 | 
Développé par BulgaWeb
Visit our FacebookVisit our YouTube channel
Nous utilisons des cookies sur notre site Web pour vous offrir l'expérience la plus pertinente en mémorisant vos préférences et en répétant vos visites. En cliquant sur « Accepter », vous consentez à l'utilisation de TOUS les cookies.
Paramètres des cookiesACCEPTER
Gérer le consentement

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Toujours activé
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDuréeDescription
cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
Enregistrer & appliquer
align-justifybookscomment-alt-messageenvelopelinkplugshopping-trolleyuserarrow-up-oeyeeye-alt
Uploaded
Failed
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram