Mike Spike Posted March 24, 2011 Share Posted March 24, 2011 Hi everyone,I am selling items that each have one quantity. Although I can disable the viewing of sold items using the the method laid out here:"Disable Item when out of stock",I would like to enable the user to decide if they want to see sold items by use of a checkbox. (See picture 1)I have created a simple module that hooks where I want it, and a simple form in the .tpl file as follows:<!-- Block sold module --> <form name="sold_check" id="SoldFilter" action="" method="post"> <input name="sold_query" type="checkbox" checked="checked"> {l s='Display Sold?' mod='sold'} </form> <!-- /Block sold module -->My question is, how do I send the value of the checkbox to Classes/Search.php such that:if checkbox is ticked {$whereArray[] = ' p.id_product '.($word[0] == '-' ? 'NOT' : '').' IN (........}else {$whereArray[] = ' p.`quantity` > 0 AND p.id_product '.($word[0] == '-' ? 'NOT' : '').' IN (}Any ideas?Maybe there is a method to value the value to global / cookie and retrieve it when the 'Search' button is pressed?Thank you for you helpMikeThe website in question is: Judaica-Online http://judaica-online.co.uk Link to comment Share on other sites More sharing options...
Mike Spike Posted March 25, 2011 Author Share Posted March 25, 2011 Hi angora, thanks for your quick reply.Your response sounds very nice and logical, unfortunately I am not sure how to implement your suggestion! I am also new to checkboxes and am unaware about how to send the value from one form and receive its value in an other I will look at the smarty website maybe it will give me a clue about how to use variables etc.Do you have any other suggestions?I also like your idea of ' display in-stock only [x] '!!! THANK YOU*** Thank you, Mike. Link to comment Share on other sites More sharing options...
duncanmoo Posted February 1, 2012 Share Posted February 1, 2012 Hi Mike Sorry I know this is a thread from a few months ago, but it would be helpful if you posted the suggested solution from angora (that is after all the purpose of a forum) Thanks Duncan Link to comment Share on other sites More sharing options...
Recommended Posts