Support Forums

Just a couple of Qs about certain smarty code?

This is a discussion on Just a couple of Qs about certain smarty code? within the Templates, HTML, CSS, and Design Help forums, part of the General category; Hi David, Yer I see your meaning , I just dont fancy having half a million threads dotted about lol. ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 08-19-2010, 04:01 PM   #21
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

Hi David,

Yer I see your meaning , I just dont fancy having half a million threads dotted about lol.

With regards to my query, on the step 3 page (step3.tpl) you have the main area for title, description etc, and under this you have the extra options for Highlights, Bold and featured ads.

Basically, what im trying to do is
If featured ad = enabled AND price = 0 then select Yes as default but hide the label and drop down box from the user.

PS. I will more than likely be looking at asking some Q's about a module of yours (the one which can display sold if price = 0) but as you suggested this is for another thread.

many thanks for your response though.
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-19-2010, 04:03 PM   #22
curmudgeon
 
Join Date: Mar 2006
Posts: 5,305
Rep Power: 131
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

whats your goal? Are you trying to make all ads that are placed bold/featured etc??
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 08-19-2010, 04:23 PM   #23
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

Hi Larry,

No not every listing should be bold/featured . I have been thinking about a number of ways in which to do this and realistically the best way for me would have been via membership. This was removed however as a feature as I have seen you mention to others many times before.

Basically only on the top most package would featured, bold and highlight be free and is already automatically selected.
Because I very much doubt anyone would think nah ill leave the featured bit, I thought why not hide it, because no-one really would turn those off.

Now I know a membership module of sorts exists, but from what ive read in David's write up at the end of the term (lets say 1 year) that member is not re-allocated to another group but instead no longer receives a discount.
I could make it work, but then I couldnt. Ideally id have a group and have only 1 package assigned to that group. Obviously this voids anyone having to choose one , then ideally id like to sell yearly subscriptions and move them to an appropriate group, its just the automation of it all But again this is another thread I reckon

Manyt hanks for getting back in touch btw.
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-19-2010, 04:33 PM   #24
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,915
Rep Power: 71
seymourjames is a jewel in the rough
Default

OK so in a nutshell you are saying this. I have several packages. Lets say bronze means they have to pay for featured, bold, highlight. The same for silver but if they choose gold the adverts is automatically made featured, bold and highlight?

This should be possible to code in the checkout module with a bit of logic being deployed. It would seem possible to do at the template level without core code changes - hmmm?

The second part of your post seems complicated and I am unsure you have thought it through. So many ramifications with special cases etc etc. KEEP things simple is the best motto. People don't have time to read lots of terms and conditions nor do you want to create barriers to advertisers. If I want to post an advert, after the obvious questions about likelihood of making a sale, I want it to be fast and simple to understand.

What is your market by the way?
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
The SEO Book for all your search engine optimization needs

Last edited by seymourjames; 08-19-2010 at 04:39 PM.
seymourjames is offline   Reply With Quote
Old 08-19-2010, 04:38 PM   #25
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

Hi David (I do hope I got your name correct?),

The first part is pretty much bang on. Im not looking for a long over complicated module, I was hoping that the {if not $cFeaturedPrice=="0"} would work but clearly it didnt

The second part, I can see how it comes across as complicated and I do hope to keep it simple. Ill reword it in a moment I reckon.

My target market for me would be our current users on facebook as well as all people living locally within our region and just across the borders. Its basically anything thats unwanted, uneeded, wanted, for sale, giving to others or swapping?

many thanks,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-19-2010, 04:55 PM   #26
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,915
Rep Power: 71
seymourjames is a jewel in the rough
Default

Yes but no matter.

Use the smarty debug tool and see if the package ID is available to you in step3.tpl and if it is then you can put logic around the extras to say if it is not this package show the extras normally , else don't show them but set those extras.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
The SEO Book for all your search engine optimization needs
seymourjames is offline   Reply With Quote
Old 08-19-2010, 05:13 PM   #27
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

Hi again,

How would I construct the logic? I am relatively new to php let alone smarty so im still learning about the idea of it all lol.

but looking briefly at the debug tool the $productid is there

So I would have thought id start with
Code:
{if $allowFeatured=="Y"}
{if $productid =<"2"}
<p>
<label for="featured">{$smarty.const.LANG_ADD_FEATURED}{$smarty.const.LANG_COLON}</label>
<select name="featured" id="featured">
<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
<option value="Y"{if $cFeaturedPrice=="0"} SELECTED{/if}>{$smarty.const.LANG_YES} (+{$cFeaturedPrice|format_money})</option>
</select>
</p>
{elseif $productid =>"3"}
.....ok i gave it a shot...
{/if}
{/if}
To be honest I think im a mile off with my idea above...

(PS on the latest developer download there is a slight bug in the modify ad page. the character limit doesnt show when modifying a current ad).

Many thanks,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-19-2010, 06:43 PM   #28
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,020
Rep Power: 60
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

If it were me, I would do the reverse. Something like this:
Code:
{if $productid=="3"}
	<input type="hidden" name="featured" id="featured" value="Y">
{else}
	<p>
	<label for="featured">{$smarty.const.LANG_ADD_FEATURED}{$smarty.const.LANG_COLON}</label>
		<select name="featured" id="featured">
			<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
			<option value="Y"{if $cFeaturedPrice=="0"} SELECTED{/if}>{$smarty.const.LANG_YES} (+{$cFeaturedPrice|format_money})</option>
		</select>
	</p>
{/if}
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and 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 08-19-2010, 06:48 PM   #29
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

hi Mike,

But still keeping it inside of the original {if $allowFeatured=="y"} tag im guessing?

Many thanks,

Tom.
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-19-2010, 07:01 PM   #30
Customer
 
Join Date: Aug 2010
Posts: 97
Rep Power: 2
T0m1 is on a distinguished road
Default

Actually Mike,

How about this, this is basically doing what you suggested, but cutting out the extra if condition
Code:
{if $productid=="3"}
	<input type="hidden" name="featured" id="featured" value="Y">
{elseif $allowFeatured=="Y"}
	<p>
	<label for="featured">{$smarty.const.LANG_ADD_FEATURED}{$smarty.const.LANG_COLON}</label>
		<select name="featured" id="featured">
			<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
			<option value="Y"{if $cFeaturedPrice=="0"} SELECTED{/if}>{$smarty.const.LANG_YES} (+{$cFeaturedPrice|format_money})</option>
		</select>
	</p>
{/if}
Would that work do you reckon?

Many thanks
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
A couple of questions Unregistered Pre Sales Questions 4 07-10-2009 09:35 PM
Smarty {if} code not always showing up in some browers? forumosa Technical Support 3 10-11-2008 03:01 AM
A couple of questions Unregistered Pre Sales Questions 7 10-11-2006 09:08 PM


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


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