Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Anfänger Frage / Variablen aus einem Array ausgeben...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
aschieferbein
Smarty n00b


Joined: 14 Jun 2013
Posts: 3

PostPosted: Fri Jun 14, 2013 9:52 am    Post subject: Anfänger Frage / Variablen aus einem Array ausgeben... Reply with quote

Hallo Leute,

ich hoffe ihr erschlagt mich nicht direkt, aber ich habe eine brutal Anfänger Frage bezüglich Smarty. Ich schreib gerade meine Diplomarbeit in Richtung responsiv Template für XTC, Pluginentwicklung etc. Muss halt viele verschiedene Dinge lernen und Smarty hat mich schon einiges an Nerven gekostet, zu mal die Debbug Funktion meiner localen XTC Version auch nicht richtig funtkionierte und ich laaange im dunkeln gefischt habe.. Lange Rede kurzer Sinn.

Code:

SESSION:

Array
(
    [agent_check] => true
    [customer] => customer Object
        (
            [customers_id] => 1
            [customers_status] => 2
            [customer_info] => Array
                (
                    [customers_id] => 1
                    [external_id] =>
                    [customers_cid] => 1
                    [customers_vat_id] => DE1434234134
                    [customers_vat_id_status] => 0
                    [customers_status] => 2
                    [customers_email_address] => a.schieferbein@cusatimedia.de
                    [account_type] => 0
                    [password_request_key] =>
                    [payment_unallowed] =>
                    [shipping_unallowed] =>
                    [date_added] => 0000-00-00 00:00:00
                    [last_modified] => 0000-00-00 00:00:00
                    [shop_id] => 1
                    [customers_default_currency] => EUR
                    [customers_default_language] => de
                    [campaign_id] => 35
                )


So sieht zum Beispiel ein Teil des Session Obj. von XTC in Smarty aus.

Wie kann ich z.B. [payment_unallowed] im Array [customer_info] zugreifen? Bzw. kann ich diese Daten ohne weiteres abändern?

Im groben, ich will z.B: den Warenkorb in XTC mit einigen Funktionen aufwerten, +/- Buttons für die Artikelmenge etc. Das erhöhen und vermindern der Produktmenge habe ich mit JQuery gelöst, nun würde ich halt sehr gern die neue Produktmenge via AJAX Request an der Server übergeben, so das der User nicht immer auf den Aktualisieren Button clicken muss damit sich die Produktmenge ändert. Gut die AJAX Geschichte werde ich mir als nächstes anschauen.

Aber es wäre wirklich wundervoll wenn mir jemand den Zugriff auf dieses Session Obj. erklären könnte. Ich wäre euch wirklich zu Dank verpflichtet.. Smile

mfG Andy...
Back to top
View user's profile Send private message
aschieferbein
Smarty n00b


Joined: 14 Jun 2013
Posts: 3

PostPosted: Fri Jun 14, 2013 10:03 am    Post subject: Laut http://www.smarty.net/docsv2/de/language.variables.tpl Reply with quote

Müsste ich ja zum Beispiel mit
Code:

{$smarty.session.customer.customer_info.customers_email_address}


Zugriff auf z.B: die Email Adresse erhalten.

Damit bekomme ich aber nur folgende Fehlermeldung

Code:
Fatal error: Cannot use object of type customer as array in C:\xampp\htdocs\shop2\templates_c\%%05^05E^05E5AA73%%cart.html.php on line 77
Back to top
View user's profile Send private message
aschieferbein
Smarty n00b


Joined: 14 Jun 2013
Posts: 3

PostPosted: Fri Jun 14, 2013 10:31 am    Post subject: Habe die Lösung gefunden... Reply with quote

Code:

{$smarty.session.customer->customer_info.customers_email_address}


Manch mal sieht man den Wald vor lauter Bäumen nicht..
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP