相关疑难解决方法(0)

在Magento安装脚本中添加auto_increment列而不使用SQL

以前我问过如何在不使用SQL的情况下在Magento安装脚本中使用ALTER TABLE.在那里,伊万给出了一个很好的答案,我现在仍然提到这个答案.

但是,我还没有发现如何使用Varien_Db_Ddl_Table::addColumn()来指定auto_increment列.我认为这与被调用的选项有关,identity但到目前为止没有运气.

这甚至可能还是功能不完整?

installation auto-increment magento

14
推荐指数
2
解决办法
9342
查看次数

使用Magento中的订单保存额外数据

我必须在订单页面添加一列,这意味着要添加一列sales_flat_order_grid.这两个都是可能的,但我不知道如何添加一个值,以便它保存在我的新列中.

我是否也必须注册一个新属性?
该值不存在于报价中,因此我想我不需要注册,config/global/fieldsets/sales_convert_quote因为该值不是要转换的.

使用Magento Enterprise 1.8.

schema magento

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

Magento:如何将配置更改从开发环境迁移到生产环境?

我们正在积极开发模块,当我们将更改推送到生产站点时,通常需要进行一些配置更改.很高兴自动化这个...想法?

php deployment database-versioning magento e-commerce

7
推荐指数
2
解决办法
1726
查看次数

将新属性添加到Magento报价/订单


我正在开发自定义忠诚度积分模块.在结账时,客户可以选择兑换积分.
在模块设置中,我创建了一个redeem_points eav_attribute(它出现在eav_attribute表中),我已经将这个属性添加到了引用中,好吧,有点......
我是这样做的:

  • 在mysql4-install-0.1.0.php中我调用$ installer-> installEntities();
  • 在Namespace_Module_Model_Resource_Eav_Mysql4_Setup(扩展Mage_Eav_Model_Entity_Setup)中,只有一个方法公共函数getDefaultEntities()只返回一个包含(除其他外)的数组:

       'quote' => array(
            'entity_model'  => 'sales/quote',
            'table'         => 'sales/quote',
            'attributes'    => array(
                'redeemed_points'   => array('type' => 'static')
            ),
        ),
    
    Run Code Online (Sandbox Code Playgroud)
  • 再次在mysql4-install-0.1.0.php中我在sales_flat_quote表中创建了这个列,就像这样

       //add redeemed_points to quote table
       $installer->getConnection()->addColumn($installer->getTable('sales/quote'), 'redeemed_points', 'bigint(20)');
       $installer->addAttribute('quote', 'redeemed_points', array('type'=>'static'));
    
    Run Code Online (Sandbox Code Playgroud)

在结帐时,当我兑换积分时,我的类中扩展Mage_Checkout_Model_Type_Onepage的方法savePoints($ data)被调用:

public function savePoints($data)
{
    //save data
    if ($data == 1) {
        $redeemedPoints = Mage::helper('points')->getRedeemablePoints();
        $this->getQuote()->setRedeemedPoints($redeemedPoints['points']);
    } else {
        $this->getQuote()->setRedeemedPoints(0);
    }
    $this->getQuote()->collectTotals()->save();

    $this->getCheckout()
         ->setStepData('points', 'complete', true);
    if ($this->getQuote()->isVirtual()) {
        $this->getCheckout()->setStepData('payment', 'allow', true);
    } else {
        $this->getCheckout()->setStepData('shipping_method', 'allow', …
Run Code Online (Sandbox Code Playgroud)

attributes magento quote

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

Magento - 如何在结账过程中向订单添加发票费用

如何使用我的付款模块向订单添加发票费用?我想这应该在结账过程中通过我的付款方式模型完成.也许我应该创建一个项目/产品并添加到购物车/报价/订单对象?

我不知道如何做这些事情.请帮忙

php magento magento-1.4

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