Quantcast
Channel: donate – WordPress.org Forums
Viewing all articles
Browse latest Browse all 160

Jim on "[Plugin: WP e-Commerce] Prompt User for Donation Amount"

$
0
0

Store URL: http://www.sportslifephotos.com/high5/donate/
WP version: 3.7.1
WP e-Commerce version: 3.8.12.1
Theme - based on HTML5Blank

Currently when a user clicks on one of the donation amounts, the item is "submitted" and the user is redirected to the checkout page. Code snippet below.

I need to collect (prompt) for the amount when a user clicks on the "other amount" button.

All advice or suggestions are appreciated.

Thanks,

Jim

//Swapping out our donate buttons
	var inputs = document.getElementsByClassName('custom_wpsc_buy_button');

	var newUrlBase = window.location.protocol + "//" + window.location.host;
//Remember to remove "/high5" when published
	var newUrlTarget = newUrlBase + "/high5/products-page/checkout";
	for (var i = 0, len = inputs.length; i < len; i++) {
	    input = inputs[i];
	    input.onmouseover = function(){
	        this.setAttribute('data-orig-image',this.getAttribute('src'));
	        this.src = this.getAttribute('data-alt-image');
	    };
	    input.onmouseout = function(){
	        this.src = this.getAttribute('data-orig-image');
	    } ;
	    input.onclick = function(){
	   	//need special instructions for "other amount button"

	    	setTimeout(function(){
	    		location.href = newUrlTarget;
	   		},1500);
    		};

	}

http://wordpress.org/plugins/wp-e-commerce/


Viewing all articles
Browse latest Browse all 160

Trending Articles