Guest XBoNeSX Posted December 3, 2006 Share Posted December 3, 2006 I wanting to remove buy button from 1 Category and allow rest to have it buy button .. is this possible ? only way I can do it at moment is stock : 0 but has OUT OF STOCK under it which I don't want in that cat ... help please ! ASAP please please ! Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 3, 2006 Share Posted December 3, 2006 It seems you struggle a little with the English, but you're doing fine. Your question is not clear, though. "from 1 category" Does this means that you want none of products in a given category to have a buy button" Or does it mean 1 product, rather than one category. Categories do not have OUT OF STOCK messages, products have OUT OF STOCK message. Are you saying that you want buy button removed from out of stock items, but you do not want to see the out of stock text? For me, your question raises other new questions, because I am not clear about what you ask. :) Quote Link to comment Share on other sites More sharing options...
Guest XBoNeSX Posted December 3, 2006 Share Posted December 3, 2006 Does this means that you want none of products in a given category to have a buy button" <=== yes ! exactly wot I want ... lol sorry my aussie english is hard to understand ... Quote Link to comment Share on other sites More sharing options...
Guest XBoNeSX Posted December 3, 2006 Share Posted December 3, 2006 anyone please need this mod urgent! Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 4, 2006 Share Posted December 4, 2006 OPEN includes/content/viewCat.inc.php FIND the following line of code (three times!): $view_cat->parse("view_cat.productTable.products.buy_btn"); REPLACE with this code (all three places): if($_GET['catId']!=4){ $view_cat->parse("view_cat.productTable.products.buy_btn"); } Note, the code above will shut off buy button for category id 4 Change the !=4 for the correct category number of the category you choose to shut off buy button Quote Link to comment Share on other sites More sharing options...
Guest XBoNeSX Posted December 4, 2006 Share Posted December 4, 2006 sweet thx m8 .. worked a treat ! http://www.sweetpeaclothing.info/store/ind...at&catId=13 <== that her! Quote Link to comment Share on other sites More sharing options...
Guest XBoNeSX Posted December 4, 2006 Share Posted December 4, 2006 only Problem I have now when click on product (item) in cat .. has add to basket buttom ... Quote Link to comment Share on other sites More sharing options...
markscarts Posted December 4, 2006 Share Posted December 4, 2006 OK, viewProd.inc.php, again in three places: $view_prod->parse("view_prod.prod_true.buy_btn"); REPLACE with: if($prodArray[0]['cat_id']!=4){ $view_prod->parse("view_prod.prod_true.buy_btn"); } Quote Link to comment Share on other sites More sharing options...
Guest XBoNeSX Posted December 4, 2006 Share Posted December 4, 2006 thx again m8 worked ! Quote Link to comment Share on other sites More sharing options...
Guest Posted February 13, 2007 Share Posted February 13, 2007 OK, viewProd.inc.php, again in three places: $view_prod->parse("view_prod.prod_true.buy_btn"); REPLACE with: if($prodArray[0]['cat_id']!=4){ $view_prod->parse("view_prod.prod_true.buy_btn"); } What would the code be if you wanted to remove the "buy" button and "add to basket" button from two categories (19 and 20 in my case)? Thank you. www.airedaleterriers.org/swat/ Quote Link to comment Share on other sites More sharing options...
Guest taylor Posted March 15, 2007 Share Posted March 15, 2007 What would the code be if you wanted to remove the "buy" button and "add to basket" button from two categories (19 and 20 in my case)? Thank you. www.airedaleterriers.org/swat/ Hi, I ran into the same thing. Just needs another if statement above the other with the appropriate cat id. For example....the following code would take the buy off of categories 19 and 20: if($prodArray[0]['cat_id']!=19) if($prodArray[0]['cat_id']!=20){ Quote Link to comment Share on other sites More sharing options...
markscarts Posted March 17, 2007 Share Posted March 17, 2007 Try this instead: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } edited to correct the code Quote Link to comment Share on other sites More sharing options...
Guest Posted March 17, 2007 Share Posted March 17, 2007 Try this instead: if($prodArray[0]['cat_id'](!=19 && !=20)) { Or maybe better this: if($prodArray[0]['cat_id']!=(19 | 20 | 21 | 22)) { I tried both of these, as well Taylor's suggestion, and nothing seems to have changed. Just to make sure I've done this right ... these are the codes I have tried (in three places) in viewProd.inc.php First tried this, if($prodArray[0]['cat_id']!=19) if($prodArray[0]['cat_id']!=20) { $view_prod->parse("view_prod.prod_true.buy_btn"); } Then tried this if($prodArray[0]['cat_id']!=19 && !=20)) { $view_prod->parse("view_prod.prod_true.buy_btn"); } Then tried this if($prodArray[0]['cat_id']!=19 | 20 | 21 | 22)) { $view_prod->parse("view_prod.prod_true.buy_btn"); } However, when I click on the "buy" button for other sections (where I want people to be able to buy), I get the following message: Parse error: syntax error, unexpected $end in /home/airedale/public_html/airewear/includes/content/viewProd.inc.php on line 209 My website: www.airedaleterriers.org/airewear Thank you for the suggestions. Sidney Quote Link to comment Share on other sites More sharing options...
markscarts Posted March 17, 2007 Share Posted March 17, 2007 You are missing paretheses in the code I showed you, that's why I put them in red, to prevent missing one Also, the category numbers need to be changed to represent the categories you are dealing with. I used 19, 20, 21, 22 as examples only. Should be: Then tried this if($prodArray[0]['cat_id'](!=19 && !=20)) { $view_prod->parse("view_prod.prod_true.buy_btn"); } Then tried this if($prodArray[0]['cat_id']!=(19 | 20 | 21 | 22)) { $view_prod->parse("view_prod.prod_true.buy_btn"); } Quote Link to comment Share on other sites More sharing options...
Guest Posted March 17, 2007 Share Posted March 17, 2007 You are missing paretheses in the code I showed you, that's why I put them in red, to prevent missing one Also, the category numbers need to be changed to represent the categories you are dealing with. I used 19, 20, 21, 22 as examples only. ** Sorry ... I copied and pasted your code and double-checked to make sure I had all parentheses and the correct category numbers and it still generated an error message. I appreciate your trying to help. Sidney Quote Link to comment Share on other sites More sharing options...
markscarts Posted March 22, 2007 Share Posted March 22, 2007 Sorry Sidney, I finally had some time to test this, and here is what you need to use: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } edited to correct the code This has been tested on my sample store, cubecart 3.0.15 and works. My foolish post above has been corrected Quote Link to comment Share on other sites More sharing options...
Guest Posted March 22, 2007 Share Posted March 22, 2007 Sorry Sidney, I finally had some time to test this, and here is what you need to use: if($_GET['catId']!=(4 or 2)){ $view_cat->parse("view_cat.productTable.products.buy_btn"); } This has been tested on my sample store, cubecart 3.0.15 and works. Just enclose the category id numbers in parentheses and separate them with or I'll bet you are tired of seeing my name. I inserted the following code: if($_GET['catId']!=(19 or 20)){ $view_cat->parse("view_cat.productTable.products.buy_btn"); } and it worked without any error message. There was no "buy" button in categories 19 and 20, but it also turned of the buy button in all the other categories as well. Sidney Quote Link to comment Share on other sites More sharing options...
markscarts Posted March 22, 2007 Share Posted March 22, 2007 B) Just a sec . . . <MarksCarts walks outside and makes a very loud and long primal scream> OK, sorry, I tested it but did not look all through the test store, just at the categories I was trying to affect Well, I'm not giving up, but no time now to test something else, will have to wait a few days for that - but I think it will be best if I ask my partner and php expert, convict, what I am doing wrong there. Anyway, I'll post something here in the next few days. Quote Link to comment Share on other sites More sharing options...
markscarts Posted March 23, 2007 Share Posted March 23, 2007 Well, I kept trying until I made it work properly with this code: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } My last two code postings have been corrected to reflect this code. Quote Link to comment Share on other sites More sharing options...
Guest wendyk Posted March 24, 2007 Share Posted March 24, 2007 Well, I kept trying until I made it work properly with this code: if(($_GET['catId']!=2) && ($_GET['catId']!=4)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } My last two code postings have been corrected to reflect this code. It works perfect for me...thanks Marks! It took me a few tries to get it to work, but the reason is, I was pasting the code: if(($_GET['catId']!=1) && ($_GET['catId']!=6)) { $view_cat->parse("view_cat.productTable.products.buy_btn"); } into the viewprod.inc.php file. So I replaced the view_cat with view_prod in each instance of the code of this file. Just thought I would post this in case anyone else does stupid little mistakes like I do sometimes. Wendy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.