Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / how to deal with <p> characters as &lt;p&gt; in datafeed w easy populate?

how to deal with <p> characters as &lt;p&gt; in datafeed w easy populate?

Locked
This thread is locked. New replies are disabled.
15 Sep 2009, 6:22 PM
#1
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Post #1 by mk12

Supplier converted html tags into ascii characters in product descriptions in datafeed.
php converts these ascii codes into characters on the fly but for some reason html does not parse html tags after that.

For example the line below is in product description in mysql database: <p>An economical daily diet and balanced nutrition</p&gt
It is beeing displayed as <p>An economical daily diet and balanced nutrition</p> in product description on the website.

How to make html parse <p> tag in this case
Or may be there is a way to convert ascii in the database?

28 Sep 2009, 7:13 PM
#2
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Post #2 by mk12

Guys on experts-exchange forum suggested me to use htmlspecialchars() and html_entity_decode() functions to solve this problem.

The question is where in the code product description is being outputted, where do i need to put htmlspecialchars() and html_entity_decode() functions ?

28 Sep 2009, 7:45 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #3 by drbyte

You're using some sort of 3rd-party tool to load the data into your database. It's inside that tool that you need to do the decoding.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Sep 2009, 7:56 PM
#4
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Post #4 by mk12

I am using Eeasy Populate to load the data into the database.
I have received csv file with the data from the supplier with coded html tags and url in it.

28 Sep 2009, 8:03 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #5 by drbyte

Then you'll have to either get your supplier to not supply it with encoded tags, or write your own custom code in your easy populate to decode the data before it's inserted into the database.
If that's out of your skillsets, then you may want to post a request for paid help in the Commercial Help Wanted area.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Sep 2009, 9:07 PM
#6
needhelpasap avatar

needhelpasap

New Zenner

Join Date:
Sep 2009
Posts:
1
Plugin Contributions:
0

Post #6 by needhelpasap

zencart 1.3.8a, easy populate addon 1.2.5.5

Hey there any help is very much appreciated asap. So I uploaded the supplier datafeed through easy populate and the descriptions just read plain text right over what was in the csv file like the below example.

i need zen cart to automatically format this to html.
how do i change this througout the whole site 15,700 products or so all at once?

example:

<p>Our Sandwich Creme Cookies were created to make sure dogs are treated no differently than anyone else in the family&#046; Hands off&#033; These cookies are for dogs&#033; </p><p>Made with natural, kosher ingredients&#046; Free of animal proteins, parts, bi&#045;products and fillers&#046;</p><ul><li>8oz package</li></ul>