Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #121  
Old 04-04-2011, 04:51 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

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

X-Cart 4.4.x currently, but probably all previous versions are compatible also - I can't remember. Let me know if any problems...

Better Search Box:
If you want a custom search box on your X-Cart store that has an initial value of 'Search for products..." displayed, that when clicked turns blank so the user can type their search term without having to remove the text by hand & then when the search results are displayed, retains the term they just entered until they click back inside the box again, do this:

in customer/search.tpl find the following code (around line 20):

Code:
<input type="text" name="posted_data[substring]" class="text" value="{$search_prefilled.substring|escape}" />

and replace it with this:
Code:
<input type="text" name="posted_data[substring]" class="text" {if $main ne "search"}value="Search for products..." onfocus="if(this.value==this.defaultValue) this.value='';"{else}value="{$search_prefilled.substring|escape}" onfocus="if(this.value==this.defaultValue) this.value='';"{/if} />

Just done this for the nth time and thought it might help, in case anyone missed it.
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote

The following user thanks donavichi for this useful post:
godboma (04-04-2011)
  #122  
Old 04-08-2011, 09:45 AM
 
CanadaPOS CanadaPOS is offline
 

Member
  
Join Date: Nov 2007
Posts: 12
 

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

Trying to show an image on product.tpl only if wholesale prices are available for that product.

Is there an if statement that covers something like that?

Thanks in advance.
__________________
X-cart 4.1.9
Reply With Quote
  #123  
Old 04-08-2011, 09:55 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

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

Code:
{if $product_wholesale ne ""}...your image here...{/if}

that should do it.

Quote:
Originally Posted by CanadaPOS
Trying to show an image on product.tpl only if wholesale prices are available for that product.

Is there an if statement that covers something like that?

Thanks in advance.
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote

The following user thanks donavichi for this useful post:
CanadaPOS (04-08-2011)
  #124  
Old 04-08-2011, 03:31 PM
 
CanadaPOS CanadaPOS is offline
 

Member
  
Join Date: Nov 2007
Posts: 12
 

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

Thanks ... works great!!
__________________
X-cart 4.1.9
Reply With Quote
  #125  
Old 04-13-2011, 08:25 AM
  mizNRG's Avatar 
mizNRG mizNRG is offline
 

Senior Member
  
Join Date: Jun 2010
Posts: 157
 

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

I'm looking for and if/then statement that would either clear out the email field if it equals dummyemail@email.com (thus requiring the customer to fill it in) or require the email field to be changed upon initial login if membership id = 8.

What I'm looking to accomplish is to import a large list of customers when I do not have their email addresses. I've come to the conclussion that I'll have to do this with a dummy email instead. However, I need to require the customer to change this so that they will properly receive notifications rather than the dummy email receiving them.

Any help on this would be greatly appreciated!!
__________________
X-Cart 4.4.4 Gold
Reply With Quote
  #126  
Old 04-16-2011, 06:10 PM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

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

This may already have come up in this thread but I can't find it. I'm using 4.4.x and I don't seem to have a $user_membership variable. I want to use an if/then like the one above to show one thing on a static page if the user is a wholesale customer and something else if the user is not.
__________________
Version 4.4.2
Reply With Quote
  #127  
Old 04-21-2011, 11:03 PM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

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

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 ?
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #128  
Old 04-21-2011, 11:33 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

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

Code:
{if $smarty.get.pageid eq "1"} ... {/if}
__________________
xcartmods.co.uk
Reply With Quote
  #129  
Old 06-02-2011, 06:04 AM
 
godfatherantiques godfatherantiques is offline
 

Newbie
  
Join Date: Apr 2010
Posts: 5
 

Default Register as customer and provider on front end of site

What is needed to allow anybody to register as a customer and a provider. I'm thinking I need an {if statement to accomplish this, but I'm not quite sure what is needed. I'm hoping someone can point me in the right direction or tell me what needs to be done. I don't want the admin in control of creating provider accounts, but I would like to approve the providers as they sign up. Any help would be much appreciated.
__________________
X-Cart Pro 4.4.2
Reply With Quote
  #130  
Old 07-29-2011, 04:27 AM
 
dmpinder dmpinder is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 86
 

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

Quote:
Originally Posted by upupcreative
This may already have come up in this thread but I can't find it. I'm using 4.4.x and I don't seem to have a $user_membership variable. I want to use an if/then like the one above to show one thing on a static page if the user is a wholesale customer and something else if the user is not.

This should be close to what you need. I was having the same problem on my v4.3.1, and here is the solution:

1. In the file \include\check_useraccount.php find the following:
Code:
$mail_smarty->assign("usertype",$current_area);

... and paste underneath:
Code:
$smarty->assign("user_membership",$user_account["membership"]); $smarty->assign("user_membershipid",$user_account["membershipid"]);


This allows you to call {$user_membership} or {$user_membershipid} in the Smarty template to generate the name and ID number.

Note: You can create other variables by using the $user_account database request on line 155.

Hope this helps!

Darren
__________________
Darren

X-Cart Gold 4.3.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:42 PM.

   

 
X-Cart forums © 2001-2020