gpt4 book ai didi

web-services - Magento 网络服务 API 产品选项

转载 作者:行者123 更新时间:2023-12-04 04:48:16 24 4
gpt4 key购买 nike

我在 Magento webservice API 的文档中进行了搜索,但找不到获取特定产品的变体/选项的选项。例如,我有一只鞋,想知道用户可以选择哪些鞋码。是否有可能获得这些值?

提前致谢!

最佳答案

对于 Magento SOAP API V1,你可以这样做:

$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'product_attribute.info', '11');
var_dump ($result);

// If you don't need the session anymore
//$client->endSession($session);

您将通过选项列表获得有关必需属性的完整信息。

示例响应:
array
'attribute_id' => string '11' (length=3)
'attribute_code' => string 'new_special_price' (length=17)
'frontend_input' => string 'text' (length=4)
'default_value' => null
'is_unique' => string '0' (length=1)
'is_required' => string '0' (length=1)
'apply_to' =>
array
empty
'is_configurable' => string '0' (length=1)
'is_searchable' => string '0' (length=1)
'is_visible_in_advanced_search' => string '0' (length=1)
'is_comparable' => string '0' (length=1)
'is_used_for_promo_rules' => string '0' (length=1)
'is_visible_on_front' => string '0' (length=1)
'used_in_product_listing' => string '0' (length=1)
'frontend_label' =>
array
0 =>
array
'store_id' => int 0
'label' => string 'special price' (length=13)
1 =>
array
'store_id' => int 2
'label' => string 'special price' (length=13)
'scope' => string 'store' (length=5)
'additional_fields' =>
array
'frontend_class' => null
'is_html_allowed_on_front' => string '1' (length=1)
'used_for_sort_by' => string '0' (length=1)

source

关于web-services - Magento 网络服务 API 产品选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8578317/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com