Skip to content

Commit

Permalink
Merge pull request #11 from bold-commerce/fix-template-fallback
Browse files Browse the repository at this point in the history
Fix template fallback
  • Loading branch information
nicolenorman authored Jan 25, 2024
2 parents 477965b + 1340d29 commit e78a56b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Block/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Checkout extends Template
private const CONFIG_PATH_TEMPLATE_TYPE = 'checkout/bold_checkout_base/template_type';
private const CONFIG_PATH_TEMPLATE_FILE = 'checkout/bold_checkout_base/template_file';
private const UPLOAD_DIR = 'bold/checkout/template';
private const HOSTED_TEMPLATE_URL = 'https://cashier.boldcommerce.com/assets/experience/';

/**
* @var Session
Expand Down Expand Up @@ -206,7 +207,7 @@ public function getCheckoutTemplateScriptUrl(): string
return $mediaUrl . self::UPLOAD_DIR . DIRECTORY_SEPARATOR . $templateFile;
}

return $this->getViewFileUrl('Bold_CheckoutSelfHosted::js' . DIRECTORY_SEPARATOR . $templateType . '.js');
return self::HOSTED_TEMPLATE_URL . $templateType . '.js';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/templates/checkout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ try {
$orderData = $this->getOrderData();
$orderId = $this->getPublicOrderId();
} catch (Exception $e) {
echo '<script>window.location.href = "' . $escaper->escapeJs($this->getReturnUrl()) . '"</script>';
echo '<script>window.location.href = "' . $escaper->escapeUrl($this->getReturnUrl()) . '"</script>';
return;
}
?>
Expand All @@ -32,6 +32,6 @@ try {
window.initializedOrder = <?php echo $orderData ?>;
</script>
<div id='main'>
<script src="<?php echo $escaper->escapeJs($this->getCheckoutTemplateScriptUrl()) ?>"></script>
<script src="<?php echo $escaper->escapeUrl($this->getCheckoutTemplateScriptUrl()) ?>"></script>
</div>
<footer></footer>

0 comments on commit e78a56b

Please sign in to comment.