Anddressfor Brands
WooCommerce & WordPress Hook Integration

Provador Virtual com IA para Lojas WooCommerce

Adicione o provador virtual em qualquer loja WooCommerce. Sem plugins pesados.

Zero PHP Overhead

Zero CPU or memory consumed on your WordPress server. All GPU inference is handled by Anddress infrastructure.

Native WooCommerce Hooks

Hooks natively into standard action points like woocommerce_after_add_to_cart_button without modifying core templates.

Page Builders Ready

Works seamlessly inside Elementor Pro Single Product templates, Divi Builder, or Gutenberg product blocks with isolated Shadow DOM.

Instalación en functions.php

Add this snippet to your child theme

En tu archivo wp-content/themes/tu-tema-hijo/functions.php:
// 1. Cargar el script asíncrono en el pie de página
add_action('wp_footer', function() {
    echo '<script src="https://brands.anddress.com/widget/anddress-brands.js" data-brand-key="pk_live_TU_CLAVE" async></script>';
});

// 2. Inyectar el botón en la ficha de producto de WooCommerce
add_action('woocommerce_after_add_to_cart_button', function() {
    global $product;
    if (!$product) return;
    $img_id  = $product->get_image_id();
    $img_url = wp_get_attachment_image_url($img_id, 'full');
    ?>
    <div style="margin-top: 14px;">
      <anddress-tryon-button
        data-garment-image="<?php echo esc_url($img_url); ?>"
        data-garment-category="tops"
        data-garment-id="<?php echo esc_attr($product->get_sku() ?: $product->get_id()); ?>"
        data-garment-name="<?php echo esc_attr($product->get_name()); ?>">
      </anddress-tryon-button>
    </div>
    <?php
});
Provador Virtual com IA para WooCommerce e WordPress — Anddress