ich habe ein flash shop (paypal basierend) von einer seite gerippt.hat auch alles bis jetzt funktioniert...habe auch die gewünschten produkte mit xml eingefügt auch die preise usw...ich kann den shop zu 100% bentzen.
so nun will ich noch eine sache hinzufügen. rabatt=
im moment sind folgende punkte in der xml vorhanden.
name= price= logo= product_page=
sprich wenn man zb fünf produkte auswählt kann man -20% noch auswählen damit eben vom gesamtpreis noch -20% abgehen.
aber sobal ich bei der xml..zb bei preis -30euro (price=-30) eingebe kommt bei paypal -bitte ein wert über null eingeben.
so hier sind mal die action layer scripts und die xml
action layer:
Quellcode
- function set_prices()
- {
- item_name = "Bestellen";
- total_price = 0;
- selected_items = 0;
- for (product_counter = 0; product_counter < my_xml.firstChild.childNodes.length; product_counter++)
- {
- if (products_loader.content['line' + product_counter].check_box.value == true)
- {
- total_price = total_price + Number(products_loader.content['line' + product_counter].product_price);
- item_name = item_name + products_loader.content['line' + product_counter].xname;
- set("item_name_" + (selected_items + 1), my_xml.firstChild.childNodes[product_counter].attributes.name);
- set("amount_" + (selected_items + 1), my_xml.firstChild.childNodes[product_counter].attributes.price);
- ++selected_items;
- } // end if
- if (selected_items >= 1)
- {
- status_text_box.text = selected_items + " VON " + my_xml.firstChild.childNodes.length + " PRODUKTE GEWAELT";
- } // end if
- if (selected_items == 0)
- {
- status_text_box.text = "Waehlen Sie Ihr Produkt und klicken Sie auf \"Bestellen\"";
- } // end if
- } // end of for
- format_price_char();
- } // End of the function
- function format_price_char()
- {
- var _loc2 = total_price;
- _loc2 = Math.round(_loc2 * 100) / 100;
- var _loc1 = String(_loc2);
- if (_loc1.indexOf(".") < 0)
- {
- _loc1 = _loc1 + ".00";
- } // end if
- if (_loc1.indexOf(".") == _loc1.length - 2)
- {
- _loc1 = _loc1 + "0";
- } // end if
- total_price_box.text = "EUR " + _loc1;
- } // End of the function
- stop ();
- _root._visible = true;
- var the_price;
- var my_counter;
- var item_name = "";
- loadVariables(String(_url.slice(0, _url.length - 3) + "cfg?" + random(9999999)), _root);
- for (my_counter = 0; my_counter < my_xml.firstChild.childNodes.length; my_counter++)
- {
- if (my_counter < my_xml.firstChild.childNodes.length - 1)
- {
- products_loader.content.line0.duplicateMovieClip("line" + (my_counter + 1), my_counter);
- } // end if
- set("products_loader.content.line" + (my_counter + 1) + "._y", products_loader.content.line0._y + (my_counter + 1) * 70);
- products_loader.content.end_pixel._y = products_loader.content.line0._y + (my_counter + 1) * 70 + 6;
- set("products_loader.content.line" + my_counter + ".product_name", my_xml.firstChild.childNodes[my_counter].attributes.name);
- if (my_xml.firstChild.childNodes[my_counter].attributes.info != "" && my_xml.firstChild.childNodes[my_counter].attributes.info != undefined)
- {
- set("products_loader.content.line" + my_counter + ".product_info", my_xml.firstChild.childNodes[my_counter].attributes.info);
- } // end if
- set("products_loader.content.line" + my_counter + ".product_price", my_xml.firstChild.childNodes[my_counter].attributes.price);
- products_loader.content['line' + my_counter].product_logo.loadMovie(my_xml.firstChild.childNodes[my_counter].attributes.logo);
- products_loader.content['line' + my_counter].check_box.addEventListener("click", set_prices);
- products_loader.content['line' + my_counter].product_page = my_xml.firstChild.childNodes[my_counter].attributes.product_page;
- } // end of for
- submit_button.onRelease = function ()
- {
- if (total_price > 0)
- {
- getURL(payment_url, "_parent", "POST");
- }
- else
- {
- status_text_box.text = "FEHLER: Waehlen Sie ein Produkt bevor Sie Bestellen !!!";
- } // end else if
- };
xml:
XML-Quellcode
- <?xml version="1.0" encoding="iso-8859-1"?>
- <products>
- <A name="Der 200.000 Euro Schenker" price="4.99" logo="/COVER/KLEIN/200000euro-schenker2-KLEIN.jpg" product_page="200.000euro.php"/>
- <A name="Der Erotic-Man" price="4.99" logo="/COVER/KLEIN/erotic-man2-KLEIN.jpg" product_page="dereroticman.php"/>
- <A name="Der Runterhaendler" price="4.99" logo="/COVER/KLEIN/der_runterhaendler2-KLEIN.jpg" product_page="runterhandler.php"/>
- </products>
ich hoffe ich habe das nicht alles zu kompliziert erklärt..brauche hilfe wäre super...:)