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

Hide Price based on Mfgr

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-05-2015, 11:38 AM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Hide Price based on Mfgr

I need to hide the price of a specific manufacturer so only the retail price shows and replace it with text like "Add to cart for price". Can someone do a quick if/then statement for me that does this??
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #2  
Old 01-05-2015, 11:41 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Hide Price based on Mfgr

{if $product.manufacturerid eq 'XXX'} SHOW TEXT {else} SHOW PRICE {/if}

fixed.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-05-2015, 11:56 AM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Re: Hide Price based on Mfgr

eeq gave me a blank page, eq works, but the SHOW PRICE still shows after the else.
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #4  
Old 01-05-2015, 12:00 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Hide Price based on Mfgr

So you just copy/paste as I posted There is an error - double ee in eeg... It should be "eg"
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 01-05-2015, 12:04 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Re: Hide Price based on Mfgr

I see that it does work, but I need to hide the price when that happens and the price looks like its in another if/else just below it (product_details.tpl)
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #6  
Old 01-05-2015, 12:19 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Hide Price based on Mfgr

You need to surround the existing code that shows price with this
{if $product.manufacturerid eq 'XXX'} SHOW TEXT {else} EXISTING CODE {/if}

Also replace XXX with the actual manufacturer id and make sure this info is available in the product array - you can use the webmaster mode to inspect the product array.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Dougrun (01-05-2015)
  #7  
Old 01-05-2015, 12:19 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Re: Hide Price based on Mfgr

I tried this, but it doesnt display aything.. where am i going wrong??

Code:
{if $product.manufacturerid eq '2'} <td class="property-name product-price" valign="top">Add to Cart for Price</td> <td class="property-value" valign="top" colspan="2"> {if $product.taxed_price ne 0 or $variant_price_no_empty} <span class="product-market-price">{alter_currency value=$product.taxed_price tag_id="product_alt_price"}</span> {if $product.taxes} <br />{include file="customer/main/taxed_price.tpl" taxes=$product.taxes} {/if} {else] <td class="property-name product-price" valign="top">{$lng.lbl_our_price}:</td> <td class="property-value" valign="top" colspan="2"> {if $product.taxed_price ne 0 or $variant_price_no_empty} <span class="product-price-value">{currency value=$product.taxed_price tag_id="product_price"}</span> <span class="product-market-price">{alter_currency value=$product.taxed_price tag_id="product_alt_price"}</span> {if $product.taxes} <br />{include file="customer/main/taxed_price.tpl" taxes=$product.taxes} {/if} {else} <input type="text" size="7" name="price" /> {/if} </td>
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #8  
Old 01-05-2015, 12:23 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Re: Hide Price based on Mfgr

also tried it with an {/if} at the end to close it out and still got nothing.
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #9  
Old 01-05-2015, 12:36 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 909
 

Default Re: Hide Price based on Mfgr

got it working, thanks!!
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #10  
Old 01-05-2015, 12:54 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Hide Price based on Mfgr

good, glad you got it working
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 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 12:02 PM.

   

 
X-Cart forums © 2001-2020