Make a form submit() behave like location.replace() - javascript

IN SHORT:
There's this web page that needs to be submitted when the user loads the page. There is a good reason for it, long story.
Would it be possible to make a form post submit() behave like a location.replace()? No history trace.
Thanks.
LONG STORY: In my CMS, I have one page for each product. Products are normally listed on section pages, where the user is invited to choose a product :
Small $10 BUY
Medium $20 BUY
Large $30 BUY
Clicking on BUY would send the user to the payment page, off-site.
The product details come from the CMS page, where I defined specific fields for price, product ID, etc. Product detailes are rendered as a form.
I basically don't want to show the independent, permalink product pages, ever. But, this being a CMS, the products will be listed on section pages and whatnot, and the user may end up choosing the products by clicking on a link instead of the full rendered page with the form.
If they do end up on the product page, I want them to be redirected to the purchase page. Of course I don't want to keep the page in history, for the same reasons location.replace() was invented: to avoid the back button of eternal redirection.

Just do an AJAX POST followed by a location.replace. The AJAX POST won't create a browser history entry.

Related

How to make a product page in Wordpress

I am learning Wordpress currently so far I know how to design the webpage, but what I want to do next is to make a product page without ordering. What I want is the following:
List all my products and if one clicks on a product it will show the detail page of that product
The products can be added to a list and then there will be a contact form which will take the list and send it to me in a pdf or excel (but at first enough if only names are sent via email) so I can answer it with the asked question.
I sadly could not find any starting point I do not even know if there is such a plugin, if not can I make one myself? I know javascript so I think I could Programm it myself but would prefer if there is some plugin I can use due to time issues.
You can also use woocommerce. If you don't want a user to order something with a "Add to cart" button you could hide this button with your code or a pluging for example https://de.wordpress.org/plugins/yith-woocommerce-catalog-mode/

Customize PayPal Donate button to pass info through to PayPal page

I have a requirement to capture some info about a donation before the user is redirected to the payPal page, and to pass some of that info through to the page. The three main things is the amount, currency, and whether or not it should be a reoccurring payment. We want to have the user specify that detail before clicking "Donate", and then have that info sent through to PayPal to repopulate the page.
I have managed to achieve some of this by using the "Buy now" button, instead of the "Donate" button, and just displaying the Donate image. With that I can pass through the amount and currency, but can't set reoccurring payment it seems. At least, I don't know what the form input should be called for that option to take effect on the PayPal side. In order to do this, I had to set a couple of options when creating the "Buy now" button. I think the one was to not keep inventory or something like that, and on the page where I can copy the HTML I had to effectively unlock it. But there are no such options on the Donate button creation flow. So when I try to pass amount or currency through to the Donate page, it doesn't do anything.
I tried removing the button_id hidden input, but that just breaks the whole thing.
Is there any way for me to capture those three pieces of information - amount, currency, and whether or not it should be a reoccurring payment - on my site and pass it through to the PayPal screen upon redirect?
If you want to specify that a payment should be recurring, then the checkbox on your site that makes the donation recurring will need to convert the button into a completely different type-- a "Subscriptions" button. That is the only way for you to specify that something is recurring before the buyer reaches PayPal.
The other way of starting with a Donate transaction and having it become recurring, only works for:
transactions of type Donate (not Buy Now)
when the amount is NOT pre-specified before redirecting them
when the user selects this recurring checkbox at PayPal
All three conditions are necessary and required for this type of recurring donation to be possible.

Sending users to different sections of survey

So I just created a google forms survey and wondered if its possible to send the users to different sections.
I am looking for at way to direct half of the users directly to section 2 and have the other half only see section 1.
User 1: Sees only section 1
User 2: Sees only section 2
User 3: Sees only section 1
and so on
Is there a way to keep a counter in google scripts that that sends the users directly to a section depending on whenever its odd or even without having them answer any questions first?
On the form you can specify that after each of those sections, the form should be submitted instead of continuing on to the next section.
Then, you can get a pre-filled URL for each of the different users by:
Go to the form editor, and on the first page of the form, add a multiple choice question that has each different user as the options.
Then, check the box that says Go to page based on answer.
Next to the multiple choice options for each user, choose Go to page X, depending on which users should go to which sections.
In the menu, go to Responses > Get pre-filled URL.
For each user, select that user from the first multiple choice question and then click Submit.
In the new URL to share the pre-filled form, change viewform? to formResponse? and add &continue=continue to the end of the URL.
Repeat this for each of the different users and then give the users these new URLs for them to fill out the form.

Loading page contents into one page (Duplicated Content) bad for SEO?

I'm building a page on my site (wordpress) where I am pulling in multiple posts of post type people (url: site.com/people/name-of-person) into a page called people (url: site.com/people) as a list. It is designed to be a list of people.
Now, What I am essentially doing is, in my list of people, I have a thumbnail of the person, upon clicking, the persons profile is displayed underneath via javascript. This is pulling in name, job position, favourite quote, details about them, some Instagram photos and a larger profile image. So you can quickly click through each persons profile, navigate around etc.
Now I'm thinking how to structure the page. In terms of the page by itself, does it makes more sense to have all the text for each person (title, job position etc) all loaded already into the page? BUT, this text will be an almost an exact dupe of the individual post for that person. (Which I don't intend to directly link to anywhere through the site, they will always be directed to /people)
Will this have a bad effect on SEO with this structure? With the duplicated content? Or should I not worry too much about this?
Thanks in advance,
Craig
Loading the profile of the people obviously takes more time and make the page to load slowly .which in turn gives trouble for the users with very slow internet connection or users with limited data..
Instead of doing that just keep the data in the page minimal and when the user clicks on the thumbnail redirect them to another page where you can provide them the info about people...
OR
USE AJAX

Button to open new page and auto fill some form elements

I sell a tremendous number of products that require finance of one kind or another. I also use 8 different lending sources for financing. Problem is that each lender works with certain product types and ages, etc. I can not use a generic application form due to the differences in each lenders requirements. I have added APPLY NOW Button(s) to each individual product but cannot use simple "goto" link.
Example(s):
Customer 1 views product ID#20, unit is 20 years old and only one particular lender will work.
Customer 2 views product ID#55, unit is brand new and all will work with it, but I send all new products to one lender in particular.
Apply Now Button is always the same image, but I need for the button to open the application page specific to that product, and auto fill the input fields such as Vendor Name, Product Name and Description, Price, Etc as most customers are unfortunately lazy and simply won't do that once they have been taken away from the product page. I figure I will need to code the button individually based on individual products to open the correct application, but want all to fill in the information. All items for AutoFill are stored in the Store Database as well as the Vendor (Store) Info.
Maybe I am in the wrong area or simply missed the answer somewhere else, but I am getting snow blind trying to find the answers...even a point in the right direction would help.
It sounds to me like you need to link the product with a lender type, this would make it easier to grab lander data and auto populate the form fields when the page loads. This way you would not need to change the "Apply Now" link.
In short I would suggest creating a link table between product/product type to the lender table.

Categories