Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter l.tamburo

    (@ltamburo)

    If i fill in field name surname and email, for example name=Luca, [email protected]
    Name and surname fields are set as optional

    Thread Starter l.tamburo

    (@ltamburo)

    other error is default-lang when in option is saved as default_lang

    my fix
    /*
    * returns the default language
    */
    function pll_default_language($args = ‘slug’) {
    global $polylang;
    return !(isset($polylang) && ($options = get_option(‘polylang’)) && isset($options[‘default_lang’]) && $lang = $polylang->get_language($options[‘default_lang’])) ? false :
    ($args == ‘name’ ? $lang->name :
    ($args == ‘locale’ ? $lang->description :
    $lang->slug));
    }

    Have a nice day : )

    Hi there,
    I add this code

    //product attributes
    		if ($num > 17){
    			$prod_catt = array();
    			$catt_count = 0;
    			for ($i = 17; $i < $num; $i++){
    				$custom_field = explode(':', $data[$i]);
    		 		$custom_values = esc_html(stripslashes($custom_field[1]));
    		 		// Text based, separate by pipe
    		 		$custom_values = explode('|', $custom_values);
    		 		$custom_values = array_map('trim', $custom_values);
    		 		$custom_values = implode('|', $custom_values);
    
    			 	$prod_catt[ sanitize_title( $custom_field[0] ) ] = array(
    			 		'name'	=> htmlspecialchars(stripslashes($custom_field[0])),
    			 		'value' => $custom_values,
    			 		'position'	=> $catt_count,
    			 		'is_visible' 	=> 1,
    			 		'is_variation'	=> 0,
    			 		'is_taxonomy'	=> 0
    			 	);
    				$catt_count++;
    
    			}
    			$prod_catt = maybe_serialize($prod_catt);
    			update_post_meta( $post_id, '_product_attributes', $prod_catt);
    		}

    into function woocsv_import_products_from_csv before end of foreach( $content as $data ) {

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