Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- BEGIN RELEASE NOTES -->
### [Unreleased]

#### Added
- Add isKlaviyoEnabled to product/viewed.phtml.
#### Fixed
- Ensure Controller/Checkout/Email.php loads proper classes on frontend

Expand Down
3 changes: 3 additions & 0 deletions view/frontend/templates/product/viewed.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
/** @var Klaviyo\Reclaim\Block\Catalog\Product\ViewedProduct $block */
if (!$block->isKlaviyoEnabled()) {
return;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Klaviyo: Missing API Key Validation Causes Render Issues

The template only checks isKlaviyoEnabled() but doesn't verify that a public API key exists. The block's _toHtml() method checks both conditions: isKlaviyoEnabled() && getPublicApiKey(). Other templates like analytics/initialize.phtml also check both. If Klaviyo is enabled but no API key is configured, the template will render and attempt to call getViewedProductJson() and getViewedItemJson(), which may cause issues. The check should be: if (!($block->isKlaviyoEnabled() && $block->getPublicApiKey())) to match the block's logic.

Fix in Cursor Fix in Web

?>

<script text="text/javascript">
Expand Down