Jump to content

How to show wholesale price?


Recommended Posts

Hello,

I find how to show wholesale price (like retail price) in product.

I put this in product.tpl (at <!-- prices --> ):

<!-- Showing wholesale price-->
{if $product->wholesale_price}{l s='Wholesale price: '}{$product->wholesale_price|escape:'htmlall':'UTF-8'} € HT{/if}

But, I still have 2 problems:

First problem, I dont know how to convert decimal number. For example, if I put 200.000000 for wholesale price and 300.000000 for retail price in the back office, it shows 200.000000 for wholesale price and 300.00 for retail price (or 300 following options). How to convert automatically wholesale price like retail price?

Second problem, when i generate an attribute for a product in the back office, i can both change wholesale price and retail price for this new attribute (in the back office). But only the retail price changes in the front office. What must I do in order to also change the wholesale price...

If you can help me, that would be great...

Thanks

Link to comment
Share on other sites

In Admin when you select a product, if you look at the tabs below "Current Product" you'll see one of them is "Discounts." You can create Quantity Discounts here. Perhaps this would be a good way to do wholesale pricing.

Link to comment
Share on other sites

OK, as long as you understand that it will be used for display only and not for actual pricing.

What you'll want to do is:
a) Create a function to return this value, formatted using number_format in classes/Product.php.
B) Use "assign" to put it into a template in product.php
c) Display the assigned variable in your template in themes/YOUR THEME/product.tpl.

Link to comment
Share on other sites

Thanks for your reply. For the moment I put this in product.tpl in order to show the wholesale price :


{if $product->wholesale_price}{l s=‘Wholesale price: ‘}{$product->wholesale_price|escape:‘htmlall’:‘UTF-8’} € HT{/if}

That works (wholesale price is shown) but now I need to convert the decimal number (from example.000000 to example.00). I think I need to use a function like this one :

{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}

But I dont know where I should put it and how to convert it for wholesale_price...

Any ideas??

Link to comment
Share on other sites

  • 4 months later...
  • 7 months later...

I solved the problem!

In the database at the product table, i changed the wholesale_price properties.
Changed the decimal from 20,6 to 20,2 and now i have the result i wanted! just 2 decimals are showing at the wholesale price.

:D hope this gonna help for others as well! :D

Link to comment
Share on other sites

  • 1 month later...

Interesting. I do need to show wholesale prices as well. I accessed my MySQL data base and the product table but I don't know how to change the wholesale_price properties. Could you explain how did you do that, please? I will be very grateful. Thank you very much for your help.

Darius

Link to comment
Share on other sites

  • 3 months later...

I am trying now to do a new thing, now that i can c the wholesale_price on the product page, i want to enable it for the discount as well... anyone know anything about this? coz the discount worx just for the price.


I inserted this in front of the

, so the wholesale price shows before the final price.

{l s='Wholesale price:'}

{$product->wholesale_price} {$wholesale_price} euro/dollar....what ever




And now trying to rewrite it if is possible for the discount as well....


Any help would be great.
cheers
Link to comment
Share on other sites

  • 1 year later...

I solved the problem!

 

In the database at the product table, i changed the wholesale_price properties.

Changed the decimal from 20,6 to 20,2 and now i have the result i wanted! just 2 decimals are showing at the wholesale price.

 

:D hope this gonna help for others as well! :D

Hello Darqor,

have you tried it in the new 1.5 version. I made it in one of my sites in the 1.4.6 version and it worked, but in the 1.5 it doesn't work. Do you have some idea?

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...