| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Special Offers on certain pages only - how? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Is there a way of limiting which pages a module appears on
I want the special offers only to appear on the home page and a few other chosen pages Im using X-Cart 4.6.6 and the Ideal Reponsive template Ta Rob
__________________
X-Cart Gold 4.6.6 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Surround the code in the template with an if statement. For the home page, there is a commonly used example that I don't have in front of me, but it is something like
{if $main eq 'home' and $cat eq ''} Do this on home page {/if} If main = home -this checks if the variable main is equal to home, which is true on the home page and all of the category pages. That's why we need the second piece: and cat = nothing, to ensure that a category is not set. Combined these two only evaluate to true if on the home page. To set this up for other pages, you need to do something similar, but I can't suggest anything without knowing what type of page it is. Category page, product page, static page, etc.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
![]() That's great, i will give it a go, i now sort of get how it works, my next queries will be multiple pages
![]() im only looking at home page, and special offer page so im guessing this will be offers, and also on a custom page ive added Cheers Rob
__________________
X-Cart Gold 4.6.6 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() Great. Well if you get stuck feel free to ask questions.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#5
|
|||||||
|
|||||||
![]() Thankyou
Iive used the following code, and it vanished from my home page, but appeared on some of my catagories, from what i can see its the catagories that dont have sub catagories. {if $main eq 'home' and $cat eq ''} {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/new_offers_message.tpl"} {/if} {/if} I dont want any (at present) catagories to show the offers, only the home page and special offers ive managed to change it to new_arrivals and it worked ok (that was also removing the $cat bit) Rob
__________________
X-Cart Gold 4.6.6 |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Rob,
Here is the correct Smarty code for you version (I think): Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#7
|
|||||||
|
|||||||
![]() Thanyou, it has solved the main problem of displaying on every page,
however i still get the offers on certain catagories, it would seem that the offer is in relation to a product in that catagory (im assuming) as different offers appear on different catagories, which im guessing is a whole new problem as this i reckon relates to the module alone and not where to show a module on a page or not Rob v4.6.6
__________________
X-Cart Gold 4.6.6 |
|||||||
#8
|
|||||||||
|
|||||||||
![]() Rob,
Yes there is nothing like "Show module on page". Instead there are multiple places throughout the templates where code like you have above is used: Code:
Anywhere that the developer who wrote the module needed to make a template change, they would have wrapped a piece of code in an if statement like the one above. Use webmaster mode to inspect the templates on that category page, it should lead you to the template that needs to be edited. Since you don't want to display the offers on the category pages at all, you can probably just comment that code block out once you find it.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#9
|
|||||||
|
|||||||
![]() Yes, i figured i would have to add the code in more than one place, i shall have a look using the webmaster mode, thankyou for your help
Rob
__________________
X-Cart Gold 4.6.6 |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|