/** * Single Product Meta * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } global $post, $product; $cat_count = sizeof(get_the_terms($post->ID, 'product_cat')); $tag_count = sizeof(get_the_terms($post->ID, 'product_tag')); $caracteristicas_platillo = get_the_terms($post->ID, 'caracteristica-platillo'); $ingredientes = get_ingredientes($post->ID); $porcion = get_post_meta($post->ID, '_porcion_meta', true); $proteina = get_post_meta($post->ID, '_proteina_meta', true); $calorias = get_post_meta($post->ID, '_calorias_meta', true); $fibra_dietetica = get_post_meta($post->ID, '_fibra_dietetica_meta', true); ?> <?php if (!empty($caracteristicas_platillo)) { ?> <article class="[ margin-bottom-large ][ caracteristicas ][ container ]"> <div class="[ block ][ col-xs-12 col-sm-8 col-md-6 col-centered ][ text-center ]"> <?php foreach ($caracteristicas_platillo as $caracteristica) {
public function weekend_menu() { $data = array('menu' => array()); $query_count = 0; $product_args = array('post_type' => 'product', 'posts_per_page' => 5, 'meta_query' => array(array('key' => '_fecha_menu_meta', 'value' => get_dias_restantes_semana())), 'orderby' => 'meta_value', 'order' => 'ASC'); $query = new WP_Query($product_args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); global $product; global $post; $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'shop_single'); $fecha_menu = get_fecha_es(get_post_meta($post->ID, '_fecha_menu_meta', true)); $carTemp = get_the_terms($post->ID, 'caracteristica-platillo'); $caracteristicas_platillo = array(); if (!empty($carTemp)) { foreach ($carTemp as $caracteristica) { $caracteristicas_platillo[] = array('icon' => THEMEPATH . "icons/" . $caracteristica->slug . ".svg", 'name' => $caracteristica->name); } } $ingredientes = get_ingredientes($post->ID); $guarnicion_1 = get_post_meta($post->ID, '_guarnicion_1_meta', true); $guarnicion_2 = get_post_meta($post->ID, '_guarnicion_2_meta', true); $porcion = get_post_meta($post->ID, '_porcion_meta', true); $proteina = get_post_meta($post->ID, '_proteina_meta', true); $calorias = get_post_meta($post->ID, '_calorias_meta', true); $fibra_dietetica = get_post_meta($post->ID, '_fibra_dietetica_meta', true); $menu = array('title' => get_the_title(), 'descripcion' => format_contenido_platillo($guarnicion_1, $guarnicion_2), 'content' => get_the_content(), 'image' => $image[0], 'guarnicion_1' => $guarnicion_1, 'guarnicion_2' => $guarnicion_2, 'caracteristicas_platillo' => $caracteristicas_platillo, 'ingredientes' => $ingredientes, 'porcion' => $porcion, 'proteina' => $proteina, 'calorias' => $calorias, 'fibra_dietetica' => $fibra_dietetica, 'price' => $product->get_price(), 'stock' => $product->get_stock_quantity(), 'is_in_stock' => $product->is_in_stock(), 'fecha_menu' => $fecha_menu, 'can_be_bought' => product_can_be_bought($product->id)); $data['menu'][] = $menu; } } DABBA_API_Output::get()->output(true, 200, '', $data); }