Hi, from Nikolay ;-)

Blogs to post something that too big for Twitter and does not belong to FaceBook

Menu

Skip to content
  • Home
  • About
  • Image Extensions
  • SEO Tips and Tricks
  • Top Ten

Tag Archives: {if} {else} statement tweaking for x-cart

if/else Statement Tweaking for X-Cart

July 3, 2013nikolaygul web design agency

if/else or if/then statments

common if/else or if/then statements for x-cart

Quick collections of X-Cart if/else or “if/then” statements maybe useful in the future as reference.

there is no if/then in x-cart 😉

Very simple ideas:

What if I want something like this:
if cat=1 [html1]
if cat=2 [html2]
else [html3]

{if $cat == 1}

-- do this --

{elseif $cat == 2}

-- do this --

{else}

-- if neither is true do this --

{/if}

Very nice post on tweaking x-cart: common if/then modifications to x-cart

Targeting a whole Sub-Category with one if statement

Home Page

{if $main eq “catalog” AND $current_category.categoryid ne “”}

I am on the home page.
{/if}
Also for home page:
if / else code to show one block of content on home page
 (skin1/customer/home.tpl), after line ““:
{if $main eq "catalog" and $cat eq ""}
- main page, home.php
{else}
- not main page, home.php
{/if} 
more details here: http://forum.x-cart.com/showthread.php?t=37979
and
if/else for header.tpl to display different header on customer home page
http://forum.x-cart.com/showthread.php?t=37583

Any Category

{if $main eq “catalog” AND $current_category.categoryid gt 0}
I am on a category listing page.
{/if}

Specific Category (replace X with the numeric categoryid)

{if $current_category.categoryid eq X}
I am on category X.
{/if}

Any Product

{if $main eq “product”}
I am on the product details page.
{/if}

Specific Product (replace X with the numeric productid)

{if $product.productid eq X}
I am on product X.
{/if}

Any Static Page

{if $main eq “pages”}
I am on a static page.
{/if}

Specific Static Page (replace X with the numeric pageid)

{if $page_data.pageid eq X}
I am on page X.
{/if}

Manufacturer Listing

{if $main eq “manufacturers”}
I am on the manufacturers listing page.
{/if}

Any Manufacturer

{if $main eq “manufacturer”}
I am on the page of a specific manufacturer.
{/if}

Specific Manufacturer Page (replace X with the numeric manufacturerid)

{if $manufacturer.manufacturerid eq X}
I am on manufacturer X.
{/if}

Shopping Cart

{if $main eq “cart” OR $main eq “checkout” OR $main eq “order_message”}
I am in the checkout process.
{/if}

Checkout Process

{if $main eq “checkout” OR $smarty.get.mode eq “checkout” OR $main eq “order_message” OR $smarty.get.mode eq “order_message”}
I am in the checkout process.
{/if}

Anywhere Except Checkout

{if $main ne “cart” AND $main ne “checkout” AND $smarty.get.mode ne “checkout” AND $main ne “order_message” AND $smarty.get.mode ne “order_message”}
I am in not in the checkout process.
{/if}

Only If Logged In

{if $login ne “”}
The user is logged in.
{/if}

Only If Logged Out

{if $login eq “”}
The user is logged out.
{/if}

Sources:

{if} {else} statement tweaking

If statement with multiple categories

if / else code to show one block of content on home page

if/else for header.tpl to display different header on …

http://www.websitecm.com/x-cart-tutorials/x-cart-code-snippets/common-smarty-statements-for-x-cart-development/

more to remove left menu:
{** Vertical  X-Cart menu start
{if $cat eq “264” or $cat eq “271” or $cat eq “275”}
Code
{else}
Code
{/if}

{if $cat ne “31542”}
code
{/if}

{if $cat eq “31549” or $cat eq “31550” or $cat eq “31552” or $cat eq “31644” or $cat eq “31553” or $cat eq “31551”}
code
{/if}
**}

<div style=”text-align:center;”>
<!– above left menu links from module –>
<br>{{if $cat == 31682 || 31683 || 31795 ||31841}}
{{if $cat eq “31682” or $cat eq “31683” or $cat eq “31795” or $cat eq “31841” or $cat eq “31841” or $cat eq “31841”}}
{if $cat eq “31683” or $cat eq “31822” or $cat eq “31830” or $cat eq “31682” or $cat eq “36425”}
{else}
<br>
{include file=”customer/flyout-xcart.tpl”}
{/if}

{***
{if $main eq “catalog” || $main eq “search” || $main eq “pages”}
{include file=”customer/social-media.tpl”}
{/if}
***}

Share this:

  • Email
  • WhatsApp
  • Share on Tumblr
  • Print
  • Telegram
  • Tweet
  • Pocket

Like this:

Like Loading...
Businesscommon if/thenCustomerE-CommerceElectronic commerceHome pageHTMLif/else modifications x-cartif/else or if/then statmentsif/else Statement Tweaking for X-Cartif/then modificationsLoginProduct (business)Shopping cartx-cartx-cart development{if} {else} statement for x-cart{if} {else} statement tweaking for x-cart

Search for Web Designers

Recent Posts

  • 💰European Union hit GOOGLE with $5 billion Antitrust Fine
  • Binocular Guide – How to Choose the Best Binoculars?
  • Anonymous Customer Who They Are and How to Track Them?
  • Complete Web Upgrade: ga.js / dc.js to analytics.js
  • Judo and Sambo Clinic in Syracuse #JUDO #SAMBO #Syracuse #MartialArt #Karate
  • Favicon, Apple Touch icon, Title icon – What it is and Why do web site need it?
  • How to Clear Browser Cache?
  • #Git and #SSH – Version Control System #Tips #CommandLine
  • Comparison of #versioncontrol #software and GitHub.com VS BitBucket.org for #Git
  • What is IP – Shared and Dedicated IP Address?
  • Authorize.net – Difference Between #SIM vs #AIM vs #CIM vs #DPM
  • 20 kids questions that adults cant answer
  • How to apply #CSS #styles only to IE? CSS #Hacks for #IE
  • About #Poodle #Hack of #SSLv3 and How to Secure Online Business
  • Find and Replace Text in MySQL Database
  • Heartbleed Security Update
  • How to Avoid Answering the Questions? 9 ТЕХНИК УХОДА ОТ ПРЯМОГО ВОПРОСА
  • Easy htaccess tricks
  • if/else Statement Tweaking for X-Cart
  • Google Custom Search Engine

Twitter Updates

  • 🏈#Job Perfectly Done #CISA💂‍♀️team, #Patriots Won #SuperBowlLIII 😇 New England Patriots #battle the Los Angeles… twitter.com/i/web/status/1… 3 days ago
  • RT @infotechusa: LIFARS, LLC + Microsoft Q1 Cyber Intelligence Briefing at Microsoft Times Square. Scan #QR for more info. Mark Your Calend… 3 days ago
  • #YearOfThePig How to Sound Like a Favorite Animal of the Year - #PIG? 2019 -Year of the Pig: #Fortune and… twitter.com/i/web/status/1… 1 week ago
  • Ondrej Krehel @ondrejkrehel from @LIFARSLLC on #decision support and #knowledge sharing: youtu.be/x4aRegC5a7k F… twitter.com/i/web/status/1… 1 month ago
  • #japan #tuna #fish #sushi #food #money #market #Tokyo twitter.com/DavidAndelman/… 1 month ago
Follow @NikolayGul

Follow me on Twitter

My Tweets
February 2019
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728  

Tags

22 immutable Law of Marketing Advanced Television System Committee Al Ries analog to digigal tv analog to digital Analog to Digital Transition ATSC Behind the Financial Market Crisis budget cut Business digital radio station in ny digital television embeded map embed map to web site financial crisis losses Financial Fitness financial market Financial Market Crisis Find and Replace in MySQL google google map google map api google map developer google map embeded sample How do I merge 2 columns into one how to create sitemap How to embed flash video into google map info box? how to embed map how to improve seo how to plan and organize website effectively how to prevent financial losses IOS Learn from others how to prevent financial losses link strategy MySQL MySQL Database New York budget cut New York PBS NY Budget Cut NYPBS Page Rank PBS stations in ny pbv preview before visit web page preview before click preview before visit Proper Link Strategy Public Broadcasting System public tv public tv station support REPLACE() function Replace Text in MySQL restor ny pbs fundings restor pbs funding save ny pbs Save NY PBS Stations - Prevent NY Budget Cut save pbs Search engine optimization seo good practice Shopping cart site map Site map - Good Practice site map good practise SQL query text_string the media that you use update database visual site map wcny.org Web Developer and Designer in Syracuse, CNY and New York what is Google PageRank what is hdtv What is PageRank? What Is podcasting news? x-cart xml sitemap

My RSS Feed

RSS Feed RSS - Posts

RSS Feed RSS - Comments

RSS Syracuse Web Design and Programming

  • Web Development Workflow
    YouNeedItAll.com - Domain name Sale, Hositng, Web Design, PPC, Marketing for Your Business. Planning your website To plan and organize your site effectively, you must do much more than determine what the site will look like and where the files will go. You need to examine the site goals and audience profiles. Additionally, you should consider your site’s nav […]
    yniator
  • SEO for Voice Search?
    YouNeedItAll.com - Domain name Sale, Hositng, Web Design, PPC, Marketing for Your Business. Well, with the rise of the voice search across the devices, starting with the smartphones and tablets, there might be a possible change occurring... The post SEO for Voice Search? appeared first on YouNeedItAll.com - Design, PPC, Marketing for Your Business.
    yniator
  • Do Long-tail Keywords Matter?
    YouNeedItAll.com - Domain name Sale, Hositng, Web Design, PPC, Marketing for Your Business. Before going any further in explaining that, let us just state that they surely do. Actually, as multiple types of research show us, an average. The post Do Long-tail Keywords Matter? appeared first on YouNeedItAll.com - Design, PPC, Marketing for Your Business.
    yniator
  • What is local SEO?
    YouNeedItAll.com - Domain name Sale, Hositng, Web Design, PPC, Marketing for Your Business. A local Search Engine Optimization is a concept for any multilanguage website (preferably an e-commerce one) for optimizing and increasing its rankings... The post What is local SEO? appeared first on YouNeedItAll.com - Design, PPC, Marketing for Your Business.
    yniator
  • Why SMBs Need Social Media
    YouNeedItAll.com - Domain name Sale, Hositng, Web Design, PPC, Marketing for Your Business. When I was just a student studying the advertising at the uni back in the day, my professor used to tell me that it's only the big companies that can and must afford the luxury of a PR. The post Why SMBs Need Social Media appeared first on YouNeedItAll.com - Desi […]
    yniator

Blogs I Follow

  • Social Networking Lab: Search Engine & Social Media Marketing, B2B and Technology News
  • Salt City Karate, Kick Boxing, Tai Chi and Judo - Fitness Center
  • ОМУ ММФ-Одесское мореходное училище Министерства Морского Флота СССР
  • ☼ Labels on the fly - Custom Designed Labels
  • Hi, from Nikolay ;-)
Social Networking Lab: Search Engine & Social Media Marketing, B2B and Technology News

Design, Develop and Promote Website for Online Businesses

Salt City Karate, Kick Boxing, Tai Chi and Judo - Fitness Center

1900 Brewerton Rd Mattydale, NY 13211 (315) 451-4244

ОМУ ММФ-Одесское мореходное училище Министерства Морского Флота СССР

OMY MMF-ОМУ ММФ-Выпускники 9 роты Эксплуатационного отделения 1984-1988

☼ Labels on the fly - Custom Designed Labels

► Create personalized wedding, party favors, food labels, craft stickers, wine and beer bottle labels

Hi, from Nikolay ;-)

Blogs to post something that too big for Twitter and does not belong to FaceBook

Cancel
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
%d bloggers like this: