This hack enables the administrator to set a discount value and a point at which that value should be applied i.e. buy over 6 items and receive a 20% discount. The good thing about this hack is that the two values can be different for every item. Step 1: Go to the Data base setup file Find the point below and add the lines in bold ########################################################## Database Definition Variables # ######################################################### $db{"product_id"} = 0; $db{"product"} = 1; $db{"price"} = 2; $db{"name"} = 3; $db{"image_url"} = 4; $db{"discount"} = 9; $db{"break"} = 10; $db{"discription"}= 11; $db{"options"} = 12; Step 2: Page down till you find the point below and add the lines in bold @sc_db_index_for_defining_item_id = ($db{"product_id"}, $db{"product"}, $db{"price"}, $db{"name"}, $db{"image_url"}, $db{"discount"}, $db{"break"}); Notice the ); underlined at the end this signifies that it is the end of the statement and must be a substitute for the comma or the program will crash. Step 3: Page down again and add the lines in bold $cart{"quantity"} = 0; $cart{"product_id"} = 1; $cart{"product"} = 2; $cart{"price"} = 3; $cart{"name"} = 4; $cart{"image_url"} = 5; $cart{"discount"} = 7; $cart{"break"} = 8; $cart{"options"} = 9; $cart{"price_after_options"} = 10; $cart{"unique_cart_line_id"} = 11; Now save and exit Step 4: Edit the file web_store_html_lib.pl I have encluded some of the surounding text so this one is easier to find again add the bold text # Then, the script splits the row in the client's cart # and grabs the unique product ID number, the unique cart # id number, and the quantity. We will use those values # while processing the cart. @cart_fields = split (/\|/, $_); $cart_row_number = pop(@cart_fields); push (@cart_fields, $cart_row_number); $quantity = $cart_fields[0]; $product_id = $cart_fields[1]; $weight = $cart_fields[6]; $discount = $cart_fields[7]; $breakpoint = $cart_fields[8]; # Next we will need to begin to distinguish between types # of displays we are being asked for because each type of # display is slightly different. For example, if we are # being asked to display a cart for the delete item # form, we will need to add a checkbox before each item so # that the customer can select which items to delete. If, # on the other hand, we are being asked for modify the # quantity of an item form, we need to add a text field # instead, so that the customer can enter a n Step 5: This is the part were it compairs the quantity against the break point add the line in bold } # End of foreach $display_index (@sc_cart_index_for_display) # Then we will need to use the quantity value we shifted # earlier to fill the next table cell, and then, after # using another database specific setup variable, # calculate the subtotal for that database row and fill # the final cell and close out the table row and the cart # file (once we have gone all the way through it.) $unformatted_subtotal = ($quantity*$cart_fields[$sc_cart_index_of_price_after_options]); # if breakpoint is not 0 and quantity >= price break, apply discount value if ($breakpoint != 0 && $quantity >= $breakpoint) { $unformatted_subtotal = ($quantity*$cart_fields[$sc_cart_index_of_price_after_options] - ($quantity*$cart_fields[$sc_cart_index_of_price_after_options] * $discount/100)); } $subtotal = &format_price($unformatted_subtotal); $unformatted_grand_total = $grand_total + $subtotal; $grand_total = &format_price($unformatted_grand_total Now the two field befour the option field (which is the last field ) will be discount and breakpoint fields respectivily. I have put an example below 0001|Watch|2.95|Swish Watch|Click Here|20|5|%%option This will mean if the customer buys 5 or more Swish Watches he will get a 20% discount. Give us a shout if you have succesfully implemented this hack I would like to see it Alex Botley Support@m-p.co.uk