Magento 1:自定义模块中的购物车信息为空

时间:2019-04-18 09:53:31

标签: php magento magento-ee

我有一个自定义的Magento 1模块,需要获取购物车信息。它可以在多个Magento安装中使用,但是在最后一个安装中,我无法获得购物车信息。 Magento的版本是1.14.2.1企业版。我无法直接访问Magento,因为我们的客户负责Magento。他们告诉我,购物车没有自定义模数。

我尝试了其他策略来获取从其他线程获取的购物车信息,但结果始终相同。

这是我尝试过的方法:

Mage::getSingleton('checkout/session')->getQuote()->getData();

Mage::getModel('checkout/cart')->getQuote()->getData();

结果始终相同:

Array
    (
        [store_id] => 21
        [is_checkout_cart] => 1
        [remote_ip] => <ip address>
        [x_forwarded_for] => <ip address>
    )

在所有其他安装中,这两种方法都可以得到以下结果:

Array
    (
        [entity_id] => 684
        [store_id] => 1
        [created_at] => 2019-04-17 11:44:57
        [updated_at] => 2019-04-17 11:44:57
        [converted_at] =>
        [is_active] => 1
        [is_virtual] => 0
        [is_multi_shipping] => 0
        [items_count] => 1
        [items_qty] => 1.0000
        [orig_order_id] => 0
        [store_to_base_rate] => 1.0000
        [store_to_quote_rate] => 1.0000
        [base_currency_code] => NZD
        [store_currency_code] => NZD
        [quote_currency_code] => NZD
        [grand_total] => 64.9500
        [base_grand_total] => 64.9500
        [checkout_method] =>
        [customer_id] =>
        [customer_tax_class_id] => 10
        [customer_group_id] => 0
        [customer_email] =>
        [customer_prefix] =>
        [customer_firstname] =>
        [customer_middlename] =>
        [customer_lastname] =>
        [customer_suffix] =>
        [customer_dob] =>
        [customer_note] =>
        [customer_note_notify] => 1
        [customer_is_guest] => 0
        [remote_ip] => 172.20.0.1
        [applied_rule_ids] =>
        [reserved_order_id] =>
        [password_hash] =>
        [coupon_code] =>
        [global_currency_code] => NZD
        [base_to_global_rate] => 1.0000
        [base_to_quote_rate] => 1.0000
        [customer_taxvat] =>
        [customer_gender] =>
        [subtotal] => 60.0000
        [base_subtotal] => 60.0000
        [subtotal_with_discount] => 60.0000
        [base_subtotal_with_discount] => 60.0000
        [is_changed] => 1
        [trigger_recollect] => 0
        [ext_shipping_info] =>
        ...

最后的事情。我不知道这些信息是否有用,但这是我在正常工作的安装中看到的唯一区别,但是我不知道这意味着什么。在无法正常运行的安装中,我在Mage_Sales_Model_Quote对象中具有以下值:

[_oldFieldsMap:protected] => Array
    (
        [base_customer_balance_amount_used] => base_customer_bal_amount_used
        [gw_add_printed_card] => gw_add_card
        [gw_printed_card_base_price] => gw_card_base_price
        [gw_printed_card_price] => gw_card_price
        [gw_printed_card_base_tax_amount] => gw_card_base_tax_amount
        [gw_printed_card_tax_amount] => gw_card_tax_amount
    )

[_syncFieldsMap:protected] => Array
    (
        [base_customer_balance_amount_used] => base_customer_bal_amount_used
        [gw_add_printed_card] => gw_add_card
        [gw_printed_card_base_price] => gw_card_base_price
        [gw_printed_card_price] => gw_card_price
        [gw_printed_card_base_tax_amount] => gw_card_base_tax_amount
        [gw_printed_card_tax_amount] => gw_card_tax_amount
        [base_customer_bal_amount_used] => base_customer_balance_amount_used
        [gw_add_card] => gw_add_printed_card
        [gw_card_base_price] => gw_printed_card_base_price
        [gw_card_price] => gw_printed_card_price
        [gw_card_base_tax_amount] => gw_printed_card_base_tax_amount
        [gw_card_tax_amount] => gw_printed_card_tax_amount
    )

谢谢

0 个答案:

没有答案
相关问题