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

hide the Price until customers login.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-18-2008, 02:37 PM
 
tropitek tropitek is offline
 

Member
  
Join Date: Sep 2007
Posts: 13
 

Default hide the Price until customers login.

Hello, I have hunted high & low & have really only found out dated info.
**please help** I have been reading and searching for hours.

I need to hide the Price until customers login.

Please advise were to place the code below in product.tpl & products.tpl
Even better a copy & paste of the whole .tpl files would speed things up for future members.

THANK YOU IN ADVANCE FOR YOUR HELP.. Still Learning

this is from the Sticky
************************************************** **
9. Ah, one more before I hit the bed - ever wanted to display something based on whether a customer was not only logged in, but whether or not they had a "membership level" as well?

The "if logged in" part is easy:


Code:
{if $login ne ""} display this {/if}


The above tag will display the "display this" text if a person has logged in. If they have not, it will display nothing.

Now, determining whether they have a membership level is a different tag:


Code:
{if $user_membership ne ""} display this {/if}


The above tag will only display the text if a membership level is detected by x-cart. Useful if you have "member-only" pages or messages. I have used this in the past to surround pricing tags in product.tpl and products.tpl, as well as for displaying navigation tabs, etc.

It is also useful for displaying a message such as "become a member for extra savings, click here" if you want non-members to feel like they should check out becoming a member of your store when they are looking at products.

Another useful place for this tag is on your static pages - many people have complained of not having "content protection" on x-cart - well, this is how you do it. Create your static page, make sure you have "parse smarty tags in static pages" checked in your general setting for static pages, and then at the top of your html where your content begins, simply put that tag in there surrounding your "real" content, and then an {else} for your message to people who don't have the membership.

Something like this:


Code:
{if $user_membership ne "Level 1"}I'm sorry, you don't have a membership, so this content is not accessible. Please click here to become a member and get the goodies.{else}Your real html content{/if}
__________________
my new xcart 5 link is here https://www.tropitek.net/xcart/
my old xcart 4 link is here http://www.tropitek.net/wholesale/home.php


X-Cart Pro version 4.7.?
PHP 5.6
MySQL client 5.1.63
Operation system Linux
Reply With Quote
  #2  
Old 06-19-2008, 10:37 AM
 
tropitek tropitek is offline
 

Member
  
Join Date: Sep 2007
Posts: 13
 

Default Re: hide the Price until customers login.

By the amount of views and no answers, i guess this is a question worth getting an answer PRO's

thanks again Paul
__________________
my new xcart 5 link is here https://www.tropitek.net/xcart/
my old xcart 4 link is here http://www.tropitek.net/wholesale/home.php


X-Cart Pro version 4.7.?
PHP 5.6
MySQL client 5.1.63
Operation system Linux
Reply With Quote
  #3  
Old 06-19-2008, 10:56 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: hide the Price until customers login.

Paul,

You posted your own answer.

Quote:
{if $login ne ""} display this {/if}

The inverse is
Quote:
{if $login eq ""} display this {/if}

Find where the price is displayed in your template. Before the price display, put something like this in (you will have to fight the tables and divs):

Quote:
{if $login eq ""} Please login to see the price. {/if}

And of course, wrap this around the price code:

Quote:
{if $login ne ""} PRICE CODE GOES HERE {/if}

This is a relatively easy smarty hack, and a good way to dive in and learn some basic smarty. Please report back once you have mastered this.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 06-20-2008, 10:37 AM
 
tropitek tropitek is offline
 

Member
  
Join Date: Sep 2007
Posts: 13
 

Default Re: hide the Price until customers login.

Played around with this tooo long,
will pay to get is done.
any pro's can quote me please.
__________________
my new xcart 5 link is here https://www.tropitek.net/xcart/
my old xcart 4 link is here http://www.tropitek.net/wholesale/home.php


X-Cart Pro version 4.7.?
PHP 5.6
MySQL client 5.1.63
Operation system Linux
Reply With Quote
  #5  
Old 06-21-2008, 06:43 PM
 
MOC MOC is offline
 

Senior Member
  
Join Date: Oct 2002
Posts: 171
 

Default Re: hide the Price until customers login.

save your money and figure it our for yourself. Believe me . I know what i'm talking about ) payed enough money in the last couple of years.

Try to upgrade this working code for 3.5.14 to 4.1.9. I using this code in my 3.5.14

Code:
{if $customer_info.membership eq "Wholesale"}Display Special Content{else}{/if}

Play around with something like this:

Code:
{if $login ne "" and $customer_info.membership eq "Wholesale"} display membership info {else}{/if}
__________________
X-Cart Gold Version 3.5.14 (Live)
X-Cart Gold Version 4.1.10 (in dev)

Modification for 4.1.10
Run with 1 License, 1 Database up to 5 Shops with different domains, config, categories and more. click here for informations
Reply With Quote
  #6  
Old 08-22-2008, 06:06 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: hide the Price until customers login.

I too am working on the syntax for this. If the general public or prospective customer comes to our site, I only want them to see 'Please call for pricing'. Only a customer assigned to a membership level will see their pricing.

I've found one instance so far in the customer/main/products.tpl file to change lbl_our_price where I want the customer to see 'Your Price' and the other lbl_enter_your_price to be 'Please call for pricing'. Any suggestions here would be greatly appreciated.
__________________
______________
version 4.1.9 Gold
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 01:57 PM.

   

 
X-Cart forums © 2001-2020