Jump to content
Sign in to follow this  
Steve9R

TotalB2B 1.2 -Missing argument 3 for display_price

Recommended Posts

Hi All..

 

Ive read through hundreds of posts today trying to fix this..

 

I am only a recent convert across from PhpShop to OsCommerce.. and am setting up a test shop at the moment..

 

I finally worked my way through all the 'features' and the shop is running fine using Australian AUD currency as primary & USD as Secondary, with TotalB2B 1.2 loaded..

 

However, when you select a product to view, it loads product_info.php the $content section is perfect, but on the top of the screen above the banner (where the errors normally print in pink), it says

 

"Warning: Missing argument 3 for display_price() in /httpd/www/catalog/includes/classes/currencies.php on line 72"

 

now i know a few threads have discussed this, and ive tried modding the product_info.php to no avail..

 

I have special prices hide set as false, and only 1 price per product, Ive only setup one discount group, and the standard product pricing...

PHP version is 4.3.8

 

the offending section in product_info.php is a TotalB2B patch (part of the contrib src), and is :

      //TotalB2B start
         $query_special_prices_hide = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration
_key = 'SPECIAL_PRICES_HIDE'");
     $query_special_prices_hide_result = tep_db_fetch_array($query_special_prices_hide);
     if ($query_special_prices_hide_result['configuration_value'] == 'true') {
               $products_price = '<span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_t
ax_rate($product_info['products_tax_class_id'])) . '</span>';
         } else {
           $products_price = '<s>' . $currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_
get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodis
count($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
         }
     //TotalB2B end

 

can someone give me a clue as to why Im seeing this ?

 

Thanks in advance..

Steve

Share this post


Link to post
Share on other sites

BUMP ?

 

Actually the CODE snippet ive put in above isnt the offending code.. but im still drawing blanks as to why im seeing this error.. ?

 

anyone ?

 

Steve

Share this post


Link to post
Share on other sites

Ok.. I have solved my own problem.. i wiped the entire the site and removed all tables and started again..

 

MS2 clean install.. TotalB2b 1.2 install.. all working fine..

 

The only thing i can put it down to could have been that I think i installed the b2b release before the totalb2b one ?.. otherwise.. there was no real reason or difference between the 2 installs.. bizarre..

 

Steve

Share this post


Link to post
Share on other sites

Ah ha..

 

I worked out how it happened..

 

Multiple contributions.. not patching manually.. but doing installs via contrib instructions.. no good..

 

you can install the first contribution on a clean load of MS2.2, but any subsequent ones that you need, need to be manually migrated into the already modified code..

 

Im off to migrate BTS now.. enjoy! :)

 

Steve

Share this post


Link to post
Share on other sites

I had the same error message, and I believe I've seen others with it as well. There is actually a really simple reason for the problem (and a really easy fix).

 

If you look in your currencies.php file at line 72, you will see that it is expecting 4 pieces of data to be sent to it - but the totalb2b contribution is only sending through 3. Since the totalb2b contribution (in currencies.php) seems to be expecting 4, it complains when only 3 come through...

 

The following code is similar to what totalb2b script contains, in, for example, product_info.php (but not limited to this one file):

 

$currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

The currencies.php class has the following in it (at least mine does):

function display_price($products_id, $products_price, $products_tax, $quantity = 1)

 

You can see that 3 pieces of data are being sent, but the class expects to receive 4.

 

All you need to do is in each file that uses the display_price, put in the following as the first piece of data that is sent:

 

$product_info['products_id']

 

Ie, for the example in this thread, change the following:

 

$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

to this:

 

$currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

Worked for me a treat!

 

:rolleyes:

Share this post


Link to post
Share on other sites

Sorry!!!! I think that I may have copied the wrong data in my post... however, the principle is there. If I get time, I'll have a look at my system and put the correct code in... make sure the 4 different pieces of data are sent to currencies.php and it will work.

 

:(

Share this post


Link to post
Share on other sites

So here's my beef with the contribution.

 

I have installed TotalB2B on a clean ms2 installation and am having problems with the product reviews.

 

It's got to be the oddest thing! Check it out for yourself at http://www.circularorb.com/~crystal/catalog/

 

What happens is that someone clicks on a review from the reviews infobox and the review that shows up only contains the first character of the review, but the infobox displays it okay. What's even weirder is the date shown is December something 1969 and the person who wrote the review is only shown by the first character of the review text, not the person's name.

 

THEN, if you click the "back" button within the reviews, it will show the whole review! Strange right? Test it please so you know i'm not going crazy.

 

http://www.circularorb.com/~crystal/catalog/

 

I appreciate your help folks.

 

-George

Share this post


Link to post
Share on other sites

i have the same error message

Warning: Missing argument 3 for display_price() in /usr/www/users/md10377/osc/catalog/includes/classes/currencies.php on line 72

 

caused by the currencies function

 

the function display_price is called like that

$currencies->display_price($cell,TAX_INCREASE)

 

i don know how to make it run, where i sould put in the missing argument ???

the hole part of code looks like that:

// list products determined group

function get_products($id_group){

global $currencies;

$query = "";

if(!SHOW_MARKED_OUT_STOCK){

$query = " and products.products_status = 1";

}

$products_price_query = tep_db_query("select products_description.products_name, products.products_quantity, products.products_price, products.products_model, products_to_categories.products_id, products_to_categories.categories_id FROM products, products_description, products_to_categories where products.products_id = products_description.products_id and products.products_quantity <> 0".$query." and products.products_id = products_to_categories.products_id and products_to_categories.categories_id = ".$id_group);

$x=0;

while ($products_price = tep_db_fetch_array($products_price_query)){

$cell = tep_get_products_special_price($products_price['products_id']);

if($cell == 0)

$cell = $products_price['products_price'];

if($x==1) {

$col = "#F8F8F9";

$x = 0;

}else{

$col = "#FFFFFF";

$x++;

}

$quantity = "";

$model = "";

if(SHOW_QUANTITY)

$quantity = "<td width=\"100\" align=\"right\" class=\"productListing-data\">(".$products_price['products_quantity'].")</td>";

if(SHOW_MODEL)

$model = "<td width=\"100\" align=\"right\" class=\"productListing-data\">[".$products_price['products_model']."]</td>";

print "<tr bgcolor=\"".$col."\">".$model."<td width=\"1000\" class=\"productListing-data\">        <a href=\"" . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $products_price['products_id']) . "\"<a>".$products_price['products_name']."</td>".$quantity."<td width=\"150\" align=\"right\" class=\"productListing-data\">".$currencies->display_price($cell,TAX_INCREASE)."</td></tr>";

}

}

 

 

 

This is the HTML Pricelist.... it will be so fine when it will run with totalB2B

Share this post


Link to post
Share on other sites

now i changed

 

$currencies->display_price($cell,TAX_INCREASE)

 

to

 

$currencies->display_price($cell,$product_info['products_id'],TAX_INCREASE)

 

 

the result is that no error message apear

but the price allways 0.00 EUR

 

Dose anybody know what its missing to show the price correctly?

Share this post


Link to post
Share on other sites
I had the same error message, and I believe I've seen others with it as well. There is actually a really simple reason for the problem (and a really easy fix).

 

If you look in your currencies.php file at line 72, you will see that it is expecting 4 pieces of data to be sent to it - but the totalb2b contribution is only sending through 3. Since the totalb2b contribution (in currencies.php) seems to be expecting 4, it complains when only 3 come through...

 

The following code is similar to what totalb2b script contains, in, for example, product_info.php (but not limited to this one file):

 

$currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

The currencies.php class has the following in it (at least mine does):

function display_price($products_id, $products_price, $products_tax, $quantity = 1)

 

You can see that 3 pieces of data are being sent, but the class expects to receive 4.

 

All you need to do is in each file that uses the display_price, put in the following as the first piece of data that is sent:

 

$product_info['products_id']

 

Ie, for the example in this thread, change the following:

 

$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

to this:

 

$currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))

 

Worked for me a treat!

 

:rolleyes:

 

 

After i had installed STS3.0, I've got same problem

 

All I have done is I deleted $products_id

from this

 

function display_price($products_id, $products_price, $products_tax, $quantity = 1)

 

 

to this

 

function display_price( $products_price, $products_tax, $quantity = 1)

 

it work fine now but I am worry about there will be another problem, anyone tried before?

Share this post


Link to post
Share on other sites

I need help with this. This is so frustrating.

 

Can someone fix this or knows the answer?

 

Warning: Missing argument 2 for display_price() in /home/content/k/e/l/kelpetin/html/shop/osc/includes/classes/currencies.php on line 71

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×