問題描述
我在 Magento 中有一些簡單的目錄產品,所以我有它們的 SKU身份證件.現在我想使用數組元素bundle_options"& 創建一個捆綁產品.捆綁項目的bundle_selections",由 Magento Admin 在其觀察者類中編碼使用.
I have some simple catalog products in Magento, so I have their SKUs & IDs. Now I want to create a Bundled product using the array elements "bundle_options" & "bundle_selections" of the Bundle Items, which are used by the Magento Admin coding in its Observer Class.
同樣在Observer類中,還有兩個函數setBundleOptionsData()
"的方法調用&setBundleSelectionsData()
",我找不到任何函數定義.
Also in the Observer class, there are method calls of two functions "setBundleOptionsData()
" & "setBundleSelectionsData()
", for whose I am not able to find any function definition.
請在這里發布任何專業帖子,因為我需要一些正確的方法來做這件事.如果需要,覆蓋模塊或使用事件,我會做,但我需要非常專業的幫助.提前致謝.
Please any professional post here, because I need some proper way of doing this thing. If it needs, overriding modules or using events, I will do, but I need really professional help. Thanks in advance.
-
關于上面提到的兩種方法setBundleOptionsData()
"&setBundleSelectionsData()
",我幾乎可以肯定的是他們使用了某種PHP魔術方法,但我不知道這些魔術方法的主要邏輯在哪里寫的?
-
Regarding the two methods mentioned above "setBundleOptionsData()
" & "setBundleSelectionsData()
", what I'm almost certain is that they are using some sort of PHP magic methods, but I don't know where the main logic of these magic methods are written?
請任何人提供一些正確的答案.非常感謝任何幫助.
Please anybody provide some correct answer. Any help is greatly appreciated.
推薦答案
為此,我沒有使用任何 Web 服務.我只是使用了以下專門針對捆綁產品的方法,它們是:-
I am not using any Web Services, for this. I have simply used the following methods meant specifically for the Bundled Products, which are:-
- setBundleOptionsData()
- setBundleSelectionsData()
- setCanSaveBundleSelections(true)
對于第一種方法,Bundle Options 的詳細信息以數組的形式作為參數提供給方法.同樣,對于第二個方法setBundleSelectionsData()",我們以數組的形式將Bundle Selections的詳細信息作為參數提供給該方法.
For the first method, the details of the Bundle Options are provided to the method as the parameter in the form of an array. Similarly, for the second method "setBundleSelectionsData()", we are providing the details of the Bundle Selections to this method as the parameter in the form of an array.
這是在 Magento 中添加任何捆綁產品的主要邏輯.希望這對任何新手都有幫助!!!
This is the main logic in what goes through for adding any Bundled Product in Magento. Hope this helps to any newbies!!!
請查看此鏈接 有關以適當方式創建捆綁產品的更多詳細信息.
Please check this link for more details on Bundle Product creation in a proper way.
這篇關于使用簡單項目的 SKU/ID 以編程方式在 Magento 中添加捆綁產品的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!