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

Display Wholesale price

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-07-2007, 12:26 PM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default Display Wholesale price

I need to display both the default and wholesale price for a product regardless of weather or not a user gets the wholesale price...

Can someone help please...

Basically on prducts and product page:

display like this:

$20.00 Price; $17:50 Wholsale

When user checks out then they get the price that's associated with their group.

Thanks in advance.
__________________
Gold 4.1.6
Reply With Quote
  #2  
Old 02-08-2007, 06:57 AM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default Re: Display Wholesale price

Anyone? please...
__________________
Gold 4.1.6
Reply With Quote
  #3  
Old 02-08-2007, 11:46 AM
 
phpmattk phpmattk is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 44
 

Default Re: Display Wholesale price

Try turning on your debug console (edit the /smarty.php file and change the line $smarty->debug_tpl = "file:debug_templates.tpl"; to $smarty->debug_tpl = "file:debug.tpl"; then you'll be able to see the variables, not just the files)

Then browse to the product details page, that page does include the value you want, then search for that value in the console, you'll see it way down in a multidimensional array, its under $variants for me:

Code:
{$variants}Array (3) 450 => Array (11) productid => 16151 avail => 5 weight => 1.00 productcode => SKU162054002 def => empty price => 45.00 is_image => empty image_path_W => empty wholesale => Array (2) 0 => Array (5) quantity => 0 next_quantity => 10 membershipid => 0 price => 45.00 taxed_price => 45.00 1 => Array (6) priceid => 17586 quantity => 10 price => 27.00

You may have to loop through some stuff to get at it, but thats where it is. And you will probably have to do some more includes on your products/products_t page because its not available to that page by default, you can see what files are being used as well in the debug console.
__________________
-matt
version 4.1.5
Reply With Quote
  #4  
Old 02-08-2007, 06:27 PM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default Re: Display Wholesale price

Do I have to change any other settings in the store to see this? I changed smarty.php as you specified - but I don't see the variables anywhere.


Thanks in advance.
__________________
Gold 4.1.6
Reply With Quote
  #5  
Old 02-08-2007, 08:27 PM
 
phpmattk phpmattk is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 44
 

Default Re: Display Wholesale price

OH yeah, sorry, go into the admin area under general settings and check the box that says 'enable debug console', and you also have to have your popup blocker (if any) set to allow because it comes in a javascript popup.
__________________
-matt
version 4.1.5
Reply With Quote
  #6  
Old 02-09-2007, 06:53 AM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default Re: Display Wholesale price

Very cool; This is goin gto help me tremendously...

Thank you!
__________________
Gold 4.1.6
Reply With Quote
  #7  
Old 02-09-2007, 09:40 AM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default Re: Display Wholesale price

I'm almost there - just need a little more guidance;

I got it to do exactly what I need but it only works for registered users - basically when a user is logged in they see waht I want:
Quote:
$28.00 USA - $ 24.00 Latin America and the Caribbean Save 14%
But when the user is anonymous I get
Quote:
$28.00 USA - $ Latin America and the Caribbean
For registered users I am using:
Code:
{include file="currency.tpl" value=$product.list_price} {$lng.regionUSA} - {include file="currency2.tpl" value=$product.price} {$lng.regionLAC}
and for anonymous users I'm using:
Code:
{include file="currency.tpl" value=$product.list_price} {$lng.regionUSA} - {include file="currency2.tpl" value=$variants.wholesale.price} {$lng.regionLAC}

I'm obviously not retreiving the variable $variants.wholesale.price out correctly - I think - Is my syntax correct? or do I have to add anything to the variable because it's part of a multidimensional array?

Thanks in advance for your help.
__________________
Gold 4.1.6
Reply With Quote
  #8  
Old 02-09-2007, 05:07 PM
 
phpmattk phpmattk is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 44
 

Default Re: Display Wholesale price

Not sure, the array is going to be pieced together differently depending on the variants and other things as well. If its working for logged in people, the syntax is probably correct. Make sure that the data you want is even available to non logged in customers, typically it does not show you the wholesale price unless you're logged in as an approved wholesale member.
__________________
-matt
version 4.1.5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:05 AM.

   

 
X-Cart forums © 2001-2020