
I need html code and url passthrough code
- or -
Post a project like this621
£100(approx. $134)
- Posted:
- Proposals: 13
- Remote
- #4192010
- Awarded
♛ Most Trusted #1 Team |19+ years of expertise in Website, Mobile Apps, Desktop & Console Games. Wordpress, ReactJS, Shopify, Laravel, Python, React Native, Flutter, Unity, Unreal Engine and AR/VR




Top-Rated Web & Graphic Designer | Database Expert | Business Analysis| Python Developer


4432411283421120946410217969301523211149584176964224094393506827520384159536110753489
Description
Experience Level: Entry
We have a Showit website and Thrivecart checkout.
We need to dynamically passthrough information from the URL someone uses to access the showit page to Thrivecart.
We have the passthrough information Thrivecart requires (see this page: https://support.thrivecart.com/help/pre-fill-your-checkout-fields/ and this page: https://support.thrivecart.com/help/passing-custom-variables-through-the-checkout/
But we cannot get the code we have to append the URL information to the checkout link on the showit page.
This is the code we have but try as we might it just is not working for us!
Document
document.addEventListener(“DOMContentLoaded”, function() {
// Get the current page’s query string
var queryString = window.location.search;
// Check if there actually is a query string
if (queryString) {
// Select all anchor tags on the page
var links = document.querySelectorAll(‘a’);
// Loop through each link
links.forEach(function(link) {
// Construct the new URL by checking if a query string already exists
var newHref = link.href;
if (link.href.includes(‘?’)) {
// If the link already has a query string, append using ‘&’
newHref += ‘&’ + queryString.substring(1);
} else {
// If no query string exists, append directly
newHref += queryString;
}
// Update the href attribute of the link
link.setAttribute(‘href’, newHref);
});
}
});
What we are looking for from you:
The complete task to write the code to dynamically get the information from the URL and add to the checkout link to send to thrivecart.
The correct information to add to the checkout link
Proof it works.
Instructions for us to add to all our sales pages and products in future builds.
Please note the information MUST be taken dynamically from the URL bar.
We need to dynamically passthrough information from the URL someone uses to access the showit page to Thrivecart.
We have the passthrough information Thrivecart requires (see this page: https://support.thrivecart.com/help/pre-fill-your-checkout-fields/ and this page: https://support.thrivecart.com/help/passing-custom-variables-through-the-checkout/
But we cannot get the code we have to append the URL information to the checkout link on the showit page.
This is the code we have but try as we might it just is not working for us!
Document
document.addEventListener(“DOMContentLoaded”, function() {
// Get the current page’s query string
var queryString = window.location.search;
// Check if there actually is a query string
if (queryString) {
// Select all anchor tags on the page
var links = document.querySelectorAll(‘a’);
// Loop through each link
links.forEach(function(link) {
// Construct the new URL by checking if a query string already exists
var newHref = link.href;
if (link.href.includes(‘?’)) {
// If the link already has a query string, append using ‘&’
newHref += ‘&’ + queryString.substring(1);
} else {
// If no query string exists, append directly
newHref += queryString;
}
// Update the href attribute of the link
link.setAttribute(‘href’, newHref);
});
}
});
What we are looking for from you:
The complete task to write the code to dynamically get the information from the URL and add to the checkout link to send to thrivecart.
The correct information to add to the checkout link
Proof it works.
Instructions for us to add to all our sales pages and products in future builds.
Please note the information MUST be taken dynamically from the URL bar.
Laura M.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
14 Apr 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies