The variable countryRegions
is not defined.
You should change this line:
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
to this one:
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
The same issue exists in shipping.phtml. Change this:
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
to :
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
First of all you shouldn't be using load
in a loop. It's a really big performance killer.
Use ->addAttributeToSelect('small_image')
and after that use the $product
object instead of $_productInCollection
.
but if you really insist on using load
use if as follows.
$_productInCollection = Mage::getModel('catalog/product')->load($product->entity_id);
if you use the same variable $obj
for loading products you get issues like yours, because the objects are passed as reference.
So when you call $obj->load()
the second time the variable $obj
still contains the data from the first load and, and when calling load
the data that is already set is merged with the new values from the database.
So...product 4 does not have an image, but $obj already has an image set from loading product 3. On merging you get the image from product 3.
[Edit]
And an other thing...a bit off topic.
If you want only 26 products set a limit to the collection. Do not load the full collection and the just stop after 26 iterations. Again...big performance issue.
$collection->setPage(1, 26);
//or
$collection-getSelect()->limit(26);
Best Answer
You can tell your layout handle to use the customer_account handle