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

Hide the price on the storefront

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-21-2014, 08:01 PM
 
nandos07 nandos07 is offline
 

Senior Member
  
Join Date: Jun 2011
Posts: 135
 

Default Hide the price on the storefront

Hi,


I would like to hide the price of my products on my website and only show the price once the customers have logged in, Does anyone have any idea how to do it? Thank you
__________________
x-cart 5.1.4.

I don't have any add-on
Reply With Quote
  #2  
Old 10-21-2014, 08:38 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Hide the price on the storefront

You posted in XC5 forum but signature says XC4 - so which one is it? Either way though it will require custom coding for this work. If it is for XC4 you can find some tips here on the forum.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 10-27-2014, 11:31 AM
 
nandos07 nandos07 is offline
 

Senior Member
  
Join Date: Jun 2011
Posts: 135
 

Default Re: Hide the price on the storefront

Quote:
Originally Posted by cflsystems
You posted in XC5 forum but signature says XC4 - so which one is it? Either way though it will require custom coding for this work. If it is for XC4 you can find some tips here on the forum.
I have two x-cart, the other one is still XC 4, my newest store is XC5
__________________
x-cart 5.1.4.

I don't have any add-on
Reply With Quote
  #4  
Old 10-30-2014, 03:27 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Hide the price on the storefront

You will need to write a mod for this task. If you are ready, I can help.
As a first step, please create an empty module according to the guide here:
http://kb.x-cart.com/display/XDD/Step+1+-+creating+simplest+module
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 01-30-2015, 07:58 AM
 
Burpomatic Burpomatic is offline
 

Member
  
Join Date: Jan 2015
Posts: 18
 

Default Re: Hide the price on the storefront

Hello,

I'd also be interested in this. I already have created a module.

Thank you!
__________________
Alex

Business 5.3.2.5 Crisp White
Reply With Quote
  #6  
Old 02-01-2015, 05:03 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Hide the price on the storefront

Look at the code used for the account links. It shows one list when logged in, another when not. So the effect you want should be easily achieved by following that example, overriding the template file with your module and adding the conditional IF statement.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #7  
Old 02-02-2015, 03:37 AM
 
Burpomatic Burpomatic is offline
 

Member
  
Join Date: Jan 2015
Posts: 18
 

Default Re: Hide the price on the storefront

Hello Mike,

thank you for your answer. Unfortunately I'm not overly familiar with X-cart yet, could you point me which files exactly I should modify with a module?

Thanks again,
__________________
Alex

Business 5.3.2.5 Crisp White
Reply With Quote
  #8  
Old 02-02-2015, 04:45 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Hide the price on the storefront

Ok, so here is the Flexy code that checks if a user is logged in:

Code:
<ul class="account-links" IF="isLogged()"> Logged in code goes here. </ul>

I would probably overwrite: default/en/common/price_plain.tpl I haven't tested this but you could try wrapping it in a div like this:
Code:
<div IF="isLogged()"> <div class="product-price {getFingerprint()}"> <list name="product.plain_price.head" /> <ul class="product-price"> <list name="product.plain_price" /> </ul> <list name="product.plain_price.tail" /> </div> </div>
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following 2 users thank totaltec for this useful post:
Burpomatic (02-02-2015), tony_sologubov (02-02-2015)
  #9  
Old 02-02-2015, 06:14 AM
 
Burpomatic Burpomatic is offline
 

Member
  
Join Date: Jan 2015
Posts: 18
 

Default Re: Hide the price on the storefront

Thanks Mike, your solution seems to work. For the record, here's what I've done.

Using CustomSkin, I've created the file \xcart\skins\custom_skin\default\en\common\price_p lain.tpl containing the following code :

Quote:
Originally Posted by totaltec
Code:
<div IF="isLogged()"> <div class="product-price {getFingerprint()}"> <list name="product.plain_price.head" /> <ul class="product-price"> <list name="product.plain_price" /> </ul> <list name="product.plain_price.tail" /> </div> </div>

After activating CustomSkin, the prices only show up when signed in. Thanks again for the help!
__________________
Alex

Business 5.3.2.5 Crisp White
Reply With Quote
  #10  
Old 09-08-2015, 01:03 PM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default Re: Hide the price on the storefront

Hi Mike,


I have added in theme_tweaker/default/en/common/price_parts/price.tpl the following:

<div IF="isLogged()">
<li><span class="price product-price">{formatPrice(getListPrice(),null,1):h}</span></li>
</div
>

This is good but basically as soon as someone hits "Register" and enter an email address (fake or not) and a password he/she is logged in. What statement could we add to have prices showing up ONLY when registrant as been approved, for example, as a wholesaler after a "pending" request?

Thank you for your help.

Philippe

Setting up XCart 5.2.6
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 07:23 AM.

   

 
X-Cart forums © 2001-2020