0

I have 3 store view to my website and I want to have a part in my home page where the guest can evaluate my store (not the product) and the only authenticated customer can evaluate and save directly their opinion but not logged in will be redirected to the login page to save the evaluation. So how to do that thanks in advance

0

You build a custom module. Key important things to have are:

  1. The module exposes new entity named evaluation. This entity will be supported by its own model, resource model and collection. Among other things it will store customer_id so you know which customer did exactly which evaluation

  2. The module exposes a frontend block that basically has a form that will receive the evaluation. This could be a star rating, like 1-5 stars, plus maybe a text area for a general comment. This is up to you. But any inputs should be indeed combined into one form.

  3. The module has one frontend controller that accepts the request and process it. Of course all processing would happen if there is a logged in user in session.

  4. The module will have an admin grid that would list evaluations and calculate the average score.

Besides this essence, you could play around with a couple of extras:

  1. Send email to the administrator each time there is a new evaluation

  2. Allow multiple evaluations v.s. allow one time evaluations - this would be configuration

As far as module complexity, I'd say it is fairly simple module, unless you are new with Magento. But even if you are, this could be a very good opportunity to learn.

| improve this answer | |
  • thanks a lot for your replay !!! just one thing how to develop the rating stars in magento 2 thanks brother you saved me – Developper Magento Sep 4 '18 at 9:02
  • There are various ideas how to approach this. Try for example: youtube.com/watch?v=igSEEq8dHLg – Marjan Sep 4 '18 at 9:04
  • Do I have to do a join with customer entity or I can just get the customer id and then set it to the attribute customer_id in my new table evaluation ? – Developper Magento Sep 4 '18 at 9:04
  • I really appreciate your explanation very helpfull thanks a lot – Developper Magento Sep 4 '18 at 9:06
  • I'd go with the later: collect the customer_id from the session and store it to the attribute in your own table. Avoid amending the customer entity. And even avoid relations (like foreign keys) between the customer_entity table and the new custom one. – Marjan Sep 4 '18 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.