Jump to content

[Solved] Specials


Recommended Posts

Hi there,

I'm currently trying to customise a link for 'Specials' only to be displayed if there are actually items within the catalog containing a discounted item. Was hoping there'd be some simple coding to do this check - but having scoured the files I haven't really noticed anything!

Any help would be greatly appreciated!

Cheers

Link to comment
Share on other sites

To display a Specials link only when specials exist, you could put the following in the PHP file:

$special = Product::getRandomSpecial(intval($params['cookie']->id_lang));



then the following in the TPL file:

{if $special}<a href="{$base_dir}prices-drop.php">{l s='Specials'}{/if}

Link to comment
Share on other sites

Hi rocky,

Thanks for the reply. I've just tried it out (basically this is within a horizontal navigation bar) but when doing it in the .php and .tpl as suggested the link is removed even when there is items with the specials section. Any further suggestions on this?

I also tried moving the first bit of code into the header to see if it was a problem with that specific bit of coding - but to no prevail!

Thanks

Link to comment
Share on other sites

Sorry about this rocky, but again for some reason it's not working (I really do appreciate your help and assistance by the way!!!)

You're right, the

global $cookie; 

was missing but even inserting it (and trying all of the combinations of the $special didn't do the trick! It's pretty frustrating as I can see it's obviously working with the blockspecials - as that can be hidden using technique.

Therefore I took a look at what blockspecial.php was doing and I was suprised to see there was no mention of the

global $cookie; 

in there either!

Any further thoughts/suggestions with this?

Thanks again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...