【问题标题】:Get config simple product from configurable product options从可配置的产品选项中获取配置简单的产品
【发布时间】:2016-10-03 14:56:24
【问题描述】:

对不起,我的英语不好。 嗨,我有可配置产品 ID,它的 selected options ids 是他们的反正我可以得到这个可配置产品的简单产品属于这些选项实际上我需要那个简单的产品 ID,这样我才能得到它的重量。

["config_product"]=>"754"
["super_attribute"]=>
      array(4) {
        [327]=>"2148"
        [551]=> "11474"
        [554]=> "11515"
        [628]=>"13239"
      }

我有这个数组,我想获取这个可配置产品的简单产品 ID,它属于这些超级属性。

【问题讨论】:

    标签: php magento


    【解决方案1】:

    如果我们向它发送参数和父产品,我找到了这个问题的答案,它将返回相关的关联产品。

    $product = $parent_config_product_object;
    $params["super_attribute"]=>
          array(4) {
            [327]=>"2148"
            [551]=> "11474"
            [554]=> "11515"
            [628]=>"13239"
          }
        $childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes($params['super_attribute'], $product);
            Mage::log($childProduct->getData());
    

    希望它会帮助别人.. 我从这里得到了这个解决方案 enter link description here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 1970-01-01
      • 2012-08-30
      • 1970-01-01
      • 2021-12-22
      • 1970-01-01
      相关资源
      最近更新 更多