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 Price based on Mfgr (https://forum.x-cart.com/showthread.php?t=70910)

Dougrun 01-05-2015 11:38 AM

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??

cflsystems 01-05-2015 11:41 AM

Re: Hide Price based on Mfgr
 
{if $product.manufacturerid eq 'XXX'} SHOW TEXT {else} SHOW PRICE {/if}

fixed.

Dougrun 01-05-2015 11:56 AM

Re: Hide Price based on Mfgr
 
eeq gave me a blank page, eq works, but the SHOW PRICE still shows after the else.

cflsystems 01-05-2015 12:00 PM

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"

Dougrun 01-05-2015 12:04 PM

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)

cflsystems 01-05-2015 12:19 PM

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.

Dougrun 01-05-2015 12:19 PM

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>


Dougrun 01-05-2015 12:23 PM

Re: Hide Price based on Mfgr
 
also tried it with an {/if} at the end to close it out and still got nothing.

Dougrun 01-05-2015 12:36 PM

Re: Hide Price based on Mfgr
 
got it working, thanks!!

cflsystems 01-05-2015 12:54 PM

Re: Hide Price based on Mfgr
 
good, glad you got it working


All times are GMT -8. The time now is 02:08 PM.

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