久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Magento - 向 sales_flat_quote_item 和 sales_flat_order_item

Magento - Adding a new column to sales_flat_quote_item and sales_flat_order_item(Magento - 向 sales_flat_quote_item 和 sales_flat_order_item 添加新列)
本文介紹了Magento - 向 sales_flat_quote_item 和 sales_flat_order_item 添加新列的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在使用 Magento 版本 1.4.1.1,我想在 sales_flat_quote_item 表中保存一個(gè)值(并將其傳遞給 sales_flat_order_item).

I'm working with Magento version 1.4.1.1, and I want to save a value in sales_flat_quote_item table (and pass it to sales_flat_order_item).

我找到了本教程,但我不確定它仍然相關(guān)(對于 Magento 版本 1.4.1.1),因?yàn)樗懻摿艘粋€(gè)名為 sales_order 的表,我認(rèn)為它現(xiàn)在是 sales_flat_order 并且看起來有點(diǎn)不同.

I've found this tutorial, but I'm not sure if it's still relevant (to Magento version 1.4.1.1) since it talks about a table called sales_order, which I believe is now sales_flat_order and looks a bit different.

這個(gè)方法還能用嗎?如果是這樣 - 我可以將它用于 sales_flat_quote_itemsales_flat_order_item 以及我應(yīng)該在推薦中放入什么 entity_type_id :

Should this method still work? If so - Can I use it for sales_flat_quote_item and sales_flat_order_item and what entity_type_id should I put in the commend :

`insert into eav_attribute('entity_type_id','attribute_code','attribute_model','backend_model','backend_type','backend_table','frontend_model','frontend_input','frontend_input_renderer','frontend_label','frontend_class','source_model','is_global','is_visible','is_required','is_user_defined','default_value','is_searchable','is_filterable','is_comparable','is_visible_on_front','is_html_allowed_on_front','is_unique','is_used_for_price_rules','is_filterable_in_search','used_in_product_listing','used_for_sort_by','is_configurable','apply_to','position','note','is_visible_in_advanced_search'  )  
values(11, 'my_new_column', null, '', 'static', '', '', 'text', '','',null, '', 1,1,1,0,'',0,0,0,0,0,0,1,0,0,0,1,'',0,'',0);`

如果在新的 Magento 版本中這不是這樣做的方法,我應(yīng)該怎么做?

If this is not the way to do that in the new Magento version, how should I do that?

謝謝,沙尼

推薦答案

  1. 使用從 Mage_Sales_Model_Mysql4_Setup 擴(kuò)展的自己的設(shè)置類創(chuàng)建一個(gè)新模塊,或者將其用作 config.xml 中的模塊設(shè)置類:

  1. Create a new module with own setup class extended from Mage_Sales_Model_Mysql4_Setup or just use it as module setup class in config.xml:

 <global>
     <resources>
         <your_module_setup>
              <setup>
                  <module>Your_Module</module>
                  <class>Mage_Sales_Model_Mysql4_Setup</class>
              </setup>
         </your_module_setup>
     </resources>
 </global>

  • 在設(shè)置腳本中使用 addAttribute($entity, $attributeCode, $options) 方法,它會(huì)自動(dòng)向 sales_flat_order 故事添加一個(gè)新列.其他實(shí)體也是如此.

  • Use addAttribute($entity, $attributeCode, $options) method inside of your setup script, it will automatically add a new column to sales_flat_order tale. The same for other entites.

    $installer = $this;
    $installer->startSetup();
    $installer->addAttribute(
        'order', 
        'your_attribute_code', 
        array(
            'type' => 'int', /* varchar, text, decimal, datetime */,
            'grid' => false /* or true if you wan't use this attribute on orders grid page */
        )
    );
    $installer->endSetup();
    

  • 這篇關(guān)于Magento - 向 sales_flat_quote_item 和 sales_flat_order_item 添加新列的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

    【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

    相關(guān)文檔推薦

    Override Magento Config(覆蓋 Magento 配置)
    What would cause a print_r and/or a var_dump to fail debugging a variable?(什么會(huì)導(dǎo)致 print_r 和/或 var_dump 調(diào)試變量失敗?)
    How to update custom options programatically in magento?(如何在 magento 中以編程方式更新自定義選項(xiàng)?)
    Magento 404 on Admin Page(管理頁面上的 Magento 404)
    Magento - get price rules from order(Magento - 從訂單中獲取價(jià)格規(guī)則)
    Magento Change Product Page Titles to Include Attributes(Magento 更改產(chǎn)品頁面標(biāo)題以包含屬性)
    主站蜘蛛池模板: 一区二区三区在线 | 一区精品国产欧美在线 | 精品自拍视频在线观看 | 九九导航 | 91视频大全 | 伊人色综合久久久天天蜜桃 | 日日综合 | 国产精品无码久久久久 | www.黄色在线观看 | 欧美视频免费在线 | 中文字幕高清免费日韩视频在线 | 91 久久| 天天操天天拍 | 成人黄色a| 成人欧美一区二区三区1314 | 亚洲黄色高清视频 | 国产精品精品久久久 | www.成人免费视频 | 在线免费黄色小视频 | www网站在线观看 | 亚洲毛片在线观看 | 久久99精品久久久久 | 亚洲精品在线看 | 亚洲嫩草 | 精品一区二区三区91 | 成人精品鲁一区一区二区 | 九九天堂网| 九九av| 精品日韩 | 99综合网 | 九九视频在线观看视频6 | 欧美日韩在线一区 | 久久69精品久久久久久久电影好 | 国产成视频在线观看 | 成人午夜免费视频 | 国产精品一区二区不卡 | 亚洲国产精品一区二区第一页 | h漫在线观看 | 狠狠干美女 | 秋霞精品 | 亚洲精品一区二区另类图片 |