Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Parse error: Syntax error - Unexpected T_ENDFOREACH
 
austinstorm
Member
 
Avatar
Total Posts:  31
Joined:  2007-08-31
Moscow, ID
 

The Theme installed without a hitch, but when I try to search or click on a category, I get this error:

Parse error: syntax error, unexpected T_ENDFOREACH in C:\wamp\www\magento\app\design\frontend\default\modern\template\checkout\cart\sidebar.phtml on line 61

Do I need to change something else? I’m at a loss…

 Signature 

Austin Storm

 
Magento Community Magento Community
Magento Community
Magento Community
 
austinstorm
Member
 
Avatar
Total Posts:  31
Joined:  2007-08-31
Moscow, ID
 

I figured it out! I didn’t have short_open_tag enabled in PHP.

 Signature 

Austin Storm

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

In this file, on line 58 there’s <?endif; ?> by mistake, was fixed now.
Please replace it with <?php endif; ?>

Thanks

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  38
Joined:  2007-12-15
 

I’m still getting the same error:

Parse error: syntax error, unexpected T_ENDFOREACH in C:\wamp\www\projects\magento\app\design\frontend\default\modern\template\checkout\cart\sidebar.phtml on line 61

Here’s the code in that line:

<?php foreach($_items as $_item): ?>
            
<li class="item">
                <
div class="product-images">
                    <
a href="<?php echo $_item->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item->getThumbnailObject(), 'thumbnail')->resize(50, 50)->setWatermarkSize('30x10'); ?>" alt="<?php echo $_item->getProductName() ?>" width="50" height="50" /></a>
                </
div>
                <
div class="product-details">
                    <
a href="<?php echo $this->getRemoveItemUrl($_item) ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="widget-btn"><img src="<?php echo $this->getSkinUrl('images/list_remove_btn.gif') ?>" alt="<?php echo $this->__('Remove Product') ?>"/></a>
                    <
a href="<?php echo $_item->getProductUrl() ?>"><?php echo $_item->getProductName() ?></a>
                    
<?php echo $_item->getProductDescription() ?>
                    <?php 
if(!$_item->getProductDescription()):?><br/><?endif;?><strong><?php echo 1*$_item->getQty() ?></strongx <?php echo Mage::helper('core')->currency($_item->getPrice()) ?>
                
</div>
            </
li>
        
<?php endforeach; ?>

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1771
Joined:  2007-08-07
Los Angeles
 

There were few occurrences in the code with short open tags, including this one ( <?endif;?> ):

<?php if(!$_item->getProductDescription()):?><br/><?endif;?>
They were fixed and will be available in next release any day now.

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53191 users|713 users currently online|107221 forum posts