Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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 dieses der richtige Ort um die entsprechenden Querys via php auszuführen.

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>
  • No labels