當我嘗試將產品在Magento通過SOAP API添加到購物車我得到這個錯誤: 的SOAPFault:調用一個成員函數setFinalPrice()一個非對象錯誤將產品添加到購物車Magento的肥皂
我採取以下步驟:
- 創建
cart($this->call($this->_session, 'cart.create', array($store));)
- 設置客戶地址信息(cart_customer.set,cart_customer.addresses)
這將導致以下陣列中時calling(cart.info)
:
Array
(
[store_id] => 0
[created_at] => 2013-01-15 09:19:49
[updated_at] => 2013-01-15 09:19:51
[converted_at] =>
[is_active] => 0
[is_virtual] => 0
[is_multi_shipping] => 0
[items_count] => 0
[items_qty] => 0.0000
[orig_order_id] => 0
[store_to_base_rate] => 1.0000
[store_to_quote_rate] => 1.0000
[base_currency_code] => EUR
[store_currency_code] => EUR
[quote_currency_code] => EUR
[grand_total] => 0.0000
[base_grand_total] => 0.0000
[checkout_method] => guest
[customer_id] =>
[customer_tax_class_id] => 3
[customer_group_id] => 1
[customer_email] => [email protected]
[customer_prefix] =>
[customer_firstname] => Test
[customer_middlename] =>
[customer_lastname] => TestLasname
[customer_suffix] =>
[customer_dob] =>
[customer_note] =>
[customer_note_notify] => 1
[customer_is_guest] => 0
[remote_ip] =>
[applied_rule_ids] =>
[reserved_order_id] =>
[password_hash] => GkV4mSKHqgQ=
[coupon_code] =>
[global_currency_code] => EUR
[base_to_global_rate] => 1.0000
[base_to_quote_rate] => 1.0000
[customer_taxvat] =>
[customer_gender] => 0
[subtotal] => 0.0000
[base_subtotal] => 0.0000
[subtotal_with_discount] => 0.0000
[base_subtotal_with_discount] => 0.0000
[is_changed] => 1
[trigger_recollect] => 0
[ext_shipping_info] =>
[gift_message_id] =>
[is_persistent] => 0
[quote_id] => 4506
[shipping_address] => Array
(
[address_id] =>
[quote_id] => 4506
[created_at] => 2013-01-15 09:19:51
[updated_at] => 2013-01-15 09:19:51
[customer_id] =>
[save_in_address_book] => 0
[customer_address_id] =>
[address_type] => shipping
[email] =>
[prefix] =>
[firstname] => Test
[middlename] =>
[lastname] => TestLastname
[suffix] =>
[company] =>
[street] => street 24
[city] => Amsterdam
[region] =>
[region_id] =>
[postcode] => 3454 BM
[country_id] => NL
[telephone] => 565765765765
[fax] =>
[same_as_billing] => 0
[free_shipping] => 0
[collect_shipping_rates] => 1
[shipping_method] =>
[shipping_description] =>
[weight] => 0.0000
[subtotal] => 0.0000
[base_subtotal] => 0.0000
[subtotal_with_discount] => 0.0000
[base_subtotal_with_discount] => 0.0000
[tax_amount] => 0.0000
[base_tax_amount] => 0.0000
[shipping_amount] => 0.0000
[base_shipping_amount] => 0.0000
[shipping_tax_amount] => 0.0000
[base_shipping_tax_amount] => 0.0000
[discount_amount] => 0.0000
[base_discount_amount] => 0.0000
[grand_total] => 0.0000
[base_grand_total] => 0.0000
[customer_notes] =>
[applied_taxes] => a:0:{}
[discount_description] =>
[shipping_discount_amount] =>
[base_shipping_discount_amount] =>
[subtotal_incl_tax] => 0.0000
[base_subtotal_total_incl_tax] =>
[gift_message_id] =>
[hidden_tax_amount] =>
[base_hidden_tax_amount] =>
[shipping_hidden_tax_amount] =>
[base_shipping_hidden_tax_amnt] =>
[shipping_incl_tax] => 0.0000
[base_shipping_incl_tax] => 0.0000
)
[billing_address] => Array
(
[address_id] =>
[quote_id] => 4506
[created_at] => 2013-01-15 09:19:51
[updated_at] => 2013-01-15 09:19:51
[customer_id] =>
[save_in_address_book] => 0
[customer_address_id] =>
[address_type] => billing
[email] =>
[prefix] =>
[firstname] => Test
[middlename] =>
[lastname] => TestLastname
[suffix] =>
[company] =>
[street] => street 24
[city] => Amsterdam
[region] =>
[region_id] =>
[postcode] => 3454 BM
[country_id] => NL
[telephone] => 565765765765
[fax] =>
[same_as_billing] => 0
[free_shipping] => 0
[collect_shipping_rates] => 0
[shipping_method] =>
[shipping_description] =>
[weight] => 0.0000
[subtotal] => 0.0000
[base_subtotal] => 0.0000
[subtotal_with_discount] => 0.0000
[base_subtotal_with_discount] => 0.0000
[tax_amount] => 0.0000
[base_tax_amount] => 0.0000
[shipping_amount] => 0.0000
[base_shipping_amount] => 0.0000
[shipping_tax_amount] => 0.0000
[base_shipping_tax_amount] => 0.0000
[discount_amount] => 0.0000
[base_discount_amount] => 0.0000
[grand_total] => 0.0000
[base_grand_total] => 0.0000
[customer_notes] =>
[applied_taxes] => a:0:{}
[discount_description] =>
[shipping_discount_amount] =>
[base_shipping_discount_amount] =>
[subtotal_incl_tax] => 0.0000
[base_subtotal_total_incl_tax] =>
[gift_message_id] =>
[hidden_tax_amount] =>
[base_hidden_tax_amount] =>
[shipping_hidden_tax_amount] =>
[base_shipping_hidden_tax_amnt] =>
[shipping_incl_tax] => 0.0000
[base_shipping_incl_tax] => 0.0000
)
[items] => Array
(
)
[payment] => Array
(
[quote_id] => 4506
[payment_id] =>
)
)
但是,當我嘗試execute(cart_product.add)
與下面的數組:
Array
(
'sku' => '44567788855',
'quantity' => 1
)
我得到了setFinalPrice
錯誤。
問題是,我沒有訪問這個Magento安裝(只有API帳戶)。對於所有示例代碼,我都使用該網站(http://www.magentocommerce.com/api/soap/checkout/cartProduct/cart_product.add.html)。
使用product_id代替sku工作。不知怎的,這並不工作,但他們的API
您鏈接的鏈接已死亡。你能在這裏發表答案嗎? –