nystudio107/craft-instantanalytics

What should get passed to addCommerceProductDetailView()

Closed this issue · 5 comments

Question

We've been using the V3 of this plugin and upon upgrading to V4 we get a bunch of warnings because productData['sku'] isn't defined.

What information can we pass this twig function so that it looks for a sku (they do exist on the products variants)?

Additional context

Use to work fine on version 3 or at least no warning appeared.

Can you post the exact error message you're seeing? I've looked through the code, and it gets the sku from the productVariant:

            $productData = [
                'sku' => $productVariant->sku,
                'name' => $name,
                'price' => number_format($productVariant->price, 2, '.', ''),
                'category' => $category,
            ];

Hey @khalwat
I run into the same issue after upgrade to 4.x craft & craft commerce.
I did some digging and found a bottleneck. Could you check the PR #77 ?

Thanks

Hey @khalwat
Could you check the PR please? What do you think?

Looks good, I will merge it in, thanks!

Closed via #77