H3XED

M2E Pro Adds Break <br /> And Paragraph <p> Tags To Description In Magento CE

Aug 4, 2014   Programming   Nick Vogt   Comments
Please note that this post is over a year old and may contain outdated information.
If you use Magento CE (Community Edition) M2E Pro extension to list and sync items with eBay, and your product descriptions contain HTML, you may find that it automatically adds in extra break and paragraph tags (<br /> and <p>). This can be very frustrating if you've already taken care of the breaks and paragraphs in HTML. Thankfully you can fix this functionality with a quick edit to an M2E Pro source PHP file.

It helps if you have experience with PHP or another programming language. If not, you can probably still manage.

To stop M2E Pro from adding break and paragraph tags, first navigation to the following directory in your Magento installation:

app/code/community/Ess/M2ePro/Helper/Module/Renderer/
Make a copy of the Description.php file and name it Description.php.original, so you have the original. Now download and open Description.php in a text editor (preferably something designed to edit code like NotePad++).

This Description.php file contains the class that is responsible for formatting the product description before it's sent to eBay. Scroll down until you find the line:

private function normalizeDescription($str)
This is the start of the block of code that adds the extra tags to your description. There's about 40 lines of code in this code block that you need to stop from running. The easiest way to do this is to add return $str; in near the top of the code block. This causes the method to return the result right away (before it adds anything to it).

This is what the top of the code block should look like once you're done:

private function normalizeDescription($str)
{
    return $str;

Leave the rest of the code block alone.

If you update or reinstall the M2E Pro extension, you will probably have to redo this edit.
Share This Post
Twitter
Learning Magento
Magento Beginner's Guide
Magento Beginner's Guide
See More Details
Magento SEO
Magento SEO
See More Details

Comments (0)

Share This Post
Twitter
Learning Magento
Magento Beginner's Guide
Magento Beginner's Guide
See More Details
Magento SEO
Magento SEO
See More Details
H3XED © Nick Vogt   RSS   Policies   Twitter