getData('viewModel');
if ($viewModel->isPdpAtCartEnabled()) {
$rewardLabel = $viewModel->getRewardLabelAtCartPage();
if (str_contains($rewardLabel, "{{EARN_POINTS}}")) {
- $rewardLabel = str_replace("{{EARN_POINTS}}", "", $rewardLabel);
+ $rewardLabel = str_replace("{{EARN_POINTS}}", "", $rewardLabel);
} else {
- $rewardLabel = "" . $rewardLabel;
+ $rewardLabel = "" . $rewardLabel;
}
?>
= /* @noEscape */ $rewardLabel;?>
diff --git a/view/frontend/templates/catalog/reward_points.phtml b/view/frontend/templates/catalog/reward_points.phtml
index eff8080..846a316 100755
--- a/view/frontend/templates/catalog/reward_points.phtml
+++ b/view/frontend/templates/catalog/reward_points.phtml
@@ -3,10 +3,10 @@ $viewModel = $block->getData('viewModel');
if ($viewModel->isPdpPointEnabled()) {
$rewardLabel = $viewModel->getRewardLabel();
if (str_contains($rewardLabel, "{{EARN_POINTS}}")) {
- $rewardLabel = str_replace("{{EARN_POINTS}}", "", $rewardLabel);
+ $rewardLabel = str_replace("{{EARN_POINTS}}", "", $rewardLabel);
} else {
- $rewardLabel = "" . $rewardLabel;
+ $rewardLabel = "" . $rewardLabel;
}
?>
- = /* @noEscape */ $rewardLabel;?>
+ = /* @noEscape */ $rewardLabel;?>
diff --git a/view/frontend/templates/dashboard.phtml b/view/frontend/templates/dashboard.phtml
index 0ce87ea..59d16f1 100755
--- a/view/frontend/templates/dashboard.phtml
+++ b/view/frontend/templates/dashboard.phtml
@@ -4,54 +4,27 @@ if (!$isEnabled) {
return;
}
$partnerId = $block->getPartnerId();
+$jwtToken = $block->getJwtToken();
+if (!$jwtToken) {
+ return;
+}
?>
diff --git a/view/frontend/web/css/module.css b/view/frontend/web/css/module.css
index e8759b2..6a66ed1 100755
--- a/view/frontend/web/css/module.css
+++ b/view/frontend/web/css/module.css
@@ -50,7 +50,7 @@
background-color: #b7b7b7;
border-color: #b3aeae;
}
-.zinrelo-earn-product-points > div {
+.trueloyal-earn-product-points > div {
display: inline-block;
color: #ff5555;
font-weight: bold;
diff --git a/view/frontend/web/css/source/_module.less b/view/frontend/web/css/source/_module.less
index 499a8ec..5497d6d 100644
--- a/view/frontend/web/css/source/_module.less
+++ b/view/frontend/web/css/source/_module.less
@@ -63,7 +63,7 @@
}
}
-.zinrelo-earn-product-points > div {
+.trueloyal-earn-product-points > div {
display: inline-block;
color: @pdp-point-color;
font-weight: bold;
diff --git a/view/frontend/web/js/cart-points.js b/view/frontend/web/js/cart-points.js
index 03501fc..a7ca39b 100755
--- a/view/frontend/web/js/cart-points.js
+++ b/view/frontend/web/js/cart-points.js
@@ -6,12 +6,12 @@ define([
], function ($, quote, priceUtils, customerData) {
'use strict';
- function runZinrelo() {
+ function runTrueLoyal() {
const cartItems = window.checkoutConfig.quoteItemData;
- const zinreloItems = [];
+ const trueloyalItems = [];
cartItems.forEach(function (item) {
- zinreloItems.push({
+ trueloyalItems.push({
product_id: item.product_id,
quantity: item.qty,
price: item.price,
@@ -19,25 +19,25 @@ define([
});
});
- if (zinreloItems.length && typeof zrl_mi !== 'undefined' && typeof zrl_mi.get_potential_points === 'function') {
+ if (trueloyalItems.length && typeof zrl_mi !== 'undefined' && typeof zrl_mi.get_potential_points === 'function') {
zrl_mi.get_potential_points_success_handler = function () {
- const element = document.getElementById("zinrelo_cart_total_points");
+ const element = document.getElementById("trueloyal_cart_total_points");
if (element && typeof potential_points !== 'undefined') {
element.innerText = potential_points;
}
};
- zrl_mi.get_potential_points(zinreloItems);
+ zrl_mi.get_potential_points(trueloyalItems);
} else {
- console.warn('Zinrelo not available or cart is empty.');
+ console.warn('TrueLoyal not available or cart is empty.');
}
}
return function () {
$(document).ready(function () {
- runZinrelo();
+ runTrueLoyal();
const cart = customerData.get('cart');
cart.subscribe(function () {
- setTimeout(runZinrelo, 500);
+ setTimeout(runTrueLoyal, 500);
});
});
};
diff --git a/view/frontend/web/js/model/checkout-data-resolver.js b/view/frontend/web/js/model/checkout-data-resolver.js
index 43b1cd7..d2bafa3 100755
--- a/view/frontend/web/js/model/checkout-data-resolver.js
+++ b/view/frontend/web/js/model/checkout-data-resolver.js
@@ -13,20 +13,20 @@ define([
var config = window.checkoutConfig;
/**
- * Select zinrelo shipping method when free shipping rule Applied
+ * Select trueloyal shipping method when free shipping rule Applied
*/
var resolveShippingRates = wrapper.wrap(
checkoutDataResolver.resolveShippingRates,
function (originalResolveShippingRates, ratesData) {
let method = this.getMethod('shipping', ratesData);
if (!_.isUndefined(method)) {
- let isZinreloShippingSelected = ($.mage.cookies.get('zinrelo_shipping_selected'));
- if (!isZinreloShippingSelected) {
- /*get zinrelo free shipping cart-data rates and make default selected */
+ let isTrueLoyalShippingSelected = ($.mage.cookies.get('trueloyal_shipping_selected'));
+ if (!isTrueLoyalShippingSelected) {
+ /*get trueloyal free shipping cart-data rates and make default selected */
cartCache.clear('cart-data');
selectShippingMethodAction(method);
- checkoutData.setSelectedShippingRate('zinrelorate_zinrelorate');
- $.mage.cookies.set('zinrelo_shipping_selected', true, {lifetime: 86400});
+ checkoutData.setSelectedShippingRate('trueloyalrate_trueloyalrate');
+ $.mage.cookies.set('trueloyal_shipping_selected', true, {lifetime: 86400});
}
}
return originalResolveShippingRates(ratesData);
@@ -47,7 +47,7 @@ define([
self = this;
var matchedMethod;
matchedMethod = availableMethods.find(function (method) {
- return self.getMethodCode(method, type) === 'zinrelorate_zinrelorate';
+ return self.getMethodCode(method, type) === 'trueloyalrate_trueloyalrate';
});
return matchedMethod;
diff --git a/view/frontend/web/js/model/checkout-data-resolver.js_bkp b/view/frontend/web/js/model/checkout-data-resolver.js_bkp
index 9c1a426..a3dac18 100755
--- a/view/frontend/web/js/model/checkout-data-resolver.js_bkp
+++ b/view/frontend/web/js/model/checkout-data-resolver.js_bkp
@@ -12,18 +12,18 @@ define([
var config = window.checkoutConfig;
/**
- * Select zinrelo shipping method when free shipping rule Applied
+ * Select trueloyal shipping method when free shipping rule Applied
*/
var resolveShippingRates = wrapper.wrap(
checkoutDataResolver.resolveShippingRates,
function (originalResolveShippingRates, ratesData) {
let method = this.getMethod('shipping', ratesData);
if (!_.isUndefined(method)) {
- let isZinreloShippingSelected = ($.mage.cookies.get('zinrelo_shipping_selected'));
- if (!isZinreloShippingSelected) {
+ let isTrueLoyalShippingSelected = ($.mage.cookies.get('trueloyal_shipping_selected'));
+ if (!isTrueLoyalShippingSelected) {
selectShippingMethodAction(method);
- checkoutData.setSelectedShippingRate('zinrelorate_zinrelorate');
- $.mage.cookies.set('zinrelo_shipping_selected', true, {lifetime: 86400});
+ checkoutData.setSelectedShippingRate('trueloyalrate_trueloyalrate');
+ $.mage.cookies.set('trueloyal_shipping_selected', true, {lifetime: 86400});
}
}
return originalResolveShippingRates(ratesData);
@@ -44,7 +44,7 @@ define([
self = this;
var matchedMethod;
matchedMethod = availableMethods.find(function (method) {
- return self.getMethodCode(method, type) === 'zinrelorate_zinrelorate';
+ return self.getMethodCode(method, type) === 'trueloyalrate_trueloyalrate';
});
return matchedMethod;
diff --git a/view/frontend/web/js/price-box-zinrelo.js b/view/frontend/web/js/price-box-trueloyal.js
similarity index 100%
rename from view/frontend/web/js/price-box-zinrelo.js
rename to view/frontend/web/js/price-box-trueloyal.js
diff --git a/view/frontend/web/js/view/checkout/summary/zinrelo-discount.js b/view/frontend/web/js/view/checkout/summary/trueloyal-discount.js
similarity index 53%
rename from view/frontend/web/js/view/checkout/summary/zinrelo-discount.js
rename to view/frontend/web/js/view/checkout/summary/trueloyal-discount.js
index e2a4602..f5c6d2a 100755
--- a/view/frontend/web/js/view/checkout/summary/zinrelo-discount.js
+++ b/view/frontend/web/js/view/checkout/summary/trueloyal-discount.js
@@ -10,25 +10,25 @@ define(
"use strict";
return Component.extend({
defaults: {
- template: 'Zinrelo_LoyaltyRewards/checkout/summary/zinrelo-discount'
+ template: 'TrueLoyal_LoyaltyRewards/checkout/summary/trueloyal-discount'
},
totals: quote.getTotals(),
- isDisplayedZinrelodiscountTotal : function () {
- if(totals.getSegment('zinrelo_discount')) {
+ isDisplayedTrueLoyaldiscountTotal : function () {
+ if(totals.getSegment('trueloyal_discount')) {
return true;
}else {
return false;
}
},
- getZinrelodiscountTotal : function () {
- if(totals.getSegment('zinrelo_discount')){
- var price = totals.getSegment('zinrelo_discount').value;
+ getTrueLoyaldiscountTotal : function () {
+ if(totals.getSegment('trueloyal_discount')){
+ var price = totals.getSegment('trueloyal_discount').value;
return this.getFormattedPrice(price);
}
},
- getZinrelodiscountLabel : function () {
- if(totals.getSegment('zinrelo_discount')){
- return totals.getSegment('zinrelo_discount').title;
+ getTrueLoyaldiscountLabel : function () {
+ if(totals.getSegment('trueloyal_discount')){
+ return totals.getSegment('trueloyal_discount').title;
}
}
});
diff --git a/view/frontend/web/template/checkout/summary/trueloyal-discount.html b/view/frontend/web/template/checkout/summary/trueloyal-discount.html
new file mode 100755
index 0000000..eaed8e7
--- /dev/null
+++ b/view/frontend/web/template/checkout/summary/trueloyal-discount.html
@@ -0,0 +1,8 @@
+
+
+ |
+
+
+ |
+
+
diff --git a/view/frontend/web/template/checkout/summary/zinrelo-discount.html b/view/frontend/web/template/checkout/summary/zinrelo-discount.html
deleted file mode 100755
index 451724b..0000000
--- a/view/frontend/web/template/checkout/summary/zinrelo-discount.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- |
-
-
- |
-
-