Skip to content

Commit

Permalink
Sync Release: Sprint 22 Fast Follow to Stage (#273)
Browse files Browse the repository at this point in the history
* PM-639 Update 'add to cart' DL product type values (#269)

* PM-572: updated source (#271)

---------

Co-authored-by: hero-dokane <[email protected]>
  • Loading branch information
pgilmore-phi and hero-dokane authored Oct 30, 2024
1 parent ecc6707 commit 63daaa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions blocks/plans-quote/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,30 +670,30 @@ export default function formDecoration(block) {

function setDataLayer(data) {
const dlItems = [];
const productTypes = [];

if ('petSummaries' in data) {
const { petSummaries } = data;
let membershipName = '';
if (petSummaries && petSummaries.length > 0) {
petSummaries.forEach((pet) => {
membershipName = pet.membershipName ?? '';
productTypes.push(pet.membershipName ?? '');
// push each item object to items array
dlItems.push({
item_name: membershipName,
item_name: pet.membershipName ?? '',
currency: currencyValue,
discount: pet.nonInsurancePetSummary?.discount ?? '',
item_category: 'membership',
item_variant: '', // okay to be left empty
microchip_number: pet.microChipNumber ?? '',
product_type: membershipName,
product_type: pet.membershipName ?? '',
price: pet.nonInsurancePetSummary?.amount ?? '',
quantity: pet.nonInsurancePetSummary?.membership?.quantity ?? '1',
});
});

const trackingData = {
ecommerce: {
product_type: membershipName,
product_type: productTypes.join(', '),
items: dlItems,
},
};
Expand Down
2 changes: 1 addition & 1 deletion blocks/widget-aggregator/widget-aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async function decorate(block) {
redirectUrl: 'https://quote.petted.com/quote',
baseUrl: 'https://quote.petted.com/',
urlParam: {
source: '24petwatch-widget',
source,
utm_source: '',
utm_medium: '',
utm_campaign: '',
Expand Down

0 comments on commit 63daaa1

Please sign in to comment.