Bis ich da auf modul Ebene bei Isotope richtig durchblicke und detailliert auf Fehlersuche gehen kann, spiele ich in der Zwischenzeit als Übergangslösung mit dem Gedanken die Mehrwertsteuer einfach im Template zu berechnen. Für meine Zwecke wäre das sowieso ausreichend.
Hier die teilweise Ausgabe der Template variablen des iso_collection Templates.
Wie komme ich an die Zahlenwerte von der Summe heran? um sie dann mit 0.19 zu multiplizieren?
Nun ja, davon halte ich in der Regel nichts, bloß um einen Fehler zu umgehen, der vermutlich nicht nicht mit dem Modul, sondern mit der Konfiguration zu tun hat.
Na okay, Du bist der Boss Deiner Webseite. Im Template wird ja [subtotal] ausgegeben. Das Array-Element ist allerdings protected bzw. hat´s vom Objekt geerbt .... beachte diesen Thread bei Github, insbesondere das vorletzte Posting.
https://community.contao.org/de/show...satz-protected
Oder falls Du mit den Einzelpreisen rechnen willst, machst Du es mit Hilfsvariablen im foreach und die Endberechnung danach unten.
Doch bevor Du nun zu derlei Verzweiflungstaten schreitest - ich hab in Deinem Codeblock mit der Template-Variablenausgabe alles rot markiert und kommentiert, wo wahrscheinlich die Fehler zu verorten sind. Steuerfreie Produkte gibts in Deutschland nicht, kann ja nur falsch sein.
Geh den Codeblock bitte bis unten durch, damit Du keine Markierung übersiehst.
Zunächst aber erstmal noch dies hier:
Wenn ich Produktpreise einpflege gebe ich die Brutto Preise ein und wähle bei Steuerklasse "Steuerklasse im Produktpreis enthalten" "Steuersatz Deutschland 19%".
Ja, klingt doch gut. Bloß, was sehen wir in Deinem Screenshot. Wir sehen, dass wir nichts sehen. Die im Produktpreis enthaltene Steuerklasse nicht gewählt und die Checkbox zum Hinzufügen des Steuersatzes nicht angehakt. Was wohl auch ohne vorherige Steuerklassenwahl garnicht ginge.
Code:
Array
(
[items] => Array
(
...
)
[total_tax_ids] => 1
[id] => 49
[collection] => Isotope\Model\ProductCollection\Cart Object
(
[strHash:protected] =>
[objDraftOrder:protected] =>
[arrCache:protected] => Array
(
[subtotal] => 399
[total] => 399
[taxFreeSubtotal] => 399
[taxFreeTotal] => 399
Wieso denn steuerfrei? So kann natürlich auch nichts ausgegeben werden.
Siehe weiter unten im Produkt bereits dasselbe. Wenn die Produkte steuerfrei sind,
dann die Rechnungssumme natürlich ebenfalls. Du musst in den Produkten
den richtigen Steuersatz zuweisen.
)
[arrItems:protected] => Array
(
[350] => Isotope\Model\ProductCollectionItem Object
(
[objProduct:protected] => Isotope\Model\Product\Standard Object
(
[objPrice:protected] => Isotope\Collection\ProductPrice Object
(
[strTable:protected] => tl_iso_product_price
[intIndex:protected] => 0
[arrModels:protected] => Array
(
[0] => Isotope\Model\ProductPrice Object
(
[arrTiers:protected] => Array
(
[1] => 399.00
)
[arrData:protected] => Array
(
[id] => 5
[pid] => 8
[tstamp] => 1441023869
[tax_class] => 2
[config_id] => 0
Merke: Enthält die Datensatz-Id der Shopkonfiguration, Deine gültige ist also die 0.
(siehe unten - TaxRate Object)
[member_group] => 0
[start] =>
[stop] =>
[tier_keys] => 1
[tier_values] => 399.00
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[pid] => Array
(
[table] => tl_iso_product
[field] => id
[type] => belongsTo
[load] => lazy
)
[tax_class] => Array
(
[table] => tl_iso_tax_class
[field] => id
[type] => hasOne
[load] => lazy
)
[config_id] => Array
(
[table] => tl_iso_config
[field] => id
[type] => hasOne
[load] => lazy
)
[member_group] => Array
(
[table] => tl_member_group
[field] => id
[type] => hasOne
[load] => lazy
)
)
[arrRelated:protected] => Array
(
[pid] => Isotope\Model\Product\Standard Object
*RECURSION*
[tax_class] => Isotope\Model\TaxClass Object
(
[arrData:protected] => Array
(
[id] => 2
[tstamp] => 1440961956
[name] => Deutschland
[fallback] => 1
[includes] => 0
[label] =>
[rates] => a:1:{i:0;s:1:"2";}
Welche Steuersätze dieser Steuerklasse zugewiesen wurden, kann man hier nicht sehen,
da ein BLOB-Feld. Aber in der Konfiguration sieht man´s natürlich.
[applyRoundingIncrement] =>
[notNegative] =>
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[includes] => Array
(
[table] => tl_iso_tax_rate
[field] => id
[type] => hasOne
[load] => eager
)
[rates] => Array
(
[table] => tl_iso_tax_rate
[field] => id
[type] => hasMany
[load] => lazy
)
)
[arrRelated:protected] => Array
(
[includes] =>
[rates] => Contao\Model\Collection Object
(
[strTable:protected] => tl_iso_tax_rate
[intIndex:protected] => -1
[arrModels:protected] => Array
(
[0] => Isotope\Model\TaxRate Object
(
[arrData:protected] => Array
(
[id] => 2
[tstamp] => 1440961721
[name] => Deutschland
[label] => 19 % MwSt.
[address] => a:1:{i:0;s:7:"billing";}
[countries] =>
[subdivisions] =>
[postalCodes] =>
[rate] => a:2:{s:4:"unit";s:1:"%";s:5:"value";s:2:"19";}
[amount] => a:2:{i:0;s:0:"";i:1;s:0:"";}
[config] => 3
Dies dürfte vermutlich falsch sein.
Das gleichnamige Feld "config" muss die
Datensatz-Id der Shopkonfiguration enthalten, welche diesen
Steuersatz verwendet. Demnach die id 0 bei derzeitiger
Konfiguration (siehe oben). Weil der erste Datensatz, also
wahrscheinlich die Standardkonfiguration.
[stop] =>
[guests] =>
[protected] =>
[groups] =>
[exemptOnValidVAT] =>
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[pid] => Array
(
[table] => tl_iso_tax_class
[field] => id
[type] => belongsTo
[load] => lazy
)
[config] => Array
(
[table] => tl_iso_config
[field] => id
[type] => hasOne
[load] => lazy
)
[groups] => Array
(
[table] => tl_member_group
[field] => id
[type] => hasMany
[load] => lazy
)
)
[arrRelated:protected] => Array
(
)
[blnPreventSaving:protected] =>
)
)
)
)
[blnPreventSaving:protected] =>
)
)
[blnPreventSaving:protected] =>
)
)
)
[arrAttributes:protected] => Array
(
[0] => verfuegbar
[1] => type
[2] => pages
[3] => alias
[4] => sku
[5] => name
[6] => teaser
[7] => description
[8] => price
[9] => images
[10] => shipping_weight
[11] => published
[12] => start
[13] => stop
)
[arrVariantAttributes:protected] => Array
(
)
[arrVariantIds:protected] =>
[arrCustomerConfig:protected] => Array
(
)
[arrCategories:protected] => Array
(
[all] => Array
(
[0] => 29
)
[published] => Array
(
[0] => 29
)
)
[strFormId:protected] => fmd10_product_8
[hasUpload:protected] =>
[doNotSubmit:protected] =>
[arrData:protected] => Array
(
[id] => 8
[pid] => 0
[gid] => 0
[tstamp] => 1441023920
[language] => de
[dateAdded] => 1441023817
[type] => 1
[orderPages] => a:1:{i:0;s:2:"29";}
[inherit] =>
[alias] => TestProdukt
[sku] => 123456
[name] => Test Produkt 1
[teaser] =>
[description] =>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
[shipping_weight] => a:2:{s:4:"unit";s:2:"mg";s:5:"value";s:0:"";}
[images] =>
[groups] =>
[published] => 1
[start] =>
[stop] =>
[verfuegbar] => 1
[images_fallback] =>
[sorting] => 128
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[gid] => Array
(
[table] => tl_iso_group
[field] => id
[type] => hasOne
[load] => lazy
)
[type] => Array
(
[table] => tl_iso_producttype
[field] => id
[type] => hasOne
[load] => lazy
)
[pages] => Array
(
[table] => tl_page
[field] => id
[type] => hasMany
[load] => lazy
)
[groups] => Array
(
[table] => tl_member_group
[field] => id
[type] => hasMany
[load] => lazy
)
)
[arrRelated:protected] => Array
(
[type] => Isotope\Model\ProductType Object
(
[arrAttributes:protected] => Array
(
[0] => verfuegbar
[1] => type
[2] => pages
[3] => alias
[4] => sku
[5] => name
[6] => teaser
[7] => description
[8] => price
[9] => images
[10] => shipping_weight
[11] => published
[12] => start
[13] => stop
)
[arrVariantAttributes:protected] => Array
(
)
[arrData:protected] => Array
(
[id] => 1
[tstamp] => 1439167849
[name] => Controller
[class] => standard
[fallback] => 1
[description] =>
[prices] =>
[show_price_tiers] =>
[list_template] => iso_list_default
[reader_template] => iso_reader_default
[list_gallery] => 2
[reader_gallery] => 2
[attributes] => Array
(
[verfuegbar] => Array
(
[enabled] => 1
[name] => verfuegbar
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[position] => 0
)
[type] => Array
(
[name] => type
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 1
)
[pages] => Array
(
[name] => pages
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 2
)
[alias] => Array
(
[name] => alias
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 3
)
[sku] => Array
(
[enabled] => 1
[name] => sku
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[position] => 4
)
[name] => Array
(
[name] => name
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 5
)
[teaser] => Array
(
[enabled] => 1
[name] => teaser
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[position] => 6
)
[description] => Array
(
[enabled] => 1
[name] => description
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[position] => 7
)
[price] => Array
(
[enabled] => 1
[name] => price
[legend] => pricing_legend
[tl_class] =>
[mandatory] =>
[position] => 8
)
[images] => Array
(
[name] => images
[legend] => media_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 9
)
[shipping_weight] => Array
(
[enabled] => 1
[name] => shipping_weight
[legend] => shipping_legend
[tl_class] =>
[mandatory] =>
[position] => 10
)
[published] => Array
(
[name] => published
[legend] => publish_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 11
)
[start] => Array
(
[name] => start
[legend] => publish_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 12
)
[stop] => Array
(
[name] => stop
[legend] => publish_legend
[tl_class] =>
[mandatory] =>
[enabled] => 1
[position] => 13
)
[vergriffen] => Array
(
[enabled] =>
[name] => vergriffen
[legend] => general_legend
[tl_class] =>
[mandatory] =>
[position] => 14
)
[baseprice] => Array
(
[name] => baseprice
[legend] => pricing_legend
[tl_class] =>
[mandatory] =>
[position] => 15
)
[shipping_exempt] => Array
(
[name] => shipping_exempt
[legend] => shipping_legend
[tl_class] =>
[mandatory] =>
[position] => 16
)
[meta_title] => Array
(
[name] => meta_title
[legend] => meta_legend
[tl_class] =>
[mandatory] =>
[position] => 17
)
[meta_description] => Array
(
[name] => meta_description
[legend] => meta_legend
[tl_class] =>
[mandatory] =>
[position] => 18
)
[meta_keywords] => Array
(
[name] => meta_keywords
[legend] => meta_legend
[tl_class] =>
[mandatory] =>
[position] => 19
)
[protected] => Array
(
[name] => protected
[legend] => expert_legend
[tl_class] =>
[mandatory] =>
[position] => 20
)
[guests] => Array
(
[name] => guests
[legend] => expert_legend
[tl_class] =>
[mandatory] =>
[position] => 21
)
[cssID] => Array
(
[name] => cssID
[legend] => expert_legend
[tl_class] =>
[mandatory] =>
[position] => 22
)
)
[variants] =>
[variant_attributes] => Array
(
)
[force_variant_options] =>
[shipping_exempt] =>
[downloads] =>
)
[arrModified:protected] => Array
(
[attributes] => a:23:{s:10:"verfuegbar";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:10:"verfuegbar";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:0;}s:4:"type";a:6:{s:4:"name";s:4:"type";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:1;}s:5:"pages";a:6:{s:4:"name";s:5:"pages";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:2;}s:5:"alias";a:6:{s:4:"name";s:5:"alias";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:3;}s:3:"sku";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:3:"sku";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:4;}s:4:"name";a:6:{s:4:"name";s:4:"name";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:5;}s:6:"teaser";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:6:"teaser";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:6;}s:11:"description";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:11:"description";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:7;}s:5:"price";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:5:"price";s:6:"legend";s:14:"pricing_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:8;}s:6:"images";a:6:{s:4:"name";s:6:"images";s:6:"legend";s:12:"media_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:9;}s:15:"shipping_weight";a:6:{s:7:"enabled";s:1:"1";s:4:"name";s:15:"shipping_weight";s:6:"legend";s:15:"shipping_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:10;}s:9:"published";a:6:{s:4:"name";s:9:"published";s:6:"legend";s:14:"publish_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:11;}s:5:"start";a:6:{s:4:"name";s:5:"start";s:6:"legend";s:14:"publish_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:12;}s:4:"stop";a:6:{s:4:"name";s:4:"stop";s:6:"legend";s:14:"publish_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:7:"enabled";s:1:"1";s:8:"position";i:13;}s:10:"vergriffen";a:6:{s:7:"enabled";s:0:"";s:4:"name";s:10:"vergriffen";s:6:"legend";s:14:"general_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:14;}s:9:"baseprice";a:5:{s:4:"name";s:9:"baseprice";s:6:"legend";s:14:"pricing_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:15;}s:15:"shipping_exempt";a:5:{s:4:"name";s:15:"shipping_exempt";s:6:"legend";s:15:"shipping_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:16;}s:10:"meta_title";a:5:{s:4:"name";s:10:"meta_title";s:6:"legend";s:11:"meta_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:17;}s:16:"meta_description";a:5:{s:4:"name";s:16:"meta_description";s:6:"legend";s:11:"meta_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:18;}s:13:"meta_keywords";a:5:{s:4:"name";s:13:"meta_keywords";s:6:"legend";s:11:"meta_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:19;}s:9:"protected";a:5:{s:4:"name";s:9:"protected";s:6:"legend";s:13:"expert_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:20;}s:6:"guests";a:5:{s:4:"name";s:6:"guests";s:6:"legend";s:13:"expert_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:21;}s:5:"cssID";a:5:{s:4:"name";s:5:"cssID";s:6:"legend";s:13:"expert_legend";s:8:"tl_class";s:0:"";s:9:"mandatory";s:0:"";s:8:"position";i:22;}}
[variant_attributes] =>
)
[arrRelations:protected] => Array
(
)
[arrRelated:protected] => Array
(
)
[blnPreventSaving:protected] =>
)
)
[blnPreventSaving:protected] =>
)
[arrDownloads:protected] =>
[arrErrors:protected] => Array
(
)
[blnLocked:protected] =>
[arrData:protected] => Array
(
[id] => 350
[pid] => 49
[tstamp] => 1441023993
[product_id] => 8
[type] => standard
[sku] => 123456
[name] => Test Produkt 1
[configuration] => a:0:{}
[quantity] => 1
[price] => 399.00
[tax_free_price] => 399.00
[tax_id] =>
Wo isser denn, der Wert von "tax_id"?
Hier sollte eigentlich die Id des Steuersatzes für dieses Produkt gespeichert sein.
Könnte das damit zu tun haben, dass im BE-Dropdown = [tax_free_price] der intiale
Eintrag "steuerfrei" belassen wurde, statt Auswahl des Steuersatzes "Deutschland".
[jumpTo] => 29
)
[arrModified:protected] => Array
(
)
[arrRelations:protected] => Array
(
[pid] => Array
(
[table] => tl_iso_product_collection
[field] => id
[type] => belongsTo
[load] => lazy
)
[product_id] => Array
(
[table] => tl_iso_product
[field] => id
[type] => hasOne
[load] => lazy
)
[jumpTo] => Array
(
[table] => tl_page
[field] => id
[type] => hasOne
[load] => lazy
)
)
[arrRelated:protected] => Array
(
...
)
[blnPreventSaving:protected] =>
)
)
[arrSurcharges:protected] => Array
(
)
Lesezeichen