No se han encontrado widgets en la barra lateral

Métodos del objeto de producto

// Get Product ID $product->get_id(); // Get Product General Info $product->get_type();$product->get_name();$product->get_slug();$product->get_date_created();$product->get_date_modified();$product->get_status();$product->get_featured();$product->get_catalog_visibility();$product->get_description();$product->get_short_description();$product->get_sku();$product->get_menu_order();$product->get_virtual();get_permalink( $product->get_id() ); // Get Product Prices $product->get_price();$product->get_regular_price();$product->get_sale_price();$product->get_date_on_sale_from();$product->get_date_on_sale_to();$product->get_total_sales(); // Get Product Tax, Shipping & Stock $product->get_tax_status();$product->get_tax_class();$product->get_manage_stock();$product->get_stock_quantity();$product->get_stock_status();$product->get_backorders();$product->get_sold_individually();$product->get_purchase_note();$product->get_shipping_class_id(); // Get Product Dimensions…

Leer más

Validar un campo como RUT en woocommerce checkout

Solo debes considerar cambiar el nombre de tu field, en el post data. // Validar Rut chileno en el check out de WooCommerceadd_action('woocommerce_after_checkout_validation', 'validar_rut_chileno');function validar_rut_chileno($posted_data) { $rut = sanitize_text_field($posted_data); //…

Leer más

Leer Ficheros de imágenes y generar un arreglo general.

<?phpfunction obtenerImagenes($directorio) { $contenido = scandir($directorio); $imagenes = array(); foreach ($contenido as $elemento) { if ($elemento != '.' && $elemento != '..') { $ruta = $directorio . '/' . $elemento;…

Leer más

Mínimo de compra en Woocommerce

add_action( 'woocommerce_check_cart_items', 'required_min_cart_subtotal_amount' ); function required_min_cart_subtotal_amount() { // HERE Set minimum cart total amount $minimum_amount = 250; // Total (before taxes and shipping charges) $cart_subtotal = WC()->cart->subtotal; // Add an…

Leer más

ver errores de php

ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

Leer más

Reemplazar texto en wordpress

function replace_text($text) { $text = str_replace('Correo electrónico', 'replace-with-this-string', $text); return $text; } add_filter('the_content', 'replace_text');

Leer más

Establecer mínimo de compra Woocommerce

// Establecer un importe minimo en la compra function woocommerce_importe_minimo() { $minimum = 20; // Debes cambiar el 20 por el importe mínimo que quieras establecer en tu pedido if…

Leer más

Obtener el post_content usando un id de post

$post = get_post(12); // specific post $the_content = apply_filters('the_content', $post->post_content); if ( !empty($the_content) ) { echo $the_content; }

Leer más

Obtener el id de la pagina de posts

Para obtener este id, se utiliza el siguoiente código: $page_for_posts = get_option( 'page_for_posts' );

Leer más

Agregar ACF de imágenes en el menú

add_filter('wp_nav_menu_objects', 'my_wp_nav_menu_objects', 10, 2); function my_wp_nav_menu_objects( $items, $args ) { foreach( $items as &$item ) { $icon = get_field('icono', $item); if( $icon ) { $item->title .= ' ';} } return…

Leer más