<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Woocommerce - Foro de soporte IGW				            </title>
            <link>https://iguannaweb.com/community/woocommerce/</link>
            <description>De momento esto es un foro de soporte donde iré poniendo cosas que pueden servir o que utilizo a lo largo de mi trabajo. Más adelante puede que deje o permita comentarios de vosotros.</description>
            <language>es</language>
            <lastBuildDate>Fri, 17 Apr 2026 05:31:36 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Colorear estados de pedidos en el backend</title>
                        <link>https://iguannaweb.com/community/woocommerce/colorear-estados-de-pedidos-en-el-backend/</link>
                        <pubDate>Fri, 22 Mar 2024 17:45:53 +0000</pubDate>
                        <description><![CDATA[&lt;?php

add_action(&#039;admin_head&#039;, &#039;orbisius_tutorial_7459_render_styles&#039;);

/**
 * This will override the Completed Order Status in WooCommerce - Orders
 * @return void
 * @see
 */
...]]></description>
                        <content:encoded><![CDATA[<pre contenteditable="false">&lt;?php

add_action('admin_head', 'orbisius_tutorial_7459_render_styles');

/**
 * This will override the Completed Order Status in WooCommerce - Orders
 * @return void
 * @see https://orbisius.com/7459
 */
function orbisius_tutorial_7459_render_styles() {
    ?&gt;
    &lt;style&gt;
        .order-status.status-completed {
            color: #fff !important;
            background: red !important;
        }
    &lt;/style&gt;
    &lt;?php
}</pre>
<p> </p>
<p><strong>Fuente:</strong> <a href="https://orbisius.com/blog/change-color-completed-order-status-woocommerce/" target="_blank" rel="noopener">https://orbisius.com/blog/change-color-completed-order-status-woocommerce/</a></p>]]></content:encoded>
						                            <category domain="https://iguannaweb.com/community/woocommerce/">Woocommerce</category>                        <dc:creator>Francisco GP</dc:creator>
                        <guid isPermaLink="true">https://iguannaweb.com/community/woocommerce/colorear-estados-de-pedidos-en-el-backend/</guid>
                    </item>
				                    <item>
                        <title>Añadir unidades de productos al carrito por separado</title>
                        <link>https://iguannaweb.com/community/woocommerce/anadir-unidades-de-productos-al-carrito-por-separado/</link>
                        <pubDate>Mon, 09 Jan 2023 23:56:53 +0000</pubDate>
                        <description><![CDATA[Resulta que a veces quieres que los productos se añadan al carrito por separado y no incrementen la cantidad del mismo. En este caso tengo guardado este pequeño código que encontré aquí desd...]]></description>
                        <content:encoded><![CDATA[<p>Resulta que a veces quieres que los productos se añadan al carrito por separado y no incrementen la cantidad del mismo. En este caso tengo guardado este pequeño código que encontré <a href="https://www.proteusthemes.com/help/add-product-cart-twice-instead-changing-quantity-woocommerce/" target="_blank" rel="noopener">aquí</a> desde hace un tiempo.</p>
<pre contenteditable="false">function namespace_force_individual_cart_items( $cart_item_data, $product_id ) {
  $unique_cart_item_key = md5( microtime() . rand() );
  $cart_item_data = $unique_cart_item_key;

  return $cart_item_data;
}
add_filter( 'woocommerce_add_cart_item_data', 'namespace_force_individual_cart_items', 10, 2 );</pre>]]></content:encoded>
						                            <category domain="https://iguannaweb.com/community/woocommerce/">Woocommerce</category>                        <dc:creator>Francisco GP</dc:creator>
                        <guid isPermaLink="true">https://iguannaweb.com/community/woocommerce/anadir-unidades-de-productos-al-carrito-por-separado/</guid>
                    </item>
				                    <item>
                        <title>Eliminar el botón Añadir al carrito condicionalmente</title>
                        <link>https://iguannaweb.com/community/woocommerce/eliminar-el-boton-anadir-al-carrito-condicionalmente/</link>
                        <pubDate>Wed, 04 Jan 2023 20:00:12 +0000</pubDate>
                        <description><![CDATA[Fuente:
Si a veces has querido bloquear la compra por determinadas condiciones en woocommerce, este plugin es lo que necesitas.
&lt;?php
/*
Plugin Name: Remove &#039;Add to cart&#039; conditionally...]]></description>
                        <content:encoded><![CDATA[<p>Fuente: <a href="https://www.damiencarbery.com/2020/03/remove-add-to-cart-button-conditionally/" target="_blank" rel="noopener">https://www.damiencarbery.com/2020/03/remove-add-to-cart-button-conditionally/</a></p>
<p>Si a veces has querido bloquear la compra por determinadas condiciones en woocommerce, este plugin es lo que necesitas.</p>
<pre contenteditable="false">&lt;?php
/*
Plugin Name: Remove 'Add to cart' conditionally
Plugin URI:  https://www.damiencarbery.com/2020/03/remove-add-to-cart-button-conditionally/
Description: Conditionally remove the 'Add to cart' button in WooCommerce.
Author: Damien Carbery
Version: 0.4
WC tested up to: 5.9.1
*/


class IsPurchasableConditionalFiltering {
    // A reference to an instance of this class.
    private static $instance;
    // Store whether 'Add to cart' button should be displayed.
    private $purchasable;


    // Returns an instance of this class. 
    public static function get_instance() {
        if ( null == self::$instance ) {
            self::$instance = new IsPurchasableConditionalFiltering;
        }
        return self::$instance;
    }


    // Initialize the plugin variables.
    public function __construct() {
        $this-&gt;purchasable = array();

        $this-&gt;init();
    }


    // Set up WordPress specfic actions.
    public function init() {
        add_filter( 'woocommerce_is_purchasable', array( $this, 'is_purchasable_conditionals' ), 10, 2 );
        
        // Remove variations dropdown and 'Add to cart' button for variable products.
        add_action( 'woocommerce_before_single_product_summary', array( $this, 'before_single_product_summary' ) );
    }
    
    
    public function is_purchasable_conditionals( $whether_purchasable, $product ) {
        // Store the product ID as $product will be overwritten if $product is a variation.
        $product_id = $product-&gt;get_id();
        
        // Return cached result.
        if ( array_key_exists( $product_id, $this-&gt;purchasable ) ) {
            return $this-&gt;purchasable;
        }

        // Only do our conditional checks if WooCommerce deems the item to be purchasable.
        if ( $whether_purchasable ) {
            $result = true;  // Default to allowing purchase.
            // Aquí puedes bloquear por condiciones de precio, tienes que decomentar el bloque de código
            // Check our specific conditions - some examples.
            /* // Product over a certain price - this must be checked at variation
            // level so do this before the $product-&gt;get_type() check.
            if ( $product-&gt;get_price() &gt; 20 ) {
                $result = false;
            }*/
            
			/* // Aquí puedes poner las ids de productos a bloquear, tienes que decomentar el bloque de código
            $ids_not_purchasable = array ( 111, 140, 437, 1733, );
			if ( in_array( $product_id, $ids_not_purchasable ) ) {
                $result = false;
            }*/

            // If this is a variation then get the parent product so that categories can be checked.
            if ( 'variation' == $product-&gt;get_type() ) {
                $product = wc_get_product( $product-&gt;get_parent_id() );
                $product_id = $product-&gt;get_id();
            }
           // Aquí puedes bloquear por categoría, tienes que decomentar el bloque de código
            // Check if product in a certain categores.
            if ( has_term( array( 'hoodies', 'accessories', 'tshirts' ), 'product_cat', $product_id ) ) {
                $result = false;
            }

            $this-&gt;purchasable = $result;
        }
        else {
            // Store that this item cannot be purchased.
            $this-&gt;purchasable = false;
        }

        return $this-&gt;purchasable;
    }


    public function before_single_product_summary() {
        $product_id = get_the_ID();
        if ( array_key_exists( $product_id, $this-&gt;purchasable ) &amp;&amp; !$this-&gt;purchasable ) {
            // Remove the variation dropdowns and 'Add to cart' button for variable products.
            remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 );
            remove_action( 'woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30 ); 
        }
    }
}
$IsPurchasableConditionalFiltering = new IsPurchasableConditionalFiltering;</pre>
<p> </p>]]></content:encoded>
						                            <category domain="https://iguannaweb.com/community/woocommerce/">Woocommerce</category>                        <dc:creator>Francisco GP</dc:creator>
                        <guid isPermaLink="true">https://iguannaweb.com/community/woocommerce/eliminar-el-boton-anadir-al-carrito-condicionalmente/</guid>
                    </item>
				                    <item>
                        <title>Desactivar el botón &quot;Volver a pedir&quot; de Woocommerce</title>
                        <link>https://iguannaweb.com/community/woocommerce/desactivar-el-boton-volver-a-pedir-de-woocommerce/</link>
                        <pubDate>Mon, 02 Jan 2023 19:41:17 +0000</pubDate>
                        <description><![CDATA[Me ha pasado que por cuestiones colaterales había que quitar el botón de &quot;Volver a pedir&quot; de cuando se muestra la info del pedido de woocommerce.
Al principio usé esta línea de código en un...]]></description>
                        <content:encoded><![CDATA[<p>Me ha pasado que por cuestiones colaterales había que quitar el botón de "Volver a pedir" de cuando se muestra la info del pedido de woocommerce.</p>
<p>Al principio usé esta línea de código en un plugin:</p>
<pre contenteditable="false">remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );</pre>
<div>Luego me tocó tirar de CSS:</div>
<div> </div>
<pre contenteditable="false">p.order-again { display: none !important;&lt;span id="line302"&gt;&lt;/span&gt;}</pre>
<div> </div>
<div> </div>]]></content:encoded>
						                            <category domain="https://iguannaweb.com/community/woocommerce/">Woocommerce</category>                        <dc:creator>Francisco GP</dc:creator>
                        <guid isPermaLink="true">https://iguannaweb.com/community/woocommerce/desactivar-el-boton-volver-a-pedir-de-woocommerce/</guid>
                    </item>
				                    <item>
                        <title>Enviar correo a clientes cuando el pedido se cancela o falla</title>
                        <link>https://iguannaweb.com/community/woocommerce/enviar-correo-a-clientes-cuando-el-pedido-se-cancela-o-falla/</link>
                        <pubDate>Mon, 02 Jan 2023 19:39:33 +0000</pubDate>
                        <description><![CDATA[No sé si te habrás dado cuenta pero en los pedidos cancelados de woocommerce el correo al que se envía notificación normalmente es el administrador, que se configura en ajustes &gt; correos....]]></description>
                        <content:encoded><![CDATA[<p>No sé si te habrás dado cuenta pero en los pedidos cancelados de woocommerce el correo al que se envía notificación normalmente es el administrador, que se configura en ajustes &gt; correos.</p>
<p>Pero si quieres notificar al usuario (o modificarlo para otra cosa) toca de tirar de código. Normalmente te dicen que lo pongas en el functions.php, aunque siempre es mejor en forma de plugin.</p>
<pre contenteditable="false"><code>add_action('woocommerce_order_status_changed', 'send_custom_email_notifications', 10, 4 );
function send_custom_email_notifications( $order_id, $old_status, $new_status, $order ){
if ( $new_status == 'cancelled' || $new_status == 'failed' ){
$wc_emails = WC()-&gt;mailer()-&gt;get_emails(); // Get all WC_emails objects instances
$customer_email = $order-&gt;get_billing_email(); // The customer email
}

if ( $new_status == 'cancelled' ) {
// change the recipient of this instance
$wc_emails-&gt;recipient = $customer_email;
// Sending the email from this instance
$wc_emails-&gt;trigger( $order_id );
}
elseif ( $new_status == 'failed' ) {
// change the recipient of this instance
$wc_emails-&gt;recipient = $customer_email;
// Sending the email from this instance
$wc_emails-&gt;trigger( $order_id );
}
}</code></pre>
<p>Y también puedes mantener el que tengas en configuración si cambias esto:</p>
<pre contenteditable="false"><code>// Add a recipient in this instance
$wc_emails-&gt;recipient .= ',' . $customer_email;</code></pre>
<p> </p>]]></content:encoded>
						                            <category domain="https://iguannaweb.com/community/woocommerce/">Woocommerce</category>                        <dc:creator>Francisco GP</dc:creator>
                        <guid isPermaLink="true">https://iguannaweb.com/community/woocommerce/enviar-correo-a-clientes-cuando-el-pedido-se-cancela-o-falla/</guid>
                    </item>
							        </channel>
        </rss>
		