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

Dougrun 01-05-2015 12:59 PM

Re: Hide Price based on Mfgr
 
Now I need to make the list page work the same way. I tried products_list.tpl but nothing changed. What template shows the category lists?

Dougrun 01-05-2015 01:21 PM

Re: Hide Price based on Mfgr
 
ok, products_t.tpl is the file.
I see where the "Suggested Retail: $180.00, save 6%" text is but I cant find the price code above it. Any help?

Dougrun 01-05-2015 01:26 PM

Re: Hide Price based on Mfgr
 
found it..
<span class="price-value">{currency value=$product.taxed_price}</span>

Dougrun 06-08-2015 01:49 PM

Re: Hide Price based on Mfgr
 
bringing this back, is there any way to easily add more than one manufacturer to the condition?
{if $product.manufacturerid eq '2'}
i need manuf. # 2 and 47. How would i add 47??

Dougrun 06-08-2015 02:13 PM

Re: Hide Price based on Mfgr
 
I tried adding
or '47'
but that didnt work, it includes all mfg if I do that.

cflsystems 06-08-2015 02:22 PM

Re: Hide Price based on Mfgr
 
{if $product.manufacturerid eq '2' or $product.manufacturerid eq '47'}

Dougrun 12-31-2015 09:00 AM

Re: Hide Price based on Mfgr
 
ok, i'm trying to get this to work on xcarts xmobile module skin but every time I try it, the pages come up blank or give a server error. evidently those variables aren't loaded or something in that skin. Any thoughts on how to make it work?

nevermind, I got it working..


All times are GMT -8. The time now is 07:05 PM.

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