相关疑难解决方法(0)

Magento Module安装SQL未运行

我写了一个模块,它拒绝在我的mysql4-install-1.0.0.php文件中创建表格的空白....但只在实时服务器上.

有趣的是,在我的本地计算机(它是实时服务器的镜像(即相同的文件结构等))上,安装正确运行并创建表.

所以基于文件是相同的事实,我可以假设它是服务器配置和/或权限问题?我到处寻找,我发现任何日志文件(PHP,MySQL,Apache,Magento)都没有问题.

我可以在测试脚本中创建表格(使用core_read/write).

有谁看过这个吗?

谢谢

**编辑**两个环境之间的一个主要区别是,在实时服务器上MySQL是远程的(不是localhost).开发服务器是localhost.这会引起问题吗?

mysql install magento

4
推荐指数
1
解决办法
6570
查看次数

Magento - 创建新的客户属性

我需要在我的magento商店中创建4个新的客户属性.我已经创建了一个模块,如下所示:

Customerattribute >
    etc > config.xml
    Model > Mysql4 > Setup.php
    sql > customerattribute_setup > mysql4-install-0.0.1.php
Run Code Online (Sandbox Code Playgroud)

config.xml中

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Custom_Customerattribute>
      <version>0.0.1</version>
    </Custom_Customerattribute>
  </modules>
    <global>
        <resources>
            <customerattribute_setup>
                <setup>
                    <module>Custom_Customerattribute</module>
                    <class>Custom_Customerattribute_Model_Mysql4_Setup</class>
                </setup>
                ....
            </customerattribute_setup>
        </resources>
    </global>
</config>
Run Code Online (Sandbox Code Playgroud)

Setup.php

class Custom_Customerattribute_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup 
{
    /**
     * This method returns true if the attribute exists.
     * 
     * @param string|int $entityTypeId
     * @param string|int $attributeId
     * @return bool
     */
    public function attributeExists($entityTypeId, $attributeId) 
    {
        try 
        {
            $entityTypeId = $this->getEntityTypeId($entityTypeId);
            $attributeId = $this->getAttributeId($entityTypeId, …
Run Code Online (Sandbox Code Playgroud)

attributes module magento

4
推荐指数
1
解决办法
2万
查看次数

错误:并非所有产品都以所需数量提供!! 这是什么意思?

我在尝试在购物车中提交订单时收到此错误:并非所有产品都以请求的数量提供

我已经将数量设置为1000并且有库存...我刚刚安装了magento和其他一些扩展,所以我做错了,

debugging development-environment magento

2
推荐指数
1
解决办法
6175
查看次数

从magento模块创建一个新表

我正在尝试拥有一个管理模块,我正在努力在数据库中创建一个新表.我已经设置了什么

应用程序/代码/本地/富/酒吧/ SQL/mysql4安装,0.1.0.php

<?php
  $installer = $this;
  $installer->startSetup();

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

    CREATE TABLE {$this->getTable('notes')} (
      `ppr_id` int(11) NOT NULL AUTO_INCREMENT,
      `notesku` bigint(20) NOT NULL,
      `notestatus`  smallint(16),
      PRIMARY KEY (`notes`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8
  ");

  $installer->endSetup();
Run Code Online (Sandbox Code Playgroud)

这在app/code/local/Foo/BAR/etc/config.xml中

<?xml version="1.0"?>
<config>
    <modules>
        <Foo_BAR>
            <version>0.1.0</version>
        </Foo_BAR>
    </modules>    

    <global>
            <models>
                <BAR>
                    <class>Foo_BAR_Model</class>
                    <resourceModel>BAR_mysql4</resourceModel>
                </BAR>

                <BAR_myslq4>
                    <class>Foo_BAR_Model_Mysql4</class>
                    <entities>
                        <BAR>
                            <table>notes</table>
                        </BAR>
                    </entities>
                </BAR_myslq4>           
            </models>

            <resources>
                <BAR_setup>
                    <setup>
                        <module>Foo_BAR</module>
                    </setup>
                    <connection>
                        <use>core_setup</use>
                    </connection>
                </BAR_setup>
                <BAR_write>
                    <connection>
                        <use>core_write</use>
                    </connection>
                </BAR_write>
                <BAR_read>
                    <connection>
                        <use>core_read</use>
                    </connection> …
Run Code Online (Sandbox Code Playgroud)

php mysql database magento

2
推荐指数
1
解决办法
1万
查看次数

使用我的新magento模块后:SQLSTATE [42S02]:找不到基表或视图:1146表XXX

SQLSTATE [42S02]:找不到基表或视图:1146表'desbest_full2.showdown_matches'不存在

但是,如果我内部有一个mysql安装脚本,为什么呢 app/code/local/Desbest/Showdown/sql/Showdown_setup/mysql4-install-1.php

<?php
echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n"; die("Exit for now");

$installer = $this;
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
$installer->startSetup();
$installer->run("

    CREATE TABLE {$this->getTable('showdown_matches')} (
    --CREATE TABLE IF NOT EXISTS `showdown_matches` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `firstproductid` int(11) NOT NULL,
      `secondproductid` int(11) NOT NULL,
      `title` varchar(255) NOT NULL,
      `datenumber` varchar(10) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8_general_ci AUTO_INCREMENT=1 ;

    CREATE TABLE IF NOT EXISTS `showdown_votes` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `matchid` …
Run Code Online (Sandbox Code Playgroud)

magento

2
推荐指数
1
解决办法
2569
查看次数