# Freitextfelder in Bootstrap.php abfragen

**URL:** <https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765>\
**Category:** Programmierung\
**Created:** [30. Mai 2015 um 15:10 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765 "2015-05-30T15:10:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattes](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mattes](https://forum.shopware.com/u/Mattes)\
**Post date:** [30. Mai 2015 um 15:10 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/1 "2015-05-30T15:10:50Z")

</div>

Hallo Ich habe in Backend bei Grundeinstellung -\> Artikel -\> Artikel-Freitextfelder ein neues Checkbox hinzugefügt. Nun möchte ich diesen Checkbox in mein Bootstrap.php Datei mit IF Abfragen ob der Checkbox angeklickt ist oder nicht? Wie kann ich die Freitextfelder abfragen? `if ( ???? ) ` Gruß Mattes

---

<div class="post-metadata">

**Author:** ![madco-sven](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@madco-sven](https://forum.shopware.com/u/madco-sven)\
**Post date:** [30. Mai 2015 um 15:56 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/2 "2015-05-30T15:56:33Z")

</div>

Das ist ein ganz normales Attribute von einem Artikel, wie sieht denn deine bootstrap aus. ? Gruß Sven

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [30. Mai 2015 um 17:01 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/3 "2015-05-30T17:01:22Z")

</div>

Du müsstest dir den Artikel und die ID holen und dann entsprechend das attr abfragen. Also bspw: `$articleId = Shopware()-\>Front()-\>Request()-\>sArticle; $article = Shopware()-\>Modules()-\>Articles()-\>sGetArticleById($articleId); if ($article['attrX'] === 1) { do bla } else { do bla ....`

---

<div class="post-metadata">

**Author:** ![Mattes](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mattes](https://forum.shopware.com/u/Mattes)\
**Post date:** [30. Mai 2015 um 17:02 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/4 "2015-05-30T17:02:34Z")

</div>

Ist nur ein kleines Plugin Ich möchte nur in Themes Hinzufügen wenn mein Haken Aktiv ist. `if ($sArticle.meinCheckBox='true')` Ist das so richtig?

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [30. Mai 2015 um 17:03 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/5 "2015-05-30T17:03:24Z")

</div>

[quote=“Mattes”]Ist nur ein kleines Plugin Ich möchte nur in Themes Hinzufügen wenn mein Haken Aktiv ist. `if ($sArticle.meinCheckBox='true')` Ist das so richtig?[/quote] Siehe meinen Post über dir 😉

---

<div class="post-metadata">

**Author:** ![Mattes](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mattes](https://forum.shopware.com/u/Mattes)\
**Post date:** [30. Mai 2015 um 17:04 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/6 "2015-05-30T17:04:02Z")

</div>

Danke kayyy Werde es gleich mal Testen

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [30. Mai 2015 um 17:07 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/7 "2015-05-30T17:07:04Z")

</div>

> [@Mattes](#):
>
> Danke kayyy Werde es gleich mal Testen

---

<div class="post-metadata">

**Author:** ![Mattes](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mattes](https://forum.shopware.com/u/Mattes)\
**Post date:** [31. Mai 2015 um 12:08 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/8 "2015-05-31T12:08:17Z")

</div>

Hallo Ich das jetzt mal getestet geht leider nicht ich habe die Abfrage so gemacht. `if ($article['meinCheckBox'] = true) {` und auch das probiert `if ($article['meinCheckBox']) {` geht auch leider nicht was mache ich falsch?

---

<div class="post-metadata">

**Author:** ![madco-sven](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@madco-sven](https://forum.shopware.com/u/madco-sven)\
**Post date:** [31. Mai 2015 um 18:09 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/9 "2015-05-31T18:09:05Z")

</div>

Poste doch mal deine bootstrap. Vielleicht verwendest du das falsche Event

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [31. Mai 2015 um 18:10 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/10 "2015-05-31T18:10:51Z")

</div>

[quote=„Mattes“]Hallo Ich das jetzt mal getestet geht leider nicht ich habe die Abfrage so gemacht. `if ($article['meinCheckBox'] = true) {` und auch das probiert `if ($article['meinCheckBox']) {` geht auch leider nicht was mache ich falsch?[/quote] Hast du überhaupt meinen Beitrag gelesen ? 🙂 Du musst das attrXX ( natürlich statt XX bspw. attr3 ) abfragen und nicht „meine checkbox“. Außerdem poste doch einfach mal deine Bootstrap.php wie schon mehrmals gefordert.

---

<div class="post-metadata">

**Author:** ![TeichDatensysteme](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@TeichDatensysteme](https://forum.shopware.com/u/TeichDatensysteme)\
**Post date:** [31. Mai 2015 um 22:37 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/11 "2015-05-31T22:37:00Z")

</div>

[quote=„Mattes“] ich habe die Abfrage so gemacht. `if ($article['meinCheckBox'] = true) {` [/quote] Nimm doch mal einen gültigen Vergleichsoperator wie ‚==‘, wenn die Datentypen feststehen auch mit ‚===‘ vergleichbar. Schöne Grüße, Niklas

---

<div class="post-metadata">

**Author:** ![benblub](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@benblub](https://forum.shopware.com/u/benblub)\
**Post date:** [1. Juni 2015 um 02:34 UTC](https://forum.shopware.com/t/freitextfelder-in-bootstrap-php-abfragen/27765/12 "2015-06-01T02:34:20Z")

</div>

oder einfach… if ($article[‚meinCheckBox‘]) { mach was… }
