Jaguar Posted June 6, 2003 Posted June 6, 2003 Anybody got any thoughts and logic as to how to accompolish this - A modification to either the "Specials" and/or the checkout pages to only allow a customer to only select one pre-defined special from the list of allowed specials for each order. Reasoning- specials can be used as promotional items - i.e. "Buy this Car and get these free seat covers or roof rack or pin stripes" Customers however can only choose one item from the list of specials. A natural secondary requirement is that if the qualifying product is removed from the cart after the special item has been added that the special would also be removed from the cart so that the customer could not purchase a "special" without the qualifying product. This basically means that code needs to exist that will selectively delete specific items from the shopping cart under programatic control based on the criteria of what currently exists in the shopping cart. Anybody got any thoughts and logic as to how to accompolish this? Loren The great thing about beating your head against the wall is that it feels SO GOOD when you stop!
Ajeh Posted June 6, 2003 Posted June 6, 2003 It can be written. I have code written into the SECv1.0b that can test how many of a product based on a condition of the product table exist via a function call that can test any field and count for it. It could be used to check for a flag in the products table that indicates only one. Then the validation routine for the checkout that is built in could be modified to test for this and not allow the checkout until this is fixed. Or, you can modify the Shopping cart features in application_top.php to test for this and not allow an add to cart, buy now or update from the shopping cart to work when this condition exist. Got all that?! :shock:
Jaguar Posted June 7, 2003 Author Posted June 7, 2003 Thanks Linda. We just installed the updated version of SEC 1.0b using the 5-18-03 release. Other than a problem of the SQL files which we fixed AFTER we downloaded ALL of the files the install worked fine. :D 8) My compliments to the chef on some real nasty code! 8) Okay getting back to the issue of the specials used as premium products... Could you point to the right PHP file where this function/class/module might be living out its blissfull life. I have checked as well as my guys but as yet no luck, of course we have only had the SEC mod up for about two hours and we ran out of pizza 3 hours ago! What I understand is that their exists a function that will check for the existence of more than one unique product ID in the shopping cart. Based on your response then the following psuedo code may apply: ( any other developers out there are welcome to contribute their comments/suggestions) in cart_contents If exist_more_than_one_products_id_in_cart then check_products_database_for flag_on_products_id if flag_set then check_for_existence_of_qualifying_product_in_cart if true then display_warning_message_about_having_too_many_items remove(products_id) else display_warning_message_about_not having_qualifying_product remove(products_id) end if end if end if Is this close too what you tried to describe ? Of couse I have no idea what the function is that your are refering too, so I my psuedo code may be off. Anybody else is free to comment here. What we are thinking is that this hack might be then tied to a ADMIN section that would allow for the additional setting of a dollar amount associated with an order. This way you can offer specials based on a specific product and/or having a qualifying order. First, things first, lets get the above logic working. Thanks for the input and suggestions. Loren The great thing about beating your head against the wall is that it feels SO GOOD when you stop!
Jaguar Posted June 15, 2003 Author Posted June 15, 2003 Does anybody know what function Linda is talking about here in her post to my question? I have asked Linda directly, but no reply yet. Loren The great thing about beating your head against the wall is that it feels SO GOOD when you stop!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.