dgrundel / woo-product-importer

A simple, free CSV importer for WooCommerce
199 stars 99 forks source link

Import adds a line break at the beginning of each line? #9

Closed bonnit closed 11 years ago

bonnit commented 11 years ago

as title says,

Everything is working perfect (and i mean PERFECT thank you!) but when i import it adds a line break (
) to each line in the description - not the end of the world but messy formatting, am i doing something wrong? or do you know of anyone else having this? Wasnt happening before and I've been using now for a while?

dgrundel commented 11 years ago

Hmmm. That's a tricky one. The plugin uses PHP's builtin CSV parser (the function fgetcsv) to read the contents of the CSV file. In the case of the product description, the data is put directly into the post with no processing or manipulation at all.

Do the extra line breaks appear in the post (product) editor in WP Admin, or only on the customer side of your website?

bonnit commented 11 years ago

Erm both. Ok so this product here:

The front end matches the description in the admin product description box.

Example can be found at: http://vintagebonbon.co.uk/product/aubergine-and-gold-rim-coffee-set/

This gorgeous 11 piece coffee set is stunning, the pretty unmarked set has a stripe of aubergine around the teapot, milk jug and sugar bowl with delicate gold floral patterns complete with a shiny gold tinted handle on the milk jug, teapot and the dinky handle on the sugar bowl.



The cute little set also has 4 shiny white cups and saucers with a thin delicate gold rim detail on them. A lovely set for anyone looking for a purple white coffee set.



Set contents:


4 x cups, 4 x saucers, 1 x milk, 1 x sugar pot with lid, 1 x teapot with lid



Sizes:


Cup Height: 6cm, Cup Diameter: 6.5cm


Saucer Diameter: 12cm


Milk Pot Height: 10cm, Milk pot Diameter: 6cm


Sugar pot Height: 6.5cm, Sugar pot Diameter: 7.5cm


Teapot Height: 17cm



This set is in very good condition, due to its age it has some slight fading to the purple patterned stripe. This looks to be part of the pattern and is only really noticeable on close inspection.

The first paragraph was put there with a previous version of your mod, I updated to the newest and after that added the remainder of the text, which has a
. The comma has also been replaced with its Unicode, which is not a problem but a result of a newer version


http://www.facebook.com/bonnie.hannah http://www.facebook.com/bonniehannah

http://www.facebook.com/VintageBonBon Facebook

Bonnie Dobbie

Twitter

Vintage Bon Bon - Hand crafted pretty vintage cake stands, plates, tea sets, bowls and beautiful fine china

http://www.linkedin.com/profile/view?id=63273654 LinkedIn

http://www.vintagebonbon.co.uk

From: Daniel Grundel [mailto:notifications@github.com] Sent: 15 February 2013 13:19 To: dgrundel/woo-product-importer Cc: bonnit Subject: Re: [woo-product-importer] Import adds a line break at the beginning of each line? (#9)

Hmmm. That's a tricky one. The plugin uses PHP's builtin CSV parser (the function fgetcsv) to read the contents of the CSV file. In the case of the product description, the data is put directly into the post with no processing or manipulation at all.

Do the extra line breaks appear in the post (product) editor in WP Admin, or only on the customer side of your website?

— Reply to this email directly or view it on GitHub https://github.com/dgrundel/woo-product-importer/issues/9#issuecomment-13606103 .

https://github.com/notifications/beacon/4pa7H-829YGfBwSabeHymQWk2ELCxxy4Rwf-G-DMrenbLCnjFZ2wRl1roXz1S18l.gif

dgrundel commented 11 years ago

Hmmm... that's interesting. Here's what I see when I view the source code for that page:

<p>This gorgeous 11 piece coffee set is stunning&#44; the pretty unmarked set has a stripe of aubergine around the teapot&#44; milk jug and sugar bowl with delicate gold floral patterns complete with a shiny gold tinted handle on the milk jug&#44; teapot and the dinky handle on the sugar bowl.</p>
<p>The cute little set also has 4 shiny white cups and saucers with a thin delicate gold rim detail on them. A lovely set for anyone looking for a purple white coffee set.</p>
<p>Set contents:<br />
<br />4 x cups&#44; 4 x saucers&#44; 1 x milk&#44; 1 x sugar pot with lid&#44; 1 x teapot with lid</p>
<p>Sizes:<br />
<br />Cup Height: 6cm&#44; Cup Diameter: 6.5cm<br />
<br />Saucer Diameter: 12cm<br />
<br />Milk Pot Height: 10cm&#44; Milk pot Diameter: 6cm<br />
<br />Sugar pot Height: 6.5cm&#44; Sugar pot Diameter: 7.5cm<br />
<br />Teapot Height: 17cm</p>
<p>This set is in very good condition&#44; due to its age it has some slight fading to the purple patterned stripe. This looks to be part of the pattern and is only really noticeable on close inspection.</p>

WordPress, as you may know, automatically does some formatting to your post_content (which is the field used to store your product description) by adding its own p tags and br tags where it deems appropriate.

If you go into the Text tab (HTML tab if you're on WP < v3.5) in the Product Editor in WP Admin, you should see your product description, completely unedited. Is that what you see? Or do you see p and br tags you don't expect?

dgrundel commented 11 years ago

OOOOOOOOoohhhh. I just looked again at the code I just posted. Now I see the double br tags.

Can you possibly send me your CSV file so I can take a peek at it?

bonnit commented 11 years ago

Sorry for the late reply. Im also using woo store export and im wondering if this problem has come from that instead, I cleaned up the formatting and imported and no problems so far?


http://www.facebook.com/bonnie.hannah http://www.facebook.com/bonniehannah

http://www.facebook.com/VintageBonBon Facebook

Bonnie Dobbie

Twitter

Vintage Bon Bon - Hand crafted pretty vintage cake stands, plates, tea sets, bowls and beautiful fine china

http://www.linkedin.com/profile/view?id=63273654 LinkedIn

http://www.vintagebonbon.co.uk

From: Daniel Grundel [mailto:notifications@github.com] Sent: 15 February 2013 16:45 To: dgrundel/woo-product-importer Cc: bonnit Subject: Re: [woo-product-importer] Import adds a line break at the beginning of each line? (#9)

OOOOOOOOoohhhh. I just looked again at the code I just post. Now I see the double br tags.

Can you possibly send me your CSV file so I can take a peek at it?

— Reply to this email directly or view it on GitHub https://github.com/dgrundel/woo-product-importer/issues/9#issuecomment-13615536 .

https://github.com/notifications/beacon/4pa7H-829YGfBwSabeHymQWk2ELCxxy4Rwf-G-DMrenbLCnjFZ2wRl1roXz1S18l.gif

dgrundel commented 11 years ago

Hi Bonnie,

No worries. Looks like you may have found the problem! I will close this issue for now. Let me know if you have any more trouble.