Support Forums


Go Back   68 Classifieds Forums > Help & Support > Modules / Plugins / Modifications

Notices

 
LinkBack Thread Tools Display Modes
Old 06-17-2009, 12:39 PM   #11
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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.
MrGForce is offline   Reply With Quote
Old 06-17-2009, 12:44 PM   #12
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,538
Rep Power: 44
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

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
Mike-N-Tosh is offline   Reply With Quote
Old 06-17-2009, 01:00 PM   #13
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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
MrGForce is offline   Reply With Quote
Old 06-17-2009, 01:03 PM   #14
Coder
 
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by Mike-N-Tosh View Post
What if you just put the ID's in like this?
$category != "45", "47", "52"
unfortunately that wont work. Smarty is not very advanced when it comes to comparing multiple values and doesnt directly support the creation of arrays BUT you can get tricky and do something like this.....

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.
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 06-17-2009, 01:14 PM   #15
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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
MrGForce is offline   Reply With Quote
Old 06-17-2009, 01:18 PM   #16
Coder
 
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

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}
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 06-17-2009, 01:28 PM   #17
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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
MrGForce is offline   Reply With Quote
Old 06-17-2009, 01:40 PM   #18
Coder
 
Join Date: Mar 2006
Posts: 4,418
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

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....
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 06-17-2009, 06:05 PM   #19
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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
MrGForce is offline   Reply With Quote
Old 06-17-2009, 07:17 PM   #20
Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 96
Rep Power: 2
MrGForce is on a distinguished road
Default

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.
MrGForce is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:19 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0