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)
-   -   hide the Price until customers login. (https://forum.x-cart.com/showthread.php?t=40594)

tropitek 06-18-2008 02:37 PM

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}

tropitek 06-19-2008 10:37 AM

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

carpeperdiem 06-19-2008 10:56 AM

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.

tropitek 06-20-2008 10:37 AM

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.

MOC 06-21-2008 06:43 PM

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 :o) 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}


ChristineP 08-22-2008 06:06 AM

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.


All times are GMT -8. The time now is 03:08 AM.

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