Session storage

Hi team,

I was wondering if it is possible to transfer data faster than using a single line for each name and value? I have noticed that if I remove the session storage then the button within the repeater becomes more responsive to wixLoctaion. I thought I could just transfer the ._id and run a query… but I have calculations on the page that need transferred, so I don’t think this solution would work.

Please clarify the question and add details. It’s hard to understand what exactly you’re trying to achieve.

Is there a faster way to achieve this:

$item('#bookBtn').onClick((event) => {
$item('#bookBtn').label = "Please Wait...";
let night = $w('#accommDrpdown').value;
let image = item.mobileImage;
let price = Number($w('#price').text.replace("£", ""));
let courseTitle = item.title;
let courseId = item._id;
let courseCat = item.coursesCategory;
let minPartipnts = item.min;
let courseDetailsPDF = item.groupPrice;
local.setItem('date', date.toUKDateString())
local.setItem("PDF", courseDetailsPDF)
local.setItem('courseImage', image);
local.setItem('price', price);
local.setItem('courseTitle', courseTitle);
local.setItem('courseId', courseId);
local.setItem('courseCategory', courseCat);
local.setItem("minParticipants", minPartipnts);
local.setItem('nights', night);
local.setItem('duration', duration);
wixLocation.to('/details-and-payment');
})

I’d do it differently:

//PAGE 1
let data = {
    date: date.toUKDateString(),
    PDF: courseDetailsPDF,
    courseImage: courseId,
    //etc...
}
local.setItem("data", JSON.stringify(data));

//PAGE2:
import {local} from 'wix-storage';
let data = JSON.parse(local.getItem("data"));

@jonatandor35 Ah! that’s exactly what I was looking for. Thanks again for your help