/
Installation bzw. Deinstallationsanweisungen
Installation bzw. Deinstallationsanweisungen
Nach den Kerninformationen des Plugins folgen die Elemente "db_install" und "db_uninstall". Der php-Code innerhalb dieser Elemente wird bei der Installation bzw. Deinstallation des Plugins ausgeführt. Sollte Ihr Plugin z.B. die Datenbank erweitern müssen, wäre dies der richtige Ort, um die entsprechenden Querys via php auszuführen. Die Installations- bzw. Deinstallationsanweisungen werden bei der Plugininstallation in die Tabelle _plugin_sql eingelesen:
xt_customersdiscount.xml
<db_install><![CDATA[ if (!$this->_FieldExists('customers_status_discount_flag',TABLE_CUSTOMERS_STATUS)) $db->Execute("ALTER TABLE ".TABLE_CUSTOMERS_STATUS." ADD `customers_status_discount_flag` INT( 1 ) NOT NULL DEFAULT '0';"); if (!$this->_FieldExists('customers_discount',TABLE_CUSTOMERS_STATUS)) $db->Execute("ALTER TABLE ".TABLE_CUSTOMERS_STATUS." ADD `customers_discount` VARCHAR( 64 ) NOT NULL;"); if (!$this->_FieldExists('group_discount_allowed',TABLE_PRODUCTS)) $db->Execute("ALTER TABLE ".TABLE_PRODUCTS." ADD `group_discount_allowed` INT( 1 ) NOT NULL DEFAULT '1';"); ]]></db_install> <db_uninstall><![CDATA[ $db->Execute("ALTER TABLE ".TABLE_CUSTOMERS_STATUS." DROP `customers_status_discount_flag`, DROP `customers_discount`;"); if ($this->_FieldExists('group_discount_allowed',TABLE_PRODUCTS)) $db->Execute("ALTER TABLE ".TABLE_PRODUCTS." DROP `group_discount_allowed`"); ]]></db_uninstall>
, multiple selections available,
Related content
Installer XML-Datei
Installer XML-Datei
Read with this
Hookpunkte in der Installationsdatei
Hookpunkte in der Installationsdatei
Read with this
Dateiaufbau
Read with this
Includes in Hookpunkten
Includes in Hookpunkten
Read with this
Bestellungen Tabellen
Bestellungen Tabellen
Read with this
Plugin-Option: Checkbox
Plugin-Option: Checkbox
Read with this