0

I have thousands of products that include the following in the longDescription field:

<ul>
<li>Some content</li>
<li><a href="link"... </li>
</ul>

Several trailing line breaks...

I'm wondering if there is a safe and effective SQL query that can remove the <li>'s with the links in them, as well as the trailing line breaks / empty characters?

3
  • 2
    Does this have to be done in SQL? It might be easier to grab the data from the database, manipulate it in some general purpose language, then update the rows with the results. Commented Jul 12, 2012 at 21:13
  • You could try this solution: stackoverflow.com/questions/457701/… Commented Jul 12, 2012 at 21:14
  • I was thinking of doing it in ruby, as I'm no php expert, but the setup seemed longer than a quick SQL statement -- assuming someone knows one. Commented Jul 12, 2012 at 21:46

1 Answer 1

1

Best way might be to add a frontend model to the attribute. Create a model that extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract and remove the HTML in the getValue() function e.g. using strip_tags().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.