|
|
#11 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
Well as always, I spoke to soon.
I must have gone brain dead, but for some reason I can't get it to accept more than 1 category ID. I'm presenting it with the or ( || ) command, as I do in my cgi scripts, but it's not working. When I put in the line {if $checkoutDisPrice=="Y" && $category != "45"} it works just fine for that one category. When I try to add in the other categories with the || command, it removes the price from ALL categories. If we could use the "ccnoprice" category field, it would solve all the problems, because that field is either Y, N, or Blank when you look at it in the database itself. Only problem is, that field doesn't show up in the information when you run the {debug} command. Any thoughts?
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template Last edited by MrGForce; 06-17-2009 at 12:45 PM. |
|
|
|
|
|
#12 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,538
Rep Power: 44 ![]() ![]() |
What if you just put the ID's in like this?
$category != "45", "47", "52"
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#13 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
Didn't work. I get this parse error ....
Parse error: syntax error, unexpected ',' in ...... step3 ...... I removed the commas and got a similar parse error.
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template |
|
|
|
|
|
#14 | |
|
Coder
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108 ![]() ![]() |
Quote:
nopricecat becomes the variable we want to evaluate for to determine if we should display the price field or not. the numbers at the end of the following line represent the categories where we WANT the price field displayed. {assign var='nopricecat' value=','|explode:'5,9,10,15'} {if in_array($nopricecat) } display normal price display code here {/if} EDIT: To more accuratly reflect the contents of the variable above you could change "nopricecat" to "pricecat" or anything you like, just make sure you use the same veriable name in both the assign and the in_array lines. |
|
|
|
|
|
|
#15 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
I just did that and all the price fields are gone. This is the code that I have in my step3.tpl file ....
{assign var='nopricecat' value=','|explode:'17,18,19,20'} {if $checkoutDisPrice=="Y" && in_array($nopricecat)} <p> <label for="price">{if $checkoutRequirePrice==Y}{$smarty.const.LANG_STAR} {/if} {$smarty.const.LANG_PRICE}{$smarty.const.LANG_COLO N}</label> {$currency_symbol}<input name="price" id="price" value="{$price}" type="text" size="{$smarty.const.FIELD_SIZE}" /> </p> {/if}
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template |
|
|
|
|
|
#16 |
|
Coder
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108 ![]() ![]() |
in_array is actually php so may not be playing nice with the smarty, try it like this....
{assign var='nopricecat' value=','|explode:'17,18,19,20'} {if in_array($nopricecat)} {if $checkoutDisPrice=="Y"} <p> <label for="price">{if $checkoutRequirePrice==Y}{$smarty.const.LANG_STAR} {/if} {$smarty.const.LANG_PRICE}{$smarty.const.LANG_COLO N}</label> {$currency_symbol}<input name="price" id="price" value="{$price}" type="text" size="{$smarty.const.FIELD_SIZE}" /> </p> {/if} {/if} |
|
|
|
|
|
#17 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
No. Still takes out all the price fields from all the categories.
I put it in just as you stated above. I need to run out on a job real quick, but if you have any more suggestions, I'll try them when I get back. I really appreciate your help with this.
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template |
|
|
|
|
|
#18 |
|
Coder
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108 ![]() ![]() |
doah! Sorry,I forgot the needle in the arguement. The in array line should be like this....
{if in_array($category,$nopricecat)} Basically says if the value of the variable $category is in the array $nopricecat then process.... |
|
|
|
|
|
#19 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
Hi Larry;
I just revised the tpl again and it still removes the price from ALL the categories. Before responding back, I went into the "Manage Categories" and checked the "Allow Price" (ccnoprice ) in each one that I want it showing up in. I did this, because while I was going through some of the categories after putting in the code, I noticed that the categories that I had not checked the box "Allow Price" were coming up with the following .... PriceLANG_COLO then the price field. After checking the box, that message went away, and so did the price field completely. Is there anything that I can check for you that would cause your code to not work? Sorry about this.
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template |
|
|
|
|
|
#20 |
|
Member
Join Date: May 2009
Posts: 96
Rep Power: 2 ![]() |
I've just now taken the step3.tpl file back to the original format and have a new problem.
After replacing the step3 file with the original, the price field wasn't showing up on about half of the categories. So, just for the heck of it, I went into the admin and deactivated the "Custom Category" Module. Now all the categories are back to normal and displaying the price field. Go figure. Does the Custom Categories module change the Step3 template? Just curious. Any other suggestions on the removal of the price field in the "step3.tpl file????????
__________________
MrGForce Currently running 68Classifieds v4.1.3 Developer Edition ... Purple Template Last edited by MrGForce; 06-17-2009 at 07:56 PM. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Templates / Graphics | seymourjames | Modification Release | 2 | 03-20-2009 12:17 PM |
| Module - Custom Category Templates | Eric Barnes | Modules / Plugins / Modifications | 19 | 11-07-2008 05:14 PM |
| Advantages of custom templates available? | jj30 | v3.1 Questions & Support | 2 | 05-13-2007 03:00 AM |
| Custom Templates available | jj30 | HTML, CSS, and Design Help | 2 | 05-11-2007 12:00 PM |
| Custom checkout templates? | Mike-N-Tosh | v3.1 Modules & Modifications | 3 | 04-02-2007 08:32 AM |