Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

500 error when using recommendations for cross sell while staticImpressions are enabled #4

Open
9 tasks
ArjenMiedema opened this issue Mar 19, 2018 · 0 comments

Comments

@ArjenMiedema
Copy link

ArjenMiedema commented Mar 19, 2018

Issue Brief

When using Tweakwise with Magento Enterprise and Google Tag Manager, the extension load the products for the static impressions of the cross sells. In the check in Emico_Tweakwise_Block_Checkout_Cart_Crosssell::getItems() there's a check if ajax is enabled for the recommendations and if the current call is an ajax call. If not, it will return $this, which is a completely different type of response then the expected product collection. It would be better to return parent::getItems() in stead.

The line that causes the error can be found here: https://github.com/EmicoEcommerce/Magento1Tweakwise/blob/master/app/code/community/Emico/Tweakwise/Block/Checkout/Cart/Crosssell.php#L28

Environment

  • PHP Version: 7.0
  • Magento Version: 1.14.3.8
  • Magento Enterprise: yes
  • Tweakwise Export Version: 2.1.13
  • Magento Deploy Mode: production

Steps to reproduce

  1. Make sure you have Tweakwise installed
  2. Enable the recommendations for the cart page (cross sells)
  3. Make sure you enabled Google Tag Manager
  4. Add any product to your cart that has linked recommendations in Magento
  5. Go to the cart page and check the result

Actual result

  1. The page header response is 500
  2. An entry is added to the server's log file with the following error: Uncaught Error: Call to a member function getSku() on integer in app/design/frontend/base/default/template/googleanalyticsuniversal/impression.phtml on line 46

Expected result

  • The page returns a header response of 200
  • No error is thrown
  • The cross sells are shown as expected
  • It's possible to use Tweakwise recommendations on Magento 1 Commerce together with Google Universal Analytics and Google Tag Manager
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant