Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: Error with createPriceDiv() default_pricelist.php

Error with createPriceDiv() default_pricelist.php 11 years 1 week ago #4202

I am using PHP 5.3.15, Joomla 2.5.9, VirtueMart 2.0.18a and PureMart 3.4. & my site is here bit.ly/YbvaAV

Everything with the products and cart was working fine until today.
Now whenever I select the shipping method and press "save" I get...

Warning: Invalid argument supplied for foreach() in templates/TEMPLATENAME/html/com_virtuemart/cart/default_pricelist.php on line 126

Fatal error: Call to a member function createPriceDiv() on a non-object in templates/TEMPLATENAME/html/com_virtuemart/cart/default_pricelist.php on line 286

I have seen the sam ein a closed forum topic here - www.flexiblewebdesign.com/forum-virtuemart-2-template-puremart-support/636-error-with-createpricediv-defaultpricelistphp

I followed the changes recommended by the support in the above forum post, but it did not fix the problem for me. Instead it just moved the line numbers as below;
Warning: Invalid argument supplied for foreach() in /home/MYSITE/public_html/templates/MYTEMPLATE/html/com_virtuemart/cart/default_pricelist.php on line 139
 
Fatal error: Call to a member function createPriceDiv() on a non-object in /home/MYSITE/public_html/templates/MYTEMPLATE/html/com_virtuemart/cart/default_pricelist.php on line 279
The administrator has disabled public write access.

Error with createPriceDiv() default_pricelist.php 11 years 1 week ago #4212

Is there anyway to bypass this problem other than reverting to vm default template as this is a massive problem for us at the moment.
The administrator has disabled public write access.

Error with createPriceDiv() default_pricelist.php 11 years 1 week ago #4215

Hi Andy,

first - what has changed? As you say it was all working fine... code can't rewrite its-self so something has changed -

2nd .

the warning

it is this foreach($this->cart->BTaddress as $item){ which is just checking for a bill to address

to get rid of the warning you can just add

error_reporting(E_ERROR); to the top of the file to get rid of it.

But I am confused as if you did the changes in www.flexiblewebdesign.com/forum-virtuemart-2-template-puremart-support/636-error-with-createpricediv-defaultpricelistphp then that foreach doesn't exist anymore!

What have you changed? Why have the line numbers increased if you are supposed to have deleted lines?

the fatal error
the boss - as he explained - is surprised by this as it is std. VM code - nothing is changed in our template in this area.

He asked that guy to try removing the 2nd argument. But you say this didn't work..

Can you echo out some o the objects to see if they are missing? e.g. before your line 286
 
print 'Debug Line '.__LINE__.' arg3 <pre>'; print_r ($this->cart->pricesUnformatted[$pkey]); print "</pre><br />\n";
print 'Debug Line '.__LINE__.' arg6 <pre>'; print_r ($prow->quantity); print "</pre><br />\n";
 
to see if there is an object missing
The administrator has disabled public write access.

Error with createPriceDiv() default_pricelist.php 11 years 1 week ago #4219

Nothing has changed as far as I am aware?
My server has crashed a couple of times over the last few days, but have since sorted that out?

I used a new/clean copy of /html/com_virtuemart/cart/default_pricelist.php and tried the changes again, but still the problem jumps to the same line numbers.

My shipping setting is set to automatic, so this is only a problem if/when a user select to change there shipping details?

I'm also not too sure what you mean with this code?
print 'Debug Line '.__LINE__.' arg3 <pre>'; print_r ($this->cart->pricesUnformatted[$pkey]); print "</pre><br />\n";
print 'Debug Line '.__LINE__.' arg6 <pre>'; print_r ($prow->quantity); print "</pre><br />\n";

Is this something I should add before line 286 for testing?
The administrator has disabled public write access.

Error with createPriceDiv() default_pricelist.php 11 years 1 week ago #4226

yes - this is to print out the arguments to see if they really are missing - that is what the fatal error is saying -

but still don't see how doing what the boss posted adds extra lines to your file when he is explaining to delete possibly problematic lines?

Cheers
The administrator has disabled public write access.
Time to create page: 0.149 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo