View Single Post
  #51  
Old 05-15-2007, 12:54 PM
 
tony galfano tony galfano is offline
 

Newbie
  
Join Date: Mar 2007
Posts: 8
 

Default Re: common if/then modifications I make to x-cart...

Hi,

Great stuff here! I'm a newbie with xcart and smarty and am having some problems hiding the pricing and buying abilty from all but one membership group. I have a category with 42 subcategories with 12 products in each that are only for sale to Wholesale members. However, the client wants all visitors to see these products and only make them available for sale to wholesale members. So, he wants to hide the prices from regular visitors.

I was reall encouraged by this post and am trying to use if/then logic based on one of the examples above to accomplish this. Seems to me that the products _t.tpl and the products.tpl need to be modified?

Here's what I tried in the products_t.tpl:

{if $user_membership eq "Wholesale"}
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<font class="ProductPrice">{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{else}
Wholesale Only
{/if}

I was trying to get the price to show up only if the user is logged in as a Wholesale member, and if not, to show "Wholesale Only". But this just causes the page to display code where images should be and blows the page formatting apart.

The solution can't be far from this and I'm continueing to hack away. Any help is greatly appreciated.

Thanks in advance,

Tony
__________________
Tony Galfano
LC 2.2.21
XCart Gold 4.18 w/Fashoin Mosaic Skin
XCart Gold 4.18
Reply With Quote