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)
-   -   Display Wholesale price (https://forum.x-cart.com/showthread.php?t=28659)

maniac 02-07-2007 12:26 PM

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.

maniac 02-08-2007 06:57 AM

Re: Display Wholesale price
 
Anyone? please...

phpmattk 02-08-2007 11:46 AM

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.

maniac 02-08-2007 06:27 PM

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.

phpmattk 02-08-2007 08:27 PM

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.

maniac 02-09-2007 06:53 AM

Re: Display Wholesale price
 
Very cool; This is goin gto help me tremendously...

Thank you!

maniac 02-09-2007 09:40 AM

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.

phpmattk 02-09-2007 05:07 PM

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.


All times are GMT -8. The time now is 04:48 PM.

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