Invalid argument... productdetails/default.php on line 506

Change your online store into modern look with myStore eCommerce VirtueMart Joomla template - discussion forum.
GK User
Tue Jun 05, 2012 4:02 pm
Mystore/VM2.0.6 installation

Warning: Invalid argument supplied for foreach() in /home/soundrng/public_html/templates/gk_mystore/html/com_virtuemart/productdetails/default.php on line 506

Example page: http://new.soundring.com.au/en/products ... i/1-detail

I have looked through the Net and this Gavick forum to see if I could find out why the Mystore installation isn't working properly for custom fields with no luck.

Only getting this for Styli category - I assume that's because it's the only category that I've loaded customfields for.

Maybe I've misunderstood how to add data for custom fields (column headings ie. OriginaStyulsNo;OriginalCartridgeNo in one field , data relating to those headings ie. S3452;R987 in the other). The import of these custom fields seemed to work - it put the extra fields into the product_customfields table . This information should be displayed with the individual Stylus record on the detail page - however I'm getting the above error.

Any idea as to what's causing it? Have I done the import incorrectly?

I checked out the code around line 506 and noticed that this had been causing problems before, hence the entry in the code pointing me to:
http://forum.virtuemart.net/index.php?topic=99320.0
so i tried replacing it as described (below) but nothing changed - still getting same error.

[see latest ver of Mystore html/com_virtuemart/productdetails/default.php]
//* foreach ($this->product->customfieldsSorted[$this->position] as $field) {
//* if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
// continue;
// if ($field->display) {
foreach ($this->product->customfieldsSorted[$this->position] as $field) {
if ($field->display) {
if ( $field->is_hidden == "1" )
continue;
User avatar
Senior Boarder

teitbite
Fri Jun 08, 2012 4:53 pm
Hi

Please send me an ftp access to Your site. I'll see what can be done about that.
User avatar
Moderator

GK User
Sat Dec 15, 2012 8:56 pm
Hello, sorry for pull up this thread, but i have the same problem. What is the solution for this?
User avatar
Fresh Boarder

teitbite
Tue Dec 18, 2012 1:12 am
Hi

Sorry, but I have not received an access to check this issue. Please update template and VM to tje latest version. I'm using such right now and there is no problems with it.
User avatar
Moderator

GK User
Tue Feb 05, 2013 4:27 pm
Find this around the line 314:

<?php } // Product Description END

// Product Packaging


& Replace for:

<?php } // Product Description END

if (!empty($this->product->customfieldsSorted['normal'])) {
$this->position='normal';
echo $this->loadTemplate('customfields');
} // Product custom_fields END

// Product Packaging
User avatar
Fresh Boarder

teitbite
Wed Feb 06, 2013 12:42 pm
Hi

This can works :) Simpy adding a code to display customfields.
User avatar
Moderator


cron