stecale Posted June 29, 2009 Share Posted June 29, 2009 I have installed this version and I have an execution problem which returns the following error : Fatal error: Call to a member function on a non-object in /home/.../catalog/includes/classes/shopping_cart.php on line 266 The lines are following : 264 // BOF qpbpp 265 $pf->loadProduct($products_id, $languages_id); 266 if ($product = $pfs->getPriceFormatterData($products_id)) { 267 $prid = $product['products_id']; 268 $products_tax = tep_get_tax_rate($product['products_tax_class_id']); 269 $products_price = $pf->computePrice($qty, $nof_other_items_in_cart_same_cat); 270 // EOF qpbpp 271 $products_weight = $product['products_weight']; I have no idea about how correcting this problem. May be, I have missed something during the source code modication. Thanks for your help Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted June 29, 2009 Share Posted June 29, 2009 265 $pf->loadProduct($products_id, $languages_id); 266 if ($product = $pfs->getPriceFormatterData($products_id)) { 269 $products_price = $pf->computePrice($qty, $nof_other_items_in_cart_same_cat); I haven't used this contribution recently, but in line 266, I see $pfs and on lines 265 and 269, I see $pf. Since the error is on 266, I would guess that $pf is correct and $pfs is a typo. Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
stecale Posted June 30, 2009 Author Share Posted June 30, 2009 I haven't used this contribution recently, but in line 266, I see $pfs and on lines 265 and 269, I see $pf. Since the error is on 266, I would guess that $pf is correct and $pfs is a typo. Thanks for your answer but it's not due to this problem. I have checked it however. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted June 30, 2009 Share Posted June 30, 2009 Thanks for your answer but it's not due to this problem. I have checked it however. Does your includes/application_top.php around line 260 look like this: // include currencies class and create an instance require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); // BOF qpbpp // include the price formatter classes for the price breaks contribution require(DIR_WS_CLASSES . 'PriceFormatter.php'); $pf = new PriceFormatter; require(DIR_WS_CLASSES . 'PriceFormatterStore.php'); $pfs = new PriceFormatterStore; // EOF qpbpp Quote Link to comment Share on other sites More sharing options...
Pektsekye Posted June 30, 2009 Share Posted June 30, 2009 I have installed this version and I have an execution problem which returns the following error : Fatal error: Call to a member function on a non-object in /home/.../catalog/includes/classes/shopping_cart.php on line 266 The line is following : 266 if ($product = $pfs->getPriceFormatterData($products_id)) { Hello, check the $pfs variable must be declared global: function calculate() { global $languages_id, $pfs, $currencies; Stanislav Quote Link to comment Share on other sites More sharing options...
Pektsekye Posted June 30, 2009 Share Posted June 30, 2009 (edited) Hello, If you have used the Autoinstaller script and you are still able to click the Uninstall button. Try the latest version which has Improved regular expression pattern for the catalog/includes/classes/shopping_cart.php file. Stanislav Edited June 30, 2009 by Pektsekye Quote Link to comment Share on other sites More sharing options...
stecale Posted June 30, 2009 Author Share Posted June 30, 2009 Hello, If you have used the Autoinstaller script and you are still able to click the Uninstall button. Try the latest version which has Improved regular expression pattern for the catalog/includes/classes/shopping_cart.php file. Stanislav Thanks to all of you. The problem was due to the global declaration which was missing in the calculate function. In fact, it seems that the "global $currencies" declaration is missing in the standard version of the includes/classes/shopping_cart.php file. Thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.