Magento 1.5, numeric SKUs and productIdentifierType

后端 未结 2 1227
忘了有多久
忘了有多久 2021-01-15 02:27

In Magento 1.5, accessing the catalogProductInfo API call from C# like this works with non-numeric SKUs:

catalogProductRequestAttributes fetchattrib = new ca         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-15 03:16

    Short answer is that there's a bug somewhere preventing the last param of product.update from being set properly (or maybe Varien haven't yet implemented it), which also presents a problem for the method product.info.

    A quick workaround (if you don't mind losing the option to update by ID) is just to set the $identifierType in the Product API update() method ):

    In app/code/core/Mage/Catalog/Model/Product/Api.php l.198

    public function update($productId, $productData, $store = null, $identifierType = 'sku')
    

    And finally load the product within the if ($idBySku) condition of the method getProduct() around l.427 of app/code/core/Mage/Catalog/Helper/Product.php

    $productId = $idBySku;
    $product->load($productId);
    

    It's a bit of a fudge. I'll have a look for a better workaround as an override; otherwise, maybe someone else can post a better solution.

提交回复
热议问题