magefan / module-blog

Magento 2 Blog Extension is a solution that helps you to create a blog on Magento and manage posts,categories, tags, authors, and comments.
https://magefan.com/magento2-blog-extension
Other
265 stars 136 forks source link

Add support for importing comments from Wordpress #143

Closed sbodak closed 6 years ago

sbodak commented 6 years ago

Hi,

You can add support for import comments from Wordpress. Just simple run of sql:

// [Magefan\Blog](https://magefan.com/magento2-blog-extension)\Model\Import\Wordpress

INSERT INTO `magefan_blog_comment` (`comment_id`, `parent_id`, `post_id`, `status`, `author_type`, `author_nickname`, `author_email`, `text`, `creation_time`, `update_time`)
SELECT wp.`comment_ID`, wp.`comment_parent`, wp.`comment_post_ID`, wp.`comment_approved`, 0, wp.`comment_author`, wp.`comment_author_email`, wp.`comment_content`, wp.`comment_date`, wp.`comment_date`
FROM wp_comments AS wp 
INNER JOIN `magefan_blog_post` AS mbp on wp.`comment_post_ID`= mbp.`post_id`
WHERE wp.`comment_approved` != 'post-trashed'
magefan commented 6 years ago

Thank you @sbodak, we have added this feature to our backlog and will add it in feature releases.