X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   common if/then modifications I make to x-cart... (https://forum.x-cart.com/showthread.php?t=8881)

Yalokin 12-13-2011 11:25 AM

Load Script and Images on ONE Page
 
Hello I need to load scripts and images only if user on one page and I can not specify page Id because it custom made module and all categories shown there as:

custom.php?cat=7000 or custom.php?cat=3450 and so on

Load script only on all of the module.php page with cat ID from 1 to 10000.

or simply custom.php page


thank you.

Yalokin 12-20-2011 09:36 AM

Re: common if/then modifications I make to x-cart...
 
Hello did you figure this out.

I try to do the same but with more scripts and css.

Also how to define page in if/else if it custom.php for example.


thank you



Quote:

Originally Posted by anandat
I want if else statement for static page.
For example if visitor click on static page link. The following javascript should be load

Code:

<head>
<script language="Javascript" src="http://gd.geobytes.com/Gd?after=-1"></script>
<script language="javascript">
if(typeof(sGeobytesLocationCode)!="undefined"&&sGeobytesLocationCode.indexOf('US')==0)
{
    document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=http://www.SomeDomain.com'>");
}
</script>
</head>


In short what if/else condition I should put between <head> </head> so that above javascript function load if person open static page id=1 ?


obac01 02-15-2012 06:28 PM

Re: common if/then modifications I make to x-cart...
 
Hi I customized the Fulfilment account to be able to add products, works great, now my client wants to hide some options from the add/edit product page, I would like the help of you guys to let me know an If/then statment to hide the options to the fulfilment staff. I have almost 3 days working on it and I cann't find the varieble to do this.

Thanks

totaltec 02-18-2012 11:28 PM

Re: common if/then modifications I make to x-cart...
 
Hi OBO1,
I haven't tried this bu I know that include/security.php assigns the user account flag to smarty:
$smarty->assign('current_membership_flag', $user_account['flag']);
and fulfillment staff's flag is FS I believe.

So maybe:
{if $current_membership_flag ne "FS"}
Show this stuff to regular admins.
{elseif $current_membership_flag eq "FS"}
Show this stuff only to Fulfillment Staff.
{/if}

obac01 02-21-2012 12:10 PM

Re: common if/then modifications I make to x-cart...
 
Quote:

Originally Posted by totaltec
Hi OBO1,
I haven't tried this bu I know that include/security.php assigns the user account flag to smarty:
$smarty->assign('current_membership_flag', $user_account['flag']);
and fulfillment staff's flag is FS I believe.

So maybe:
{if $current_membership_flag ne "FS"}
Show this stuff to regular admins.
{elseif $current_membership_flag eq "FS"}
Show this stuff only to Fulfillment Staff.
{/if}



Thank you Totaltec!! works Great!.
:D

Jon 05-31-2012 12:26 PM

Re: common if/then modifications I make to x-cart...
 
Quote:

Originally Posted by PhilJ
Code:

{if $smarty.get.pageid eq "1"}
...
{/if}



Better to use this code in case they are using CDSEO or clean urls which won't have the pageid in the url:

Code:

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


pauline 09-07-2012 06:07 PM

Re: common if/then modifications I make to x-cart...
 
Hi, could anyone please point me in the right direction, I'm trying to hide the add to cart, update, price and amount for products in just one category in the wishlist using if/else statement. I think I should be editing wl_products.tpl, would anyone know if this is correct.

Thank you,
Pauline.

totaltec 09-08-2012 06:51 PM

Re: common if/then modifications I make to x-cart...
 
Pauline, use webmaster mode to determine what template to edit. Follow the tutorial link in my signature if you don't know what I mean.

pauline 09-09-2012 09:03 AM

Re: common if/then modifications I make to x-cart...
 
Will Do,
thanks Mike.

Jon 10-11-2012 10:39 AM

Re: common if/then modifications I make to x-cart...
 
I added a list of some common statements I use in a tutorial at: X-Cart Common Smarty Statements.


All times are GMT -8. The time now is 06:41 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.