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)
-   -   Problem with hiding prices on variants only (https://forum.x-cart.com/showthread.php?t=30718)

kanjigirl 04-25-2007 02:22 PM

Problem with hiding prices on variants only
 
I've made a number of modifications to my client's cart based on what I've read here - I've edited customer/main/product.tpl and products.tpl so that prices will not show unless the user is logged in at the 'Wholesale' level.

This pricing scheme is *mostly* working. It's working on all the category pages, and it's hiding the 'buy now' button on the product page, but the one problem is the the price is being hidden on all product pages *except* the ones with variants. On those products I can see my 'you must be logged in to view prices' message flash for a fraction of a second and then the price appears.

I tried redefining wholesale prices for my variants, and that didn't help. I think they're set up correctly - I checked each box for each variant and assigned them to the 'Wholesale' membership level in the section at the bottom of the variants admin page, 'Modify wholesale prices for selected variants.'

Here's my code from customer/main/product.tpl that pertains to this, the 'paragraph' in the middle:

PHP Code:

<tr><td class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</td>
<
td valign="top">
{if 
$product.taxed_price ne 0 || $variant_price_no_empty}
<
font class="ProductDetailsTitle"><span id="product_price" style="white-space: nowrap;">

{* 
THIS IS THE LOGIN REQUIREMENT *}
{if 
$login eq "" or $user_membership ne "Wholesale" }You must be logged in as a wholesale buyer to view prices.
{else}

{include 
file="currency.tpl" value=$product.taxed_price plain_text_message=true}</span></font><font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price plain_text_message=true}
{/if}
</
span></font



Again, this is working perfectly for everything but variants.

Do I have this set up incorrectly? if not, how do I work it so my products with variants abide by the wholesale price rule?

hooter 04-25-2007 02:55 PM

Re: Problem with hiding prices on variants only
 
Hi Kanji,

Yes, the wholesale variants is a bit confusing - it is not tied to membership level, but rather it gives you the ability to offer discounted pricing on multiple items.

The file you want to look at to hide the product variants based on your criteria is in /skin1/modules/Product_Options/product_variants.tpl

kanjigirl 04-25-2007 03:44 PM

Re: Problem with hiding prices on variants only
 
I'm looking at this file (/skin1/modules/Product_Options/product_variants.tpl) but I don't understand where in this template I'm supposed to make the modification to *not* show prices unless the user is logged in at the wholesale level. Isn't this the page from the Admin section?

If I can't get this to work, is the alternative to change my variants to regular products? That's going to take a lot of time.

hooter 04-25-2007 04:01 PM

Re: Problem with hiding prices on variants only
 
I'm sorry Kanji,

I may have given you erroneous info, I'm in a bit of a rush right now but will come back to this thread if someone hasn't already answered your question properly.

kanjigirl 04-30-2007 09:43 AM

Re: Problem with hiding prices on variants only
 
Anyone? This is kind of a big deal for me... is there another way to assign options to an item without using variants? Can I assign colors or styles as regular options with price-changing but just leave the price change at + or - 0.00?

wjbrewer 04-30-2007 11:02 AM

Re: Problem with hiding prices on variants only
 
Variant Prices are loaded through JavaScript using the "product_price" id. Try the code as it is below. I did not test this, and it may cause a Javascript error, in which case I believe you will need to edit the skin1/modules/Product_Options/func.js file.

Code:

<tr><td class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</td>
<td valign="top">
{if $product.taxed_price ne 0 || $variant_price_no_empty}

{* THIS IS THE LOGIN REQUIREMENT *}
{if $login eq "" or $user_membership ne "Wholesale" }You must be logged in as a wholesale buyer to view prices.
{else}

<font class="ProductDetailsTitle"><span id="product_price" style="white-space: nowrap;">{include file="currency.tpl" value=$product.taxed_price plain_text_message=true}</span></font><font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price plain_text_message=true}
{/if}
</span></font> 


kanjigirl 05-04-2007 07:58 AM

Re: Problem with hiding prices on variants only
 
That did it - thank you so much!


All times are GMT -8. The time now is 06:42 PM.

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