Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • amalksuresh

    (@amalksuresh)

    Hi,
    I Have the same issue on contact form updated site.
    I have been using custom theme . Contact form works good on 5.3. but now it’s showing eeror when there is validation error. But validation message ‘one or more field have error’ is not showing now.But sucess message is showing correctly.When seaching many user have problem with latest update. can you tell me what will be cause error message not showing on form submit.

    Thread Starter amalksuresh

    (@amalksuresh)

    edit menu order by specicing weight value

    // Add product new column in administration
    add_filter( 'manage_edit-product_columns', 'woo_product_weight_column', 20 );
    function woo_product_weight_column( $columns ) {
    
        $columns['sort_weight'] = esc_html__( 'Weight', 'woocommerce' );
            return $columns;
    
    }
    // Populate weight column
    add_action( 'manage_product_posts_custom_column', 'woo_product_weight_column_data', 2 );
    function woo_product_weight_column_data( $column ) {
        global $post;
    
        if ( $column == 'sort_weight' ) {
    			$postval = get_post( $post->ID);
    			$menu_order_new = $postval->menu_order;
    			
    	?>
    	<input type="text" name="menuorder" id="id_<?php echo $post->ID;?>" data-productid="<?php echo $post->ID;?>" value="<?php  echo $menu_order_new; ?>"  class="menuorder"/>
    	<?php     
        }
    }
    
    add_action('admin_head', 'my_column_width');
    
    function my_column_width() {
        echo '<style type="text/css">';
        echo 'table.wp-list-table .column-sort_weight { width: 101px; text-align: left!important;padding: 5px;}';
        echo 'table.wp-list-table .column-wpseo-score { width: 101px; text-align: left!important;padding: 5px;}';
        echo'.menuorder{ width: 101px; }';
        echo '</style>';
        
     
       
        
        
    }   
    
    // this code adds jQuery script to website footer that allows to send AJAX request
    add_action( 'admin_footer', 'misha_jquery_event' );
    function misha_jquery_event(){
     
    	echo "<script>jQuery(function($){
    	var weight_val;
    	var pr_id;
    		
    		
    		
    		 jQuery('.menuorder').on('input', function(){
    				weight_val = $(this).val();
    				pr_id=$(this).attr('data-productid');
    			var dataVariable = {
                'action': 'productmetasave', 
                'product_id': pr_id,
                'value':weight_val
                
                        };
    
            jQuery.ajax({
                url: ajaxurl, 
                type: 'POST',
                data: dataVariable, 
                success: function (response) {
                if(response==1){
                location.reload(true);
                }else{
    				 console.log('Failed To update menu-order ');
                }
                   
                }
            });
    				
    				
    				
    				
    		
    		});
    	});</script>";
     
    }
     
    // this small piece of code can process our AJAX request
    add_action( 'wp_ajax_productmetasave', 'misha_process_ajax' );
    function misha_process_ajax(){
     
    	
    	if($_POST['product_id'] && $_POST['value'] ){
    		
    		$arg=array('ID' => $_POST['product_id'],'menu_order' => $_POST['value']);
    			$rs = wp_update_post($arg);
    			if($rs){
    				echo "1";
    			}else{
    				echo "0";
    			}
    		}
     
    	die();
    }
    
    For bulk edit  below code will add same menu order for all product . Remember lower the menu order value ,item  order will be almost front.
    
    

    add_action( ‘woocommerce_product_bulk_edit_start’, ‘custom_field_product_bulk_edit’, 10, 0 );
    function custom_field_product_bulk_edit() {
    ?>
    <div class=”inline-edit-group”>
    <label class=”alignleft”>
    <span class=”title”><?php _e(‘Custom Sort Weight’, ‘woocommerce’); ?></span>
    <span class=”input-text-wrap”>
    <select class=”change_t_dostawy change_to” name=”change_t_dostawy”>
    <?php
    $options = array(
    ” => __( ‘— No change —’, ‘woocommerce’ ),
    ‘1’ => __( ‘Change to:’, ‘woocommerce’ ),
    );
    foreach ( $options as $key => $value ) {
    echo ‘<option value=”‘ . esc_attr( $key ) . ‘”>’ . $value . ‘</option>’;
    }
    ?>
    </select>
    </span>
    </label>
    <label class=”change-input”>
    <input type=”text” name=”_t_dostawy” class=”text t_dostawy” placeholder=”<?php _e( ‘Enter Weight Here ‘, ‘woocommerce’ ); ?>” value=”” />
    </label>
    </div>
    <?php
    }

    // Save the custom fields data when submitted for product bulk edit
    add_action(‘woocommerce_product_bulk_edit_save’, ‘save_custom_field_product_bulk_edit’, 10, 1);
    function save_custom_field_product_bulk_edit( $product ){
    if ( $product->is_type(‘simple’) || $product->is_type(‘external’) ){
    $product_id = method_exists( $product, ‘get_id’ ) ? $product->get_id() : $product->id;

    if ( isset( $_REQUEST[‘_t_dostawy’] ) ){
    // update_post_meta( $product_id, ‘menu_order’, sanitize_text_field( $_REQUEST[‘_t_dostawy’] ) );

    $arg=array(‘ID’ => $product_id,’menu_order’ => $_REQUEST[‘_t_dostawy’]);
    $result = wp_update_post($arg);

    }
    }
    }`

    Thread Starter amalksuresh

    (@amalksuresh)

    Hi After wp_footer has given in the footer. it shows only one common error in all the local sites I have tested. individual field errors are not shown as this ‘this Field’ is required. But don’t know why it’s happening. Also if I remove wp_footer then error messages are shown but the id of the contact form added to the URL. Is there any class that needs to add in the field wrapper to show an error? or any js event to be fired. This is a common doubt for me.

    Thread Starter amalksuresh

    (@amalksuresh)

    Hi Jesse,
    I have looked the FAQ section, I have done the same way . But CDN is url redirect is not working. I have checked the general option,CDN option is already enabled. Also I have upgrade plugin from 0.10.1 to the latest one . Will it cause any issue.

    Thread Starter amalksuresh

    (@amalksuresh)

    we have updated woocomerce to latest version and the checkout page was not get updated in theme result in error.

    amalksuresh

    (@amalksuresh)

    Code can be added in ur page template where u need to do the process.In my case its a part of footer where recent event should be listed.Use the code in ur page template.

    amalksuresh

    (@amalksuresh)

    I have the same problem .Can you provide the solution.

    amalksuresh

    (@amalksuresh)

    $args1 = array( ‘post_type’ => ‘tribe_events’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’);
    query_posts( $args1 );
    while ( have_posts() ) : the_post();
    the_title();
    endwhile;

    $args2 = array (‘post_type’ => ‘tribe_events’, ‘posts_per_page’ => 3,’orderby’=>’tribe_get_start_date’);

Viewing 9 replies - 1 through 9 (of 9 total)