function add_product() { global $wpdb; $wpmp_obj4 = new MP_Form_Handler(); /*MP_Form_Handler::marketplace_media_fix($post_id);*/ $wpmp_obj4->marketplace_media_fix(); ?> <div class="[ ]"><div class="[ padding ][ text-center ][ border ]"> <h3 class="[ text-center ][ no-margin ]"><?php echo _e("Add Product"); ?> </h3> </div> <div class="[ form ]"> <!-- /*------------------------------------*\ #@Maichomper Esta es la forma que ya estaba maquetada, para que integres esta, abajo está la table bu default \*------------------------------------*/ --> <form action="#"> <section class="[ ]"> <div class="[ padding ]"> <div class="[ text-center ]"> <h3 class="[ no-margin ]">Empieza a vender</h3> </div> </div> <div class="[ wrapper ]"> <h3 class="[ margin-bottom ][ color-primary ]"><small>Describe tu artículo</small></h3> </div> <article class="[ screen-1 ]"> <div class="[ row ][ margin-bottom ]"> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink button--selected ][ padding ]"><i class="[ icon-sillones ]"></i>Sillones</a> <input type="hidden" name="couches" value="selected"> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-sillas ]"></i>Sillas</a> <input type="hidden" name="chairs" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-mesas ]"></i>Mesas</a> <input type="hidden" name="" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-recamaras ]"></i>Recámaras</a> <input type="hidden" name="" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-almacenaje ]"></i>Almacenaje</a> <input type="hidden" name="" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-iluminación ]"></i>Iluminación</a> <input type="hidden" name="" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-decoration ]"></i>Decoración</a> <input type="hidden" name="" value=""> <a href="#" class="[ span xmall-6 ][ border ][ button button--primary button--ink ][ padding ]"><i class="[ icon-kids ]"></i>para niños</a> <input type="hidden" name="" value=""> </div><!-- row --> <div class="wrapper"> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="email">Subcategoría <span class="[ color-primary ]">*</span></label> <select name="subcategories" id=""> <option value="table-lamp">de mesa</option> <option value="table-lamp">de mesa</option> <option value="table-lamp">de mesa</option> </select> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="email">Nombre <span class="[ color-primary ]">*</span></label> <input class="[ block ][ xmall-12 ]" type="text" value="ej. lámpara de mesa negra"> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="email">Descripción <span class="[ color-primary ]"></span></label> <textarea class="[ block ][ xmall-12 ]"></textarea> </fieldset> </div><!-- wrapper --> </article> <article class="[ images ][ screen-2 ]"> <div class="[ wrapper ]"> <h3 class="[ margin-bottom ][ color-primary ]"><small>Agrega imágenes</small></h3> <p class="[ color-dark ]"><small><span class="[ color-primary ]">*</span> Recuerda incluir acercamientos del material y posibles dañis que pueda tener el artículo</small></p> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>vista frontal</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>vista derecha</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>vista izquierda</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>vista trasera</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>detalles</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> <fieldset class="[ margin-bottom ][ padding--large border-grey ][ text-center ]"> <i class="[ block xmall-12 ][ icon-menu icon-camera icon--large ][ color-grey ]"></i> <p class="[ color-grey ]"><small>agregar foto</small></p> <a href="" class="[ button button--primary button--hollow ]">agregar</a> </fieldset> </div> </article> <article class="[ ][ screen-3 ]"> <div class="[ wrapper ]"> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="email">Dimenciones <span class="[ color-primary ]">*</span> (en cms)</label> <div class="[ row ]"> <div class="[ columna xmall-4 ]"> <input class="[ block xmall-12 ]" name="width" type="text" placeholder="ancho"> </div> <div class="[ columna xmall-4 ]"> <input class="[ block xmall-12 ]" name="height" type="text" placeholder="alto"> </div> <div class="[ columna xmall-4 ]"> <input class="[ block xmall-12 ]" name="depth" type="text" placeholder="profundo"> </div> </div> </fieldset> <fieldset class="[ state ][ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Estado</label> <select class="[ padding ][ text-center ]"> <option href="#" value="nuevo" >nuevo</option> <option href="#" value="bueno" >bueno</option> <option href="#" value="satisfactorio" >satisfactorio</option> <option href="#" value="gastado" >gastado</option> </select> <p class="[ no-margin ]"><small><span class="[ color-primary ]">*</span></small></p> <p class="[ no-margin ]"><small>Nuevo - el producto se encuentra dentro de su caja </small></p> <p class="[ no-margin ]"><small>Bueno - el producto se encuentra dentro de su caja </small></p> <p class="[ no-margin ]"><small>Satisfactorio - el producto se encuentra dentro de su caja </small></p> <p class="[ no-margin ]"><small>Gastado - el producto se encuentra dentro de su caja </small></p> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Marca</label> <select class="[ padding ][ text-center ]"> <option href="#" value="nuevo" >nuevo</option> <option href="#" value="bueno" >bueno</option> <option href="#" value="satisfactorio" >satisfactorio</option> <option href="#" value="gastado" >gastado</option> </select> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Material<span class="[ color-primary ]">*</span></label> <select class="[ padding ][ text-center ]"> <option href="#" value="nuevo" >nuevo</option> <option href="#" value="bueno" >bueno</option> <option href="#" value="satisfactorio" >satisfactorio</option> <option href="#" value="gastado" >gastado</option> </select> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Edad<span class="[ color-primary ]">*</span></label> <select class="[ padding ][ text-center ]"> <option href="#" value="nuevo" >nuevo</option> <option href="#" value="bueno" >bueno</option> <option href="#" value="satisfactorio" >satisfactorio</option> <option href="#" value="gastado" >gastado</option> </select> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Color<span class="[ color-primary ]">*</span></label> <div class="[ row ]"> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-black ][ color-chip chip-selected ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-grey ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-brown ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-purple ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-blue ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-green ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-yellow ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-orange ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-red ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-wheat ][ color-chip ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-silver ][ color-chip ]"> </div> </div> </div> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Textura<span class="[ color-primary ]">*</span></label> <div class="[ row ]"> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-black ][ color-chip chip-selected ]"> </div> </div> <div class="[ columna xmall-2 ][ margin-bottom--small ]"> <div class="[ bg-grey ][ color-chip ]"> </div> </div> </div> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Este producto se vende como:<span class="[ color-primary ]">*</span></label> <input type="radio" name="tipo" value="individual"> Artículo individual <br /> <input type="radio" name="tipo" value="conjunto"> En conjunto </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Haz click en las características que tu producto cumpla:</label> <input type="checkbox" name="characteristics" value="antiquity"> Antigüedad<br /> <input type="checkbox" name="characteristics" value="kids"> Mueble para niños<br /> <input type="checkbox" name="characteristics" value="less-than-5"> Pesa menos de 5 kilos<br /> <input type="checkbox" name="characteristics" value="scratches"> Tiene golpes o rayones de más de 2 cms. </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Este artículo a estado expuesto a:</label> <input type="checkbox" name="exposed-to" value="dog"> Perro<br /> <input type="checkbox" name="exposed-to" value="cat"> Gato<br /> <input type="checkbox" name="exposed-to" value="cigarrette"> Cigarro </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Cantidad<span class="[ color-primary ]">*</span></label> <input class="[ block ][ xmall-12 ]" type="number" name="cuantity"> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Precio original<span class="[ color-primary ]">*</span></label> <input class="[ block ][ xmall-12 ]" type="number" name="original-price" value="$"> </fieldset> <fieldset class="[ margin-bottom ]"> <label class="[ block xmall-12 ]" for="">Precio final<span class="[ color-primary ]">*</span></label> <input class="[ block ][ xmall-12 ]" type="number" name="final-price" value="$"> </fieldset> <fieldset class="[ margin-bottom ]"> <input type="checkbox" name="exposed-to" value="cat"> <span class="[ color-primary ]">Solicitar sello cxm</span><br /> <span class="[ color-primary ]">*</span> Actualmente sólo validamos en las zonas de: Polanco, Roma y Condesa. </fieldset> </div><!-- wrapper --> </article> </section> </form> <!-- /*------------------------------------*\ #acaba forma maquetada \*------------------------------------*/ --> <form action="<?php $params = array('page' => "eProduct"); $url = add_query_arg($params, get_permalink()); echo $url; ?> " method="post" enctype="multipart/form-data" id="product-form"> <fieldset> <table> <tbody> <tr> <td><label for="product_name"><?php echo _e("Product Name"); ?> <span class="required">*</span> :</label></td> <td><input class="product_input" type="text" name="product_name" id="product_name" size="54" value="<?php /*if(isset($post_row_data[0]->post_title)) echo $post_row_data[0]->post_title;*/ ?> " /> <div id="pro_name_error" class="error-class"><div> </td> </tr> <tr> <td><label for="product_desc"><?php echo _e("About Product"); ?> :</label></td> <td> <?php $settings = array('media_buttons' => true, 'textarea_name' => 'product_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false); if (isset($post_row_data[0]->post_content)) { $content = $post_row_data[0]->post_content; } if (isset($content)) { echo wp_editor($content, 'product_desc', $settings); } else { echo wp_editor('', 'product_desc', $settings); } ?> <div id="long_desc_error" class="error-class"><div> </td> </tr> <!--<tr> <td><label for="product_type"><?php echo _e("Product Type"); ?> <span class="required">*</span> :</label></td> <td><select size="1" name="product_type" id="product_type"> <option value="no"><?php echo _e("Select Product Type"); ?> </option> <option value="_downloadable"><?php echo _e("Downloadable"); ?> </option> <option value="_virtual"><?php echo _e("Virtual"); ?> </option> </select> </td> </tr>--> <tr> <td style="vertical-align: top;"> <label for="product_category"><?php echo _e("Product Category"); ?> :</label> </td> <td> <select multiple="true" name="product_cate[]" id="product_cate"> <?php /*MP_Form_Handler::mp_product_categories1(0,0);*/ ?> <?php $wpmp_obj4->mp_product_categories1(0, 0); ?> </select> </td> </tr> <tr> <td> <label for="fileUpload"><?php echo _e("Product Thumbnail"); ?> :</label> </td> <td> <div id="product_image"> </div> <input type="hidden" id="product_thumb_image_mp" name="product_thumb_image_mp" /> <a class="upload mp_product_thumb_image btn" href="javascript:void(0);" /><?php _e('Upload Thumb'); ?> </a> </td> </tr> <tr> <td> <label for="product_sku"><?php echo _e("Product SKU"); ?> <span class="required">*</span>: <span class="help"> <div class="help-tip-sol"><?php echo _e("SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased."); ?> </div> <span class="help-tip">[?]</span> </span> </label> </td> <td> <input class="product_input" type="text" name="product_sku" id="product_sku" value="" /> <div id="pro_sku_error" class="error-class"><div> </td> </tr> <tr> <td> <label for="regu_price"><?php echo _e("Regular Price"); ?> <span class="required">*</span> :</label> </td> <td> <input class="product_input" type="text" name="regu_price" id="regu_price" value="" /> <div id="regl_pr_error" class="error-class"><div> </td> </tr> <tr> <td> <label for="sale_price"><?php echo _e("Sale Price"); ?> :</label></td> <td> <input class="product_input" type="text" name="sale_price" id="sale_price" value="" /> <div id="sale_pr_error" class="error-class"><div> </td> </tr> <tr> <td> <label for="short_desc"><?php echo _e("Product Short Desc"); ?> :</label> </td> <td> <?php $settings = array('media_buttons' => true, 'textarea_name' => 'short_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_class' => 'frontend', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false, 'drag_drop_upload' => true); if (isset($post_row_data[0]->post_excerpt)) { $short_content = $post_row_data[0]->post_excerpt; } if (isset($short_content)) { echo wp_editor($short_content, 'short_desc', $settings); } else { echo wp_editor("", 'short_desc', $settings); } ?> <div id="short_desc_error" class="error-class"></div> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="add_product_sub" id="add_product_sub" value="Save" class="button"/></td> </tr> </tbody> </table> <?php apply_filters('mp_user_redirect', 'redirect user'); ?> </fieldset> </form> </div> <?php }
function add_product() { global $wpdb; $wpmp_obj4 = new MP_Form_Handler(); /*MP_Form_Handler::marketplace_media_fix($post_id);*/ $wpmp_obj4->marketplace_media_fix(); ?> <h2><?php echo _e("Add Product"); ?> </h2> <div class="form"> <form action="<?php $params = array('page' => "eProduct"); $url = add_query_arg($params, get_permalink()); echo $url; ?> " method="post" enctype="multipart/form-data" id="product-form"> <fieldset> <table> <tbody> <tr> <td><label for="product_name"><?php echo _e("Product Name"); ?> <span class="required">*</span> :</label></td> <td><input class="product_input" type="text" name="product_name" id="product_name" size="54" value="<?php /*if(isset($post_row_data[0]->post_title)) echo $post_row_data[0]->post_title;*/ ?> " /> <div id="pro_name_error" class="error-class"><div> </td> </tr> <tr> <td><label for="product_desc"><?php echo _e("About Product"); ?> :</label></td> <td><?php $settings = array('media_buttons' => true, 'textarea_name' => 'product_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false); if (isset($post_row_data[0]->post_content)) { $content = $post_row_data[0]->post_content; } if (isset($content)) { echo wp_editor($content, 'product_desc', $settings); } else { echo wp_editor('', 'product_desc', $settings); } ?> <div id="long_desc_error" class="error-class"><div> </td> </tr> <!--<tr> <td><label for="product_type"><?php echo _e("Product Type"); ?> <span class="required">*</span> :</label></td> <td><select size="1" name="product_type" id="product_type"> <option value="no"><?php echo _e("Select Product Type"); ?> </option> <option value="_downloadable"><?php echo _e("Downloadable"); ?> </option> <option value="_virtual"><?php echo _e("Virtual"); ?> </option> </select> </td> </tr>--> <tr> <td style="vertical-align: top;"><label for="product_category"><?php echo _e("Product Category"); ?> :</label> </td> <td><select multiple="true" name="product_cate[]" id="product_cate"> <?php /*MP_Form_Handler::mp_product_categories1(0,0);*/ ?> <?php $wpmp_obj4->mp_product_categories1(0, 0); ?> </select> </td> </tr> <tr> <td><label for="fileUpload"><?php echo _e("Product Thumbnail"); ?> :</label></td> <td> <div id="product_image"> </div> <input type="hidden" id="product_thumb_image_mp" name="product_thumb_image_mp" /> <a class="upload mp_product_thumb_image btn" href="javascript:void(0);" /><?php _e('Upload Thumb'); ?> </a> </td> </tr> <tr> <td> <label for="product_sku"><?php echo _e("Product SKU"); ?> <span class="required">*</span>: <span class="help"> <div class="help-tip-sol"><?php echo _e("SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased."); ?> </div> <span class="help-tip">[?]</span> </span> </label> </td> <td><input class="product_input" type="text" name="product_sku" id="product_sku" value="" /> <div id="pro_sku_error" class="error-class"><div></td> </tr> <tr> <td><label for="regu_price"><?php echo _e("Regular Price"); ?> <span class="required">*</span> :</label></td> <td><input class="product_input" type="text" name="regu_price" id="regu_price" value="" /> <div id="regl_pr_error" class="error-class"><div></td> </tr> <tr> <td><label for="sale_price"><?php echo _e("Sale Price"); ?> :</label></td> <td><input class="product_input" type="text" name="sale_price" id="sale_price" value="" /> <div id="sale_pr_error" class="error-class"><div></td> </tr> <tr> <td><label for="short_desc"><?php echo _e("Product Short Desc"); ?> :</label></td> <td><?php $settings = array('media_buttons' => true, 'textarea_name' => 'short_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_class' => 'frontend', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false, 'drag_drop_upload' => true); if (isset($post_row_data[0]->post_excerpt)) { $short_content = $post_row_data[0]->post_excerpt; } if (isset($short_content)) { echo wp_editor($short_content, 'short_desc', $settings); } else { echo wp_editor("", 'short_desc', $settings); } ?> <div id="short_desc_error" class="error-class"></div></td> </tr> <tr><td></td> <td> <input type="submit" name="add_product_sub" id="add_product_sub" value="Save" class="button"/></td> </tr> </tbody> </table> <?php apply_filters('mp_user_redirect', 'redirect user'); ?> </fieldset> </form> </div> <?php }
function edit_product() { global $wpdb; $wpmp_obj3 = new MP_Form_Handler(); global $mp_obj; $wc_currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); $user_id = get_current_user_id(); if (isset($_GET['pid'])) { $post_id = $wk_pro_id = $_GET['pid']; if ($_POST) { if (isset($_POST['add_product_sub'])) { /*MP_Form_Handler::product_add_update();*/ $wpmp_obj3->product_add_update(); } } } else { if (isset($_POST['add_product_sub'])) { /*$wk_pro_p=MP_Form_Handler::product_add_update();*/ $wk_pro_p = $wpmp_obj3->product_add_update(); $wk_pro_id = $wk_pro_p[0]; } } /*MP_Form_Handler::marketplace_media_fix($post_id);*/ $wpmp_obj3->marketplace_media_fix(); $product_auth = $wpdb->get_var("select post_author from {$wpdb->posts} where ID='" . $wk_pro_id . "'"); if (isset($wk_pro_id) && $product_auth == $user_id) { $post_row_data = $wpdb->get_results("select * from {$wpdb->posts} where ID=" . $wk_pro_id); $postmeta_row_data = get_post_meta($wk_pro_id); /*$product_images= MP_Form_Handler::get_product_image($wk_pro_id,'_thumbnail_id');*/ $product_images = $wpmp_obj3->get_product_image($wk_pro_id, '_thumbnail_id'); $meta_arr = array(); foreach ($postmeta_row_data as $key => $value) { $meta_arr[$key] = $value[0]; } $product_attributes = get_post_meta($wk_pro_id, '_product_attributes', true); $display_variation = 'no'; if (!empty($product_attributes)) { foreach ($product_attributes as $variation) { if ($variation['is_variation'] == 1) { $display_variation = 'yes'; } } } /*$image_gallary=MP_Form_Handler::get_product_image($wk_pro_id,'_product_image_gallery');*/ $image_gallary = $wpmp_obj3->get_product_image($wk_pro_id, '_product_image_gallery'); } ?> <h2><?php echo _e("Edit Product"); ?> </h2> <input type="hidden" name="var_variation_display" id="var_variation_display" value="<?php echo $display_variation; ?> " /> <ul id='edit_product_tab'> <li><a id='edit_tab'><?php echo _e("Edit"); ?> </a></li> <li><a id='inventorytab'><?php echo _e("Inventory"); ?> </a></li> <li><a id='attributestab'><?php echo _e("Attributes"); ?> </a></li> <li style="display:none;"><a id='avariationtab'><?php echo _e("Variations"); ?> </a></li> <li><a id='pro_statustab'><?php echo _e("Product Status"); ?> </a></li> </ul> <form action="" method="post" enctype="multipart/form-data" id="product-form"> <div class="wk_mp_container form" id="edit_tabwk"> <table> <tbody> <div class="product-type mp-toggle-sidebar"> <label for="product_type">Product Type:</label> <!-- <span class="mp-toggle-type-display"><?php if (isset($meta_arr['_simple']) && $meta_arr['_simple'] == 'yes') { echo 'Simple Product'; } if ($meta_arr['_downloadable'] == 'yes') { echo 'Downloadable Product'; } if ($meta_arr['_virtual'] == 'yes') { echo 'Virtual Product'; } ?> </span> --> <!-- <a class="mp-product-toggle-edit label label-success" href="javascript:void(0);">Edit</a> <div class="mp-toggle-select-type-container mp-hide" style="display:none;"> --> <select name="product_type" id="product_type" class="mp-toggle-select"> <?php $mp_product_type = $wpdb->get_results("select term.term_id,term.name from {$wpdb->prefix}terms as term join {$wpdb->prefix}term_taxonomy as wtt on wtt.term_id=term.term_id where wtt.taxonomy='product_type'"); $pro_term_relation = $wpdb->get_var("select wtr.term_taxonomy_id from {$wpdb->prefix}term_relationships as wtr join {$wpdb->prefix}term_taxonomy wtt on wtr.term_taxonomy_id=wtt.term_taxonomy_id where wtt.taxonomy='product_type' and wtr.object_id={$wk_pro_id}"); foreach ($mp_product_type as $pro_type) { if ($pro_type->name == 'external') { continue; } if ($pro_type->name == 'grouped') { continue; } ?> <option value="<?php echo $pro_type->name; ?> " <?php if ($pro_type->term_id == $pro_term_relation) { echo 'selected="selected"'; } ?> ><?php echo $pro_type->name; ?> </option> <?php } ?> </select> <!-- <a class="mp-toggle-type-save btn btn-default btn-sm" href="javascript:void(0);">OK</a> <a class="mp-toggle-type-cancel btn" href="javascript:void(0);">Cancel</a> </div> --> </div> <tr> <td><label for="product_name"><?php echo _e("Product Name"); ?> <span class="required">*</span> :</label></td> <td><input class="product_input" type="text" name="product_name" id="product_name" size="54" value="<?php if (isset($post_row_data[0]->post_title)) { echo $post_row_data[0]->post_title; } ?> " /> <div id="pro_name_error" class="error-class"></div> </td> </tr> <tr style="display:none;"> <td> <?php if (isset($wk_pro_id) && isset($_GET['page']) && $_GET['page'] == 'eProduct') { ?> <input type="hidden" value="<?php echo $wk_pro_id; ?> " name="sell_pr_id" id="sell_pr_id" /> <?php } ?> <td> </tr> <tr> <td><label for="product_desc"><?php echo _e("About Product"); ?> :</label></td> <td><?php $settings = array('media_buttons' => true, 'textarea_name' => 'product_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false); if (isset($post_row_data[0]->post_content)) { $content = $post_row_data[0]->post_content; } if (isset($content)) { echo wp_editor("{$content}", 'product_desc', $settings); } else { echo wp_editor("", 'product_desc', $settings); } ?> <div id="long_desc_error" class="error-class"></div> </td> </tr> <tr> <td><label for="product_category"><?php echo _e("Product Category"); ?> :</label></td> <td> <select multiple="true" name="product_cate[]" id="product_cate"> <?php /*MP_Form_Handler::mp_product_categories1(0,$wk_pro_id);*/ ?> <?php $wpmp_obj3->mp_product_categories1(0, $wk_pro_id); ?> </select> </td> </tr> <tr> <td><label for="fileUpload"><?php echo _e("Product Thumbnail"); ?> :</label></td> <td><?php if (isset($meta_arr['image'])) { ?> <img src="" width="50" height="50"> <?php } ?> <div id="product_image"> </div> <input type="hidden" id="product_thumb_image_mp" name="product_thumb_image_mp" value="<?php if (isset($meta_arr['_thumbnail_id'])) { echo $meta_arr['_thumbnail_id']; } ?> " /> <a class="upload mp_product_thumb_image btn" href="javascript:void(0);" /><?php _e('Upload Thumb'); ?> </a> <?php if (!empty($product_images)) { echo "<img style='display:inline;' src='" . content_url() . "/uploads/" . $product_images . "' width=50 height=50 />"; } ?> </td> </tr> <tr> <!-- <td><label for="product_sku"><?php /*echo _e("Product SKU");*/ ?> <span class="required">*</span> :</label></td> --> <td> <label for="product_sku"><?php echo _e("Product SKU"); ?> <span class="required">*</span>: <span class="help"> <div class="help-tip-sol"><?php echo _e("SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased."); ?> </div> <span class="help-tip">[?]</span> </span> </label> </td> <td><input class="product_input" type="text" name="product_sku" id="product_sku" value="<?php if (isset($meta_arr['_sku'])) { echo $meta_arr['_sku']; } ?> " /> <div id="pro_sku_error" class="error-class"></div></td> </tr> <?php /*if($pro_term_relation[0]->term_taxonomy_id!=4){*/ ?> <tr id="regularPrice"> <td><label for="regu_price"><?php echo _e("Regular Price"); ?> <span class="required">*</span> :</label></td> <td><input class="product_input" type="text" name="regu_price" id="regu_price" value="<?php if (isset($meta_arr['_regular_price'])) { echo $meta_arr['_regular_price']; } ?> " <?php echo $pro_term_relation == 4 ? 'disabled' : ''; ?> /> <div id="regl_pr_error" class="error-class"></div></td> </tr> <tr id="salePrice"> <td> <label for="sale_price"><?php echo _e("Sale Price"); ?> :</label> </td> <td><input class="product_input" type="text" name="sale_price" id="sale_price" value="<?php if (isset($meta_arr['_sale_price'])) { echo $meta_arr['_sale_price']; } ?> " <?php echo $pro_term_relation == 4 ? 'disabled' : ''; ?> /> <div id="sale_pr_error" class="error-class"></div></td> </tr> <?php /*}*/ ?> <tr> <td><label for="short_desc"><?php echo _e("Product Short Desc"); ?> :</label></td> <td><?php $settings = array('media_buttons' => true, 'textarea_name' => 'short_desc', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_class' => 'backend', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => false, 'drag_drop_upload' => true); if (isset($post_row_data[0]->post_excerpt)) { $short_content = $post_row_data[0]->post_excerpt; } if (isset($short_content)) { echo wp_editor("{$short_content}", 'short_desc', $settings); } else { echo wp_editor("", 'short_desc', $settings); } ?> <div id="short_desc_error" class="error-class"></div></td> </tr> </tbody> </table> </div> <div class="wk_mp_container" id="inventorytabwk"> <table> <tbody> <tr> <td> <label for="wk-mp-stock"><?php echo _e("Manage Stock?"); ?> :</label></td> <td> <label for="wk_stock_management" style="width: 100%;"> <input type="checkbox" class="wk_stock_management" id="wk_stock_management" name="wk_stock_management" value ="yes" <?php if (isset($meta_arr['_manage_stock']) && $meta_arr['_manage_stock'] == 'yes') { echo "checked"; } ?> /><?php _e("Enable stock management at product level"); ?> </label> </td> </tr> <tr> <td><label for="wk-mp-stock"><?php echo _e("Stock Qty"); ?> :</label></td> <td><input type="text" class="product_input" placeholder="0" name="wk-mp-stock-qty" id="wk-mp-stock-qty" value="<?php echo isset($meta_arr['_stock']) ? $meta_arr['_stock'] : ''; ?> " /></td> </tr> <tr> <td><label for="wk-mp-stock"><?php echo _e("Stock Status"); ?> :</label></td> <td> <select name="_stock_status" id="_stock_status" class="form-control"> <option value="instock" <?php if (isset($meta_arr['_stock_status']) && $meta_arr['_stock_status'] == 'instock') { echo 'selected="selected"'; } ?> ><?php _e("In Stock"); ?> </option> <option value="outofstock" <?php if (isset($meta_arr['_stock_status']) && $meta_arr['_stock_status'] == 'outofstock') { echo 'selected="selected"'; } ?> ><?php _e("Out of Stock"); ?> </option> </select> </td> </tr> <tr> <td><label for="wk-mp-backorders"><?php echo _e("Allow Backorders"); ?> :</label></td> <td> <select name="_backorders" id="_backorders" class="form-control"> <option value="no" <?php if (isset($meta_arr['_backorders']) && $meta_arr['_backorders'] == 'no') { echo 'selected="selected"'; } ?> ><?php echo _e("Do not allow"); ?> </option> <option value="notify" <?php if (isset($meta_arr['_backorders']) && $meta_arr['_backorders'] == 'notify') { echo 'selected="selected"'; } ?> ><?php echo _e("Allow but notify customer"); ?> </option> <option value="yes" <?php if (isset($meta_arr['_backorders']) && $meta_arr['_backorders'] == 'yes') { echo 'selected="selected"'; } ?> ><?php _e("Allow"); ?> </option> </select> </td> </tr> </tbody> </table> </div> <div class="wk_mp_container" id="attributestabwk"> <div class="input_fields_toolbar"> <button class="btn btn-success add-variant-attribute"><?php _e("+ Add an attribute"); ?> </button> <!--<button type="button" class="btn btn-default save_attributes" data-id="1347"><?php echo _e("Save attributes"); ?> </button> --> </div> <div class="wk_marketplace_attributes"> <?php if (!empty($product_attributes)) { $i = 0; foreach ($product_attributes as $proatt) { ?> <div class="wk_mp_attributes"> <div class="box-header attribute-remove"> <input type="text" class="mp-attributes-name" placeholder="Attribute name" name="pro_att[<?php echo $i; ?> ][name]" value="<?php echo str_replace('-', ' ', $proatt['name']); ?> "/><input type="text" class="option" title="attribue value by seprating comma eg. a|b|c" placeholder=" Value eg. a|b|c" name="pro_att[<?php echo $i; ?> ][value]" value="<?php echo $proatt['value']; ?> "/> <input type="hidden" name="pro_att[<?php echo $i; ?> ][position]" class="attribute_position" value="<?php echo $proatt['position']; ?> "/> <span class="mp_actions"> <button class="mp_attribute_remove btn btn-danger">Remove</button> </span> </div> <div class="box-inside clearfix"> <div class="wk-mp-attribute-config"> <div class="checkbox-inline"> <input id="wkmp_check1_<?php echo $i; ?> " type="checkbox" class="checkbox" name="pro_att[<?php echo $i; ?> ][is_visible]" value="1" <?php if ($proatt['is_visible'] == '1') { echo "checked"; } ?> /><label for="wkmp_check1_<?php echo $i; ?> " style="width: 185px;">Visible on the product page</label></div> <div class="checkbox-inline"> <input id="product_att_varitioN_<?php echo $i; ?> " type="checkbox" class="checkbox" name="pro_att[<?php echo $i; ?> ][is_variation]" value="1" <?php if ($proatt['is_variation'] == '1') { echo "checked"; } ?> /><label for="product_att_varitioN_<?php echo $i; ?> ">Used for variations</label> </div> <input type="hidden" name="pro_att[<?php echo $i; ?> ][is_taxonomy]" value="<?php echo $proatt['taxonomy']; ?> "/> </div> <div class="attribute-options"></div> </div> </div> <?php $i++; } } ?> </div> </div> <!-- varication attribute of the product --> <div class="wk_mp_container" id="avariationtabwk"> <div id="mp_attribute_variations"> <?php echo $mp_obj->marketplace_attributes_variation($wk_pro_id); ?> </div> <div class="input_fields_toolbar_variation"> <button id="mp_var_attribute_call" class="btn btn-success "><?php _e("+ Add Variation"); ?> </button> <input type="hidden" id="new_added_variation" name="new_added_variation" value="0"> </div> </div> <div class="wk_mp_container" id="pro_statustabwk"> <?php if (get_option('wkmp_seller_allow_publish')) { ?> <div class="mp-sidebar-container"> <div class="mp_wk-post-status mp-toggle-sidebar"> <label for="post_status"><?php echo _e("Product Status:"); ?> </label> <span class="mp-toggle-selected-display"><?php if (isset($post_row_data[0]->post_status) && !empty($post_row_data[0]->post_status) && $post_row_data[0]->post_status == 'publish') { echo 'Online'; } else { echo 'draft'; } ?> </span> <a class="mp-toggle-sider-edit label label-success" href="javascript:void(0);" style="display: inline;">Edit</a> <div class="mp-toggle-select-container mp-hide" style="display: none;"> <select id="product_post_status" class="mp-toggle-select" name="mp_product_status"> <option value="">Select status</option> <option value="publish" <?php if ($post_row_data[0]->post_status == 'publish') { echo 'selected="selected"'; } ?> ><?php echo _e("Online"); ?> </option> <option value="draft" <?php if ($post_row_data[0]->post_status == 'draft') { echo 'selected="selected"'; } ?> ><?php echo _e("Draft"); ?> </option> </select> <a class="mp-toggle-save btn btn-default btn-sm" href="javascript:void(0);">OK</a> <a class="mp-toggle-cancel btn" href="javascript:void(0);">Cancel</a> </div> </div> </div> <?php } ?> <div class="wk-mp-side-head"> <label class="checkbox-inline"> <input type="checkbox" id="_ckdownloadable" name="_ckdownloadable" value="yes" <?php if (isset($meta_arr['_downloadable']) && $meta_arr['_downloadable'] == 'yes') { echo 'checked'; } ?> /> <?php _e("Downloadable Product", "marketplace"); ?> </label> </div> <div class="wk-mp-side-body" style="display:<?php if (isset($meta_arr['_downloadable']) && $meta_arr['_downloadable'] == 'yes') { echo 'block'; } else { echo 'none'; } ?> " > <?php $mp_dwonloadable_file = get_post_meta($wk_pro_id, '_downloadable_files', true); $mp_download = array(); if (!empty($mp_dwonloadable_file)) { foreach ($mp_dwonloadable_file as $key => $value) { $mp_download[] = $value; } } ?> <ul class="list-unstyled " style="list-style:none;"> <li class="form-group"> <table class="table table-condensed"> <tr> <td> <p> <label><?php echo _e('File Name:', 'marketplace'); ?> </label> <input type="text" class="input_text" placeholder="File Name" id='user_downloadable_file_name' name="user_downloadable_file_name" value="<?php if (isset($mp_download[0]['name'])) { echo $mp_download[0]['name']; } ?> "/> </p> <p> <label><?php echo _e('File URL :', 'marketplace'); ?> </label> <input type="text" class="input" placeholder="http://" id="upload_downloadable_file_url" name="upload_downloadable_file_url" value="<?php if (isset($mp_download[0]['file'])) { echo $mp_download[0]['file']; } ?> "/> </p> <p> <!-- <input type="file" class="upload_downloadable_file_type" name="wk_mp_product_downloadable" style="display:none" /> --> <a href="javascript:void(0);" class="btn btn-sm btn-default upload_file_button upload_downloadable_file">Choose file</a> <a href="#" class="btn btn-sm btn-danger delete"> <span>Delete</span> </a> </p> </td> </tr> </tbody> </table> </li> <li class="form-group"> <div class="input-group"> <span class="input-group-addon">Limit</span> <input type="text" name="_download_limit" id="_download_limit" value="<?php if (isset($meta_arr['_download_limit'])) { echo $meta_arr['_download_limit']; } ?> " class="form-control" placeholder="Download Limit. e.g: 4"/> </div> </li> <li> <div class="input-group"> <span class="input-group-addon">Expiry</span> <input type="text" name="_download_expiry" id="_download_expiry" value="<?php if (isset($meta_arr['_download_expiry'])) { echo $meta_arr['_download_expiry']; } ?> " class="form-control" placeholder="Number of days"/> </div> </li> </ul> </div> <div class="wk-mp-side-head">Image Gallery</div> <div id="wk-mp-product-images"> <div id="product_images_container"> <?php if (isset($meta_arr['_product_image_gallery']) && $meta_arr['_product_image_gallery'] != '') { $image_id = explode(',', get_post_meta($wk_pro_id, '_product_image_gallery', true)); for ($i = 0; $i < count($image_id); $i++) { $image_url = wp_get_attachment_image_src($image_id[$i]); echo "<div class='pro_image_gallary'><img src='" . $image_url[0] . "' width=50 height=50 />"; ?> <ul class="actions" style="list-style:none;"> <li> <a href="javascript:void(0);" id="<?php echo $wk_pro_id . 'i_' . $image_id[$i]; ?> " class="mp-img-delete_gal" title="Delete image">Delete</a> </li> </ul> </div> <?php } } ?> </div> <div id="handleFileSelectgalaray"> </div> <input type="hidden" class="product_input" name="product_image_Galary_ids" id="product_image_Galary_ids" value="<?php if (isset($meta_arr['_product_image_gallery'])) { echo $meta_arr['_product_image_gallery']; } ?> " /> </div> <a href="javascript:void(0);" class="add-mp-product-images btn">+ Add product images</a> </p> <?php wp_nonce_field('marketplace-edid_product'); ?> </div> <input type="submit" name="add_product_sub" id="add_product_sub" value="Update" class="button"/></td> </form> <?php unset($_POST); }