woocommerce_after_template_part

ACTION woocommerce\includes\wc-core-functions.php (ligne 348) github
Get other templates (e.g. product attributes) passing attributes and including the file.
traduction française
Obtenir d'autres modèles (par exemple des attributs de produits) en passant par les attributs et en incluant le fichier.

Paramètres

Entrée :
$action_args['template_name'], $action_args['template_path'], $action_args['located'], $action_args['args']
Sortie :
@param string $template_name Template name.
@param array  $args          Arguments. (default: array).
@param string $template_path Template path. (default: '').
@param string $default_path  Default path. (default: '').

Utilisation

Action après le chargement d'un template

Exécuter du code après chaque template WooCommerce

ui technical
// Après chargement template
add_action('woocommerce_after_template_part', 'apres_template_woo', 10, 4);

function apres_template_woo($template_name, $template_path, $located, $args) {
    // Ajouter du contenu après certains templates
    if ($template_name === 'single-product/price.php') {
        echo '
Prix TTC, livraison non comprise
'; } }

Actualités

Chargement des actualités...