• Resolved den1xxx

    (@den1xxx)


    Hello.
    While using your plugin, I noticed an error that I could not quickly resolve. When generating a csv file feed, all “g:” inclusions are cut out in the text. The code in class-get-products.php is responsible for this.

                                          	if(($feed_config['fileformat'] == "csv") OR ($feed_config['fileformat'] == "txt")){
                                            	$v = str_replace("g:", "", $v);
                                         	}	

    I managed to fix it like this:

    if(($feed_config['fileformat'] == "csv") OR ($feed_config['fileformat'] == "txt")){
                                            	$v = str_replace("g: ", "^^^", $v);
                                            	$v = str_replace("g:", "", $v);
                                            	$v = str_replace("^^^", "g: ", $v);
                                         	}

    But this is wrong, as it creates unnecessary load.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Thanks for using our plugin and reaching out to us.

    Thats no bug, that is how it is intended. When you create a CSV feed for Google feeds they do not want to have the g: in front of the fields names like it is with XML feeds.

    Thread Starter den1xxx

    (@den1xxx)

    It’s clear. However, this is still a mistake. I have “Lieferumfang:”, “Wichtig:” (website in German) cut off ?g:? in the product description. If it was necessary to cut off 2 characters in front, it was necessary to do so, and not cut out all the characters in the text.
    Thanks for great plugin and fast reply.

    UPD
    Thank you, your answer cleared things up. I rewrote the code as it should.

    					// For CSV fileformat the keys need to get stripped of the g:
    					if(($feed_config['fileformat'] == "csv") OR ($feed_config['fileformat'] == "txt")){
    						$first_g = substr($v,0,2); 
    						if ($first_g =='g:') {
    							$v=substr($v,2);
    						}
    					}	
    • This reply was modified 3 years, 5 months ago by den1xxx.
    • This reply was modified 3 years, 5 months ago by den1xxx.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug with “g:”’ is closed to new replies.