magento-hackathon / HoneySpam

Spam protection module for customer registration, product review form and contact form.
Open Software License 3.0
102 stars 36 forks source link

Hidden Field not included in the Newsletter #56

Closed Serjudo closed 5 years ago

Serjudo commented 5 years ago

I have made the hidden field appear in all forms except the newsletter.

The newsletter is shown on the page through footer.phtml with this command: <?php echo $this->getChildHtml('footer.newsletter') ?>

I copied the file subscribe.phtml in my theme and added the code <?php echo $this->getChildHtml('form_fields_before')?> inside the form, but the hidden field does not appear: https://desarrollopapelstore.factoriadigitalpremium.es

This same action I have done for the contact page and it works correctly: https://desarrollopapelstore.factoriadigitalpremium.es/contacts/

My version is 1.9.3.10 with all security patches installed. Is there a bug related to this?

Schrank commented 5 years ago

In our layout.xml file we create a reference on newsletter and add a block with the alias form_fields_before: https://github.com/magento-hackathon/HoneySpam/blob/master/app/design/frontend/base/default/layout/honeyspam.xml#L48-L52

Maybe your block's name is not newsletter?

Schrank commented 5 years ago

aka: This should work, because it is in <default>

Serjudo commented 5 years ago

Yes, I've been trying to modify that file without luck, but from what I've seen, my configuration should be supported without any modification, so I think there must be some problem with the module.

Schrank commented 5 years ago

Unfortunatly I can't debug your shop. Can you add <?php echo $this->getNameInLayout(); ?> and check wether it is newsletter?

Schrank commented 5 years ago

Stupid me. you are right.

https://github.com/magento-hackathon/HoneySpam/blob/master/app/design/frontend/base/default/layout/honeyspam.xml#L42-L46 footer_newsletter should work as well.

So if you add to newsletter/subscribe.phtml <?php echo $this->getChildHtml('form_fields_before')?> this should work.

We are happy for every PR if you find a problem. I think I can't you help you from here.

Serjudo commented 5 years ago

Don't worry about it.

I had already added in newsletter/subscribe.phtml the code <?php echo $this->getChildHtml('form_fields_before')?> and it doesn't work, that's why I opened the problem.

Schrank commented 5 years ago

I just wanted to make sure, we are on the same page :)

Good luck and if you have more questions, feel free to ask!

Serjudo commented 5 years ago

Thank you, I will continue to investigate, but if anyone can contribute any ideas, you will be welcome.