Ich habe ein Magento-Modul auf Enterprise Edition, die ich erstellt habe, als ich es zuerst eingerichtet habe es funktioniert, keine Probleme was auch immer, jetzt habe ich wieder darauf zurückkommen, Magento wirft ein (404 nicht gefunden 2), Bevor es gut geklappt hat, hat sich nichts geändert, Berechtigungen haben weder den Code, noch einige Schnipsel unten, aber sie enthält einige grundlegende Paketinformationen, der Controller funktioniert nicht am Frontend, sondern am Backend-Controller Startet ohne Fehler.Magento-Modul wurde zufällig gestoppt
Paketname/Namensraum: Jejamescycles
Modulname: Finanzen
Codepool: Community
Aktiv: true
Die erste Datei - app/code/community/Jejamescycles/Finanzen/controllers/IndexController.php
<?php
class Jejamescycles_Finance_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_sales`
(
`sales_id` INT(11) NOT NULL AUTO_INCREMENT,
`sales_reference` VARCHAR(50) NOT NULL UNIQUE,
`customer_id` INT(11) NOT NULL ,
`products` TEXT NOT NULL ,
`total_price` VARCHAR(255) NOT NULL ,
`status` VARCHAR(4) NOT NULL ,
PRIMARY KEY(`sales_id`)
)");
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'v12content'
)
->setTemplate('v12_finance/index.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
private function _getCustomerSession() {
Mage::getSingleton('core/session', array('name' => 'frontend'));
return Mage::getSingleton('customer/session');
}
function successAction()
{
$reference = $_GET['REF'];
$sales_reference = $_GET['SR'];
$status = $_GET['Status'];
$auth = $_GET['Auth'];
$conn = Mage::getSingleton('core/resource')->getConnection('core/read');
$confirmed = 0;
if($status == 'A' || $status == 'S')
{
$confirmed = 1;
}
try{
$conn->query("UPDATE `v12_finance_sales` SET `confirmed` = '$confirmed' , `status` = '$status' WHERE `sales_reference` = '$sales_reference'");
$this->loadLayout();
$this->renderLayout();
}catch(Exception $e)
{
$fh = fopen("FINANCE_LOG.log" , "a+");
fwrite($fh , "ERROR[" . date('H:i:s d-m-Y') . ']:EXCEPTION:' . $e->getMessage());
fclose($fh);
$conn->query("CREATE TABLE IF NOT EXISTS `v12_finance_errors`
(
`error_id` int(11) not null AUTO_INCREMENT,
`sales_reference` VARCHAR(200) NOT NULL ,
`status` VARCHAR(4) NOT NULL ,
PRIMARY KEY(`error_id`)
)");
$conn->query("INSERT INTO `v12_finance_errors`
(
`sales_reference` ,
`status`
) VALUES (
'" . $sales_reference . "' ,
'$status'
)");
die("There was an error processing this request, please contact <a href='mailto:[email protected]'>Support</a> with this URL");
}
}
function basic_infoAction()
{
$conn = Mage::getSingleton('core/resource')->getConnection('core/read');
// $conn->query("ALTER TABLE `v12_finance_sales` ADD COLUMN `status` varchar(4) NOT NULL");
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
//not logged in
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/customer/account");
}else{
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'v12content'
)
->setTemplate('v12_finance/finance_setup.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
}
}
?>
Und die Datei config.xml:
<config>
<!-- ... -->
<frontend>
<routers>
<!-- the <helloworld> tagname appears to be arbitrary, but by
convention is should match the frontName tag below-->
<jejamescycles_finance>
<use>standard</use>
<args>
<module>Jejamescycles_Finance</module>
<frontName>jejamescycles_finance</frontName>
</args>
</jejamescycles_finance>
</routers>
</frontend>
<global>
<helpers>
<finance>
<!-- Helper definition needed by Magento -->
<class>Jejamescycles_Finance_Helper</class>
</finance>
</helpers>
<blocks>
<jejamescycles_finance>
<class>Jejamescycles_Finance_Block</class>
</jejamescycles_finance>
</blocks>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<jejamescycles_finance before="Mage_Adminhtml">Jejamescycles_Finance_Adminhtml</jejamescycles_finance>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<!-- ... -->
</config>
keine Umgebungsvariablen geändert haben, Das Modul selbst ist unabhängig und tut verlassen sich auf alle anderen Pakete, die ich nicht für das Leben von mir herausfinden können, warum ist es nicht Arbeiten. Ich habe auch die CMS-Seiten überprüft und es gibt keine Kollision von URL-Schlüsseln.