Magento Contact Form Attachment Functionality

Would you like to have attachments in your contact form in Magento?

Do the following:

  1. Clone the zip of this github: https://github.com/yogisfunda/magento-contact-form-attachment
  2. Upload (merge) the files into the public_html directory
  3. Recompile/flush cache
  4. Go to your-site.com/contacts
  5. If the form does not changes or there’s a blank page, move the contents of the frontend/default part to frontend/base.

You can insert the form as a widget on a cms page by adding the following code:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="eurowsport/customform/customform.phtml"}}


Magento admin category tree shows no sub categories

Ever had that the category tree does not show specific subcategories that are present though?

Than follow these steps:

1. Make a backup for if anything goes wrong (running all the steps is on your own risk of course).

2. Run this query

SELECT c.entity_id, c.children_count as original_children_count, COUNT(c2.children_count) as `children_count`, c.level as original_level, (LENGTH(c.path)-LENGTH(REPLACE(c.path,'/',''))) as `level`
FROM catalog_category_entity c
LEFT JOIN catalog_category_entity c2 ON c2.path like CONCAT(c.path,'/%')
GROUP BY c.path

3. Check if there are still minus children_count categories with:

SELECT c.entity_id, c.children_count as original_children_count, COUNT(c2.children_count) as `children_count`, c.level as original_level, (LENGTH(c.path)-LENGTH(REPLACE(c.path,'/',''))) as `level`
FROM catalog_category_entity c
LEFT JOIN catalog_category_entity c2 ON c2.path like CONCAT(c.path,'/%')
GROUP BY c.path

If anything went right, it should show a + sign before the category in the category tree in the Magento admin again. Good luck

This error is likely caused by a category copy/duplicate plugin.

Thanks to: http://magento.stackexchange.com/questions/34730/not-showing-sub-categories-in-category-tree-in-manage-products-page