Nickoo0 Posted January 30, 2010 Share Posted January 30, 2010 Hi, hopefully someone can help me out. If a cusomter buys <6 items then they are displayed an error (this works fine) I need this to only happen on a certain category (cards) This is a bit of my checkout_shipping.php file if ($cart->count_contents() < 6) { tep_redirect(tep_href_link(FILENAME_MIN_ITEMCART)); } I need to change this slightly so that it will only process that if statment if the contents of the cart are in a certain category. some pesudo code: if ($cart->count_contents() < 6 && $cat="cards") { tep_redirect(tep_href_link(FILENAME_MIN_ITEMCART)); } If the items are not in the cards category then the user is allowed to buy only one if they want so i would need the following php right below the <6 one. if ($cart->count_contents() < 1 && $cat="posters") { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } I would also need an if statement incase the user buys 1 card and one poster as this is not allowed, if a poster is bought and one card is added then the user must buy another 5 cards. Am I going about this the correct way?, or is there is better way to be doing this Cheers Nick Link to comment Share on other sites More sharing options...
Nickoo0 Posted January 31, 2010 Author Share Posted January 31, 2010 been trying to get this working but no joy, will carry on today. any help at all would be very much appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.