What should get passed to addCommerceProductDetailView()
Closed this issue · 5 comments
mediabeastnz commented
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.
khalwat commented
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,
];
Romanavr commented
khalwat commented
Looks good, I will merge it in, thanks!