小编tin*_*esh的帖子

如何在Magento客户地址模型中获取最后插入的ID

我正在保存customer_address_entity表中的客户地址.一切都好,但我想得到最后一次生成entity_id.有人能帮助我吗?

我有以下代码;

        $customAddress = Mage::getModel('customer/address');

         $customAddress->setData($_custom_address)
            ->setCustomerId($customer->getId())
            ->setIsDefaultBilling('0')
            ->setIsDefaultShipping('1')
            ->setSaveInAddressBook('1');

         try {
           $customAddress->save();
         } catch (Exception $ex) {
              Mage::log("\n Address save Error:: \n" . $ex->getMessage(), null, $this->log_entry_file);
       }
Run Code Online (Sandbox Code Playgroud)

magento

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

原型setAttribute()不使用$$()选择器

我想更改div内的按钮onclick功能.HTML代码如下所示

<div class="buttons-set" id="payment-buttons-container">
    <button type="button" class="button" onclick="payment.save()" id="payment_button"></button>
</div>
Run Code Online (Sandbox Code Playgroud)

我正在使用以下原型将onlick函数payment.save()更改为其他内容.

if(payment_method=='gate') {
   var e = $$('div#payment-buttons-container button.button');
   e.setAttribute('onclick','return false;'); // not working
} else {
    var e = $$('div#payment-buttons-container button.button');
    e.setAttribute('onclick','payment.save();'); // not working
}
Run Code Online (Sandbox Code Playgroud)

哪个不起作用并且说"Uncaught TypeError:Object [object HTMLButtonElement]没有方法'setAttribute'"但是当我通过静态获取按钮的id来使用此代码时

if(payment_method=='gate') {
    $('payment_button').setAttribute('onclick','return false;');// Works
}
else {
    $('payment_button').setAttribute('onclick','payment.save();');// Works
}
Run Code Online (Sandbox Code Playgroud)

其中"payment_button"是我拍摄的按钮的ID.

javascript prototypejs

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

卸载Magento扩展及其关联的数据库表和设置

我创建了Magento扩展.我已经安装并卸载了它.在卸载过程中,我发现,相关的数据库表没有被删除,而从设置core_config_datacore_resource.有人能帮助我吗?

magento

3
推荐指数
1
解决办法
8436
查看次数

从Magento的控制器内调用块功能

如何从Magento中的控制器调用块功能.

我有波纹管控制器:

法/结帐/控制器/ CartController.php

我想在这个CartController中调用波纹管块功能

法师/结算/块/车/ Shipping.php

我怎样才能做到这一点?

谢谢

magento

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

Magento管理员更改订单状态

如何手动更改Magento管理面板中的订单状态.有没有办法改变订单状态?我在1.7.0.2版本中找不到这个.谁能告诉我怎么做?

magento

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

标签 统计

magento ×4

javascript ×1

prototypejs ×1