I find this solution as posted in post #5 to cause a problem in the shipping estimator when there are multiple addresses.
After selecting an address in the pull-down, the page refreshes and the selected address is maintained in the drop-down but the displayed address in incorrect. Tested with two addresses in a new install of 1.51.
//if($cart->get_content_type() !== 'virtual') {
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
if ($_SESSION['customer_id']) {
// user is logged in
if (isset($_POST['address_id'])){
// user changed address
$sendto = $_POST['address_id'];
}elseif ($_SESSION['cart_address_id']){
// user once changed address
$sendto = $_SESSION['cart_address_id'];
// $sendto = $_SESSION['customer_default_address_id'];
}else{
// first timer
$sendto = $_SESSION['customer_default_address_id'];
}
$_SESSION['sendto'] = $sendto;
// set session now
$_SESSION['cart_address_id'] = $sendto;
// set shipping to null ! multipickjup changes address to store address...
$shipping='';
// include the order class (uses the sendto !)
// require(DIR_WS_CLASSES . 'order.php');
// $order = new order;
}else{
// user not logged in !
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...
Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation
Any fix on this problem?
Using Zen Cart 1.5.1
Try this one. I found it in the ozpost thread:
includes/modules/shipping_estimator.php
Add to line 46:
Code:require_once('includes/classes/http_client.php'); // shipping in basket //PHP5.4 fix $order = new stdClass(); /* // moved below and altered to include Tare // totals info $totalsDisplay = '';
I have this one coming up...what do I have to do of the above options to get rid of it (zen 1.5.1 - php 5.4) ?
Also I have a different error log from a payment module (icepay), anyone any idea how to solve it?HTML Code:[21-Jun-2014 16:31:31 Europe/Amsterdam] PHP Warning: Creating default object from empty value in D:\www\dynamitemagic.nl\www\shop\includes\modules\shipping_estimator.php on line 92
HTML Code:[21-Jun-2014 16:46:17 Europe/Amsterdam] PHP Warning: Creating default object from empty value in D:\www\dynamitemagic.nl\www\shop\includes\modules\payment\icepay.php on line 550 [21-Jun-2014 16:46:17 Europe/Amsterdam] PHP Warning: Creating default object from empty value in D:\www\dynamitemagic.nl\www\shop\extras\icepay\notify.php on line 75
Line 545-572 of ICEPAY.PHP are this:
Lines 64-87 of NOTIFY are these:HTML Code:function OnPostback() { if ( $_SERVER['REQUEST_METHOD'] != 'POST' ) return false; $this->postback = NULL; $this->postback->status = $_POST['Status']; $this->postback->statusCode = $_POST['StatusCode']; $this->postback->merchant = $_POST['Merchant']; $this->postback->orderID = $_POST['OrderID']; $this->postback->paymentID = $_POST['PaymentID']; $this->postback->reference = $_POST['Reference']; $this->postback->transactionID = $_POST['TransactionID']; $this->postback->consumerName = $_POST['ConsumerName']; $this->postback->consumerAccountNumber = $_POST['ConsumerAccountNumber']; $this->postback->consumerAddress = $_POST['ConsumerAddress']; $this->postback->consumerHouseNumber = $_POST['ConsumerHouseNumber']; $this->postback->consumerCity = $_POST['ConsumerCity']; $this->postback->consumerCountry = $_POST['ConsumerCountry']; $this->postback->consumerEmail = $_POST['ConsumerEmail']; $this->postback->consumerPhoneNumber = $_POST['ConsumerPhoneNumber']; $this->postback->consumerIPAddress = $_POST['ConsumerIPAddress']; $this->postback->amount = $_POST['Amount']; $this->postback->currency = $_POST['Currency']; $this->postback->duration = $_POST['Duration']; $this->postback->paymentMethod = $_POST['PaymentMethod']; $this->postback->checksum = $_POST['Checksum']; $this->doLogging( sprintf("Postback: %s", serialize($_POST)) );
The payments do come in and work but the error is created anyway since php 5.4. Maybe anyone can tell if they see anything strange as I am not familiar with any of the php-code :)HTML Code:if ($notifyCustomer){ // Load order data $order_totals = $ICE_module->load_session($ICE_module->orderID); include_once(DIR_WS_CLASSES . 'order.php'); // Override default setting $_SESSION['payment'] = 'icepay'; $GLOBALS['icepay']->title = $ICE_module->postback->paymentMethod; // Retrieve order $order = new order($ICE_module->orderID); // E-mail setup for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { $order->total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); $order->total_tax += zen_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $order->total_cost += $total_products_price;
Thanks!
René
Last edited by Reneetje; 21 Jun 2014 at 05:51 PM.
I'm pretty sure on the first one, try changing to the following:
The second one's a bit different; I'm assuming that my counting is correct and that line 75 is this one:Code:function OnPostback() { if ( $_SERVER['REQUEST_METHOD'] != 'POST' ) return false; $this->postback = new stdClass(); $this->postback->status = $_POST['Status']; $this->postback->statusCode = $_POST['StatusCode']; $this->postback->merchant = $_POST['Merchant']; $this->postback->orderID = $_POST['OrderID']; $this->postback->paymentID = $_POST['PaymentID']; $this->postback->reference = $_POST['Reference']; $this->postback->transactionID = $_POST['TransactionID']; $this->postback->consumerName = $_POST['ConsumerName']; $this->postback->consumerAccountNumber = $_POST['ConsumerAccountNumber']; $this->postback->consumerAddress = $_POST['ConsumerAddress']; $this->postback->consumerHouseNumber = $_POST['ConsumerHouseNumber']; $this->postback->consumerCity = $_POST['ConsumerCity']; $this->postback->consumerCountry = $_POST['ConsumerCountry']; $this->postback->consumerEmail = $_POST['ConsumerEmail']; $this->postback->consumerPhoneNumber = $_POST['ConsumerPhoneNumber']; $this->postback->consumerIPAddress = $_POST['ConsumerIPAddress']; $this->postback->amount = $_POST['Amount']; $this->postback->currency = $_POST['Currency']; $this->postback->duration = $_POST['Duration']; $this->postback->paymentMethod = $_POST['PaymentMethod']; $this->postback->checksum = $_POST['Checksum']; $this->doLogging( sprintf("Postback: %s", serialize($_POST)) );
Based on that, my best guess is the the $ICE_module object doesn't include an orderID element.Code:$order = new order($ICE_module->orderID);
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
@Dr. Byte
Thank you, I replaced the entire file with the github version, now see if it works....
@Lat9
Also Thank you! If I fix the first file but not the second (as I do not know how to), can I break the plugin? Otherwise I will leave it like it is for now.
I also emailed the people at ICEPAY to make the module for php5.4 a few days ago but did not get a reply yet.
Mmmm....I will wait if I get a reply from icepay and then see what to do, do you think the error is created before going to the icepay-paymentpage or on the postback?
Then I know what to test :)
René
I using ZC v 1.5.1 and got exactly the same error
but adding the line didn't fix the problem. Error only happens when product set to Priced by Attributes. No errors for products without attributes.PHP Code:
PHP Warning: Creating default object from empty value in /home2/footy/public_html/xxxx/categories.php on line 1015
Please advise.
Last edited by ksivv; 7 Dec 2014 at 04:25 AM.
Bookmarks