Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Sql code not executed
 
licentia
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2007-08-31
Portugal
 

Hi guys,

I’m building a shipping method. Everything goes fine, except the sql code execution.

No matter wat, it never gets executed.

Here is the config.xml file

<config>
<
modules>
    <
Mascker_Shipping>
      <
version>0.2.2</version>
    </
Mascker_Shipping>
  </
modules>

  <global>
    <
models>
      <
cttshipping>
        <class>
Mascker_Shipping_Model</class>
      </
cttshipping>
    </
models>
 
    <
resources>
      <
cttshipping_setup>
        <
setup>
          <
module>Mascker_Shipping</module>
        </
setup>
        <
connection>
          <use>
core_setup</use>
        </
connection>
      </
cttshipping_setup>
    </
resources>
  </global>

</
config>

The code structure is app/code/community/Mascker/Shipping/sql/mysql4-install-0.2.2.php

I’ve tried to use shipping instead cttshipping, but i guess it creates some conflict with the core system, because a get a weird error related tot he flat rate not being included.

$installer $this;
/* @var $installer Mage_Core_Model_Resource_Setup */

$installer->startSetup();

$installer->run("
             
DROP TABLE IF EXISTS `{
$this->getTable('mascker_shipping_ctt_zones')}`;

CREATE TABLE `{
$installer->getTable('mascker_shipping_ctt_zones')}` (
  `id` int(11) NOT NULL auto_increment,
  `peso_inicio` int(11) NOT NULL,
  `peso_fim` int(11) NOT NULL,
  `zona1` decimal(10,2) NOT NULL,
  `zona2` decimal(10,2) NOT NULL,
  `zona3` decimal(10,2) NOT NULL,
  `zona4` decimal(10,2) NOT NULL,
  `zona5` decimal(10,2) NOT NULL,
  `zona6` decimal(10,2) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

"
);

$installer->endSetup();
Tanks in advance for any help,
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top