Advertisement
Advertisement
| 03.31.2008 at 03:50AM PDT, ID: 23282035 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: |
THE CODE THAT PACKAGES THE FORM INFO FOR DISPLAY IN THE TEXTAREA ON THE CHECKOUT PAGE IS BELOW:
function get_order_copy(){
var sub_total = 0;
var items = 0;
var buffer = '';
// update product rows
for(var i=0; i<g_products.length; i++){
var product = g_products[i];
var guid = product[0];
var name = product[1];
var price = product[2];
var qty = get_qty(guid);
items += qty;
var total = price*qty;
sub_total += total;
if (qty > 0){
buffer += name+" ("+guid+") x"+qty+" @ "+format_price(price)+" = "+format_price(total)+"\n";
}
}
buffer += "\nTotal: ("+items+" items) "+format_price(sub_total)+"\n";
return buffer;
}
THE CHECKOUT TEMPLATE IS BELOW: RATHER THAN DISPLAY IN A TEXTAREA, I WANT TO JUST GET THE DATA OUT OF JAVASCRIPT AND SET THE VARIABLES SOMEWHERE.
<html>
<head>
<title>My Shop - Checkout</title>
<script src="basket.js"></script>
<script src="products.js"></script>
</head>
<body onLoad="document.getElementById('order_text').value = get_order_copy();">
<div style="background-color: #cccccc; padding: 3px; text-align: right;">
<a href="products.htm">Continue Shopping</a>
</div>
<br>
This is as far as my demo goes, but the next step is pretty easy :)<br>
<br>
<form>
Order:<br>
<textarea name="order_text" id="order_text" wrap="virtual" cols="60" rows="10"></textarea>
</form>
</body>
</html>
|