Unstoppable Domains

Magento - Mod crashes internet explorer

Spaceship Spaceship
Watch

teclance

Established Member
Impact
1
Hi Guys,

Hopefully some one can help with this,

I am installing a mod for a client and for some reason this mod is crashing when loaded in internet explorer only. Other browsers are fine.

Basically the page starts to load then all of a sudden a window pops up say IE can't open this site.


I found the section of code that is causing the problem but can't see where the problem is. When I remove it, the page loads but of course that section is missing.

Here is that bit of code:

PHP:
<?php if ($_product->isSaleable() && $this->hasOptions()):?> <!-- move options under price-->
                    <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
                    <span class="add-or"><?php echo $this->__('OR') ?></span>    
                    <?php echo $this->getChildHtml('addto') ?>
                    </div>               
                <?php endif;?>
                <?php //echo $this->getChildHtml('addto') ?>

Thanks in advance!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy

I'm not familiar with Magento but from your code snippet it seems they are not seperating the presentation layer from the code/framework layer. I've always wondered about this... and now I know.

The product looks fantastic but when it comes to development outsourcing and working with HTML mixed with PHP is down right nasty. It has been for at least 4-5 years now. Is the Magento Product full of code like this? (templates mixed with html + php) ? You would think they would have some nice template system in place for this. For example: {some_variable} instead of <?php echo $some_variable; ?> :)

Regardless, that code you've posted will not help developers here very much. You may need to output some more information as to what those functions are trying to spit out... I know PHP but this doesn't really do much for me. Is there any other information you can share to help aid in having this problem fixed?

Additionally, have you spoken to one of the developers of Magento? They should give you some indiciation if you're on the right or wrong track. We do this all the time for customers of ILance Auction Software.

Just a few thoughts .. :)
 
0
•••
Hi,

I will try and attach an image, in the mean time here is an error message we get:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30618; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Fri, 1 May 2009 04:18:47 UTC


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI:
 
0
•••
Do you have any flash banners on the site?
 
0
•••
I'm not familiar with Magento but from your code snippet it seems they are not seperating the presentation layer from the code/framework layer. I've always wondered about this... and now I know.

The product looks fantastic but when it comes to development outsourcing and working with HTML mixed with PHP is down right nasty. It has been for at least 4-5 years now. Is the Magento Product full of code like this? (templates mixed with html + php) ? You would think they would have some nice template system in place for this. For example: {some_variable} instead of <?php echo $some_variable; ?> :)

Regardless, that code you've posted will not help developers here very much. You may need to output some more information as to what those functions are trying to spit out... I know PHP but this doesn't really do much for me. Is there any other information you can share to help aid in having this problem fixed?

Additionally, have you spoken to one of the developers of Magento? They should give you some indiciation if you're on the right or wrong track. We do this all the time for customers of ILance Auction Software.

Just a few thoughts .. :)

Basically the mod was just to move some code around and it is used to display attribute options. Over the magento system isn't to bad but there are things about it that use allot of improvement.


Here is the whole code of the file, hopefully this can help:

Code:
<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/**
 * Product view template
 *
 * @see Mage_Catalog_Block_Product_View
 * @see Mage_Review_Block_Product_View
 */
?>
<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<script type="text/javascript">
    var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
</script>
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
<div class="product-info-box">
    <div class="product-essential">
    <form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form">

        <div class="product-img-box">
            <?php echo $this->getChildHtml('media') ?>
        </div>

        <div class="product-shop">
            <h3 class="product-name">
                <?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getName()), 'name') ?>
            </h3>

            <?php if ($this->canEmailToFriend()): ?>
                <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a><br />
            <?php endif; ?>

            <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>

            <fieldset class="no-display">
              <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
              <input type="hidden" name="related_product" id="related-products-field" value="" />
            </fieldset>
			<DIV style="font-size: 11px;"><strong>SKU:</strong> <?php echo nl2br($_product->getSku()) ?></DIV>
            <?php echo $this->getChildHtml('alert_urls') ?>
            <?php echo $this->getChildHtml('product_type_data') ?>

            <?php if (!$this->hasOptions()):?>
                <?php echo $this->getTierPriceHtml() ?>
                <div class="add-to-holder">
                    <?php if($_product->isSaleable()): ?>
                        <?php echo $this->getChildHtml('addtocart') ?>
                        <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
                            <span class="add-or"><?php echo $this->__('OR') ?></span>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php echo $this->getChildHtml('addto') ?>
                </div>
            <?php else:?>
                <?php if ($_product->isSaleable() && $this->hasOptions()):?> <!-- move options under price-->
                    <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
                    <span class="add-or"><?php echo $this->__('OR') ?></span>    
                    <?php echo $this->getChildHtml('addto') ?>
                    </div>               
                <?php endif;?>
                <?php //echo $this->getChildHtml('addto') ?>
            <?php endif; ?>

            <div class="divider"></div>


            <?php if ($_product->getShortDescription()):?>
                <h4><?php echo $this->__('Quick Overview') ?></h4>
                <div class="short-description"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
            <?php endif;?>

            <?php echo $this->getChildHtml('other');?>

            <?php if ($_product->isSaleable() && $this->hasOptions()):?>
                <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
            <?php endif;?>

        </div>
        <div class="clear"></div>
        <?php //if ($_product->isSaleable() && $this->hasOptions()):?>
            <?php //echo $this->getChildChildHtml('container2', '', true, true) ?>
        <?php //endif;?>
    </form>
    <script type="text/javascript">
            var productAddToCartForm = new VarienForm('product_addtocart_form');
            productAddToCartForm.submit = function(){
                    if (this.validator.validate()) {
                            this.form.submit();
                    }
            }.bind(productAddToCartForm);
    </script>
    </div>

    <div class="product-collateral">
        <?php if ($_description = $this->getChildHtml('description')):?>
            <div class="collateral-box">
                <div class="head">
                    <h4><?php echo $this->__('Product Description') ?></h4>
                </div>
                <?php echo $_description ?>
            </div>
        <?php endif;?>
        <?php if ($_additional = $this->getChildHtml('additional')):?>
            <div class="collateral-box">
                <div class="head">
                    <h4><?php echo $this->__('Additional Information') ?></h4>
                </div>
                <?php echo $_additional ?>
            </div>
        <?php endif;?>
        <?php echo $this->getChildHtml('upsell_products') ?>
        <?php echo $this->getChildHtml('product_additional_data') ?>
    </div>
</div>
 
0
•••
I found some info for you:

Upgrade to swfobject v2.1 loaded from Google's CDN.

Put this code in the head element of your HTML document:

HTML:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':                                  '/includes/playlist.xml',
        'width':                                 '300',
        'height':                                '136',
        'displayheight':                         '0',
        'repeat':                                'true',
        'shuffle':                               'false',
        'showdigits':                            'false',
        'lightcolor':                            '0xcc0000',
        'autoscroll':                            'false',
        'showeq':                                'true',
        'autostart':                             'true'
      };

      var params =
      {
        'allowscriptaccess':                     'always',
        'allowfullscreen':                       'true',
        'bgcolor':                               '#F6F3F3'
      };

      var attributes =
      {
        'id':                                    'playerId',
        'name':                                  'playerId'
      };

      swfobject.embedSWF('/includes/player.swf', 'mp3player', '300', '136', '9.0.124', false, flashvars, params, attributes);
    </script>

Let me know if that works...
 
0
•••
Do you have any flash banners on the site?

No, it only happens with specific products that have addon options.

thanks for the hand guys.
 
0
•••
Hi Mike,

Unfortunately this is going to require a Magento Developer to give some advice. When things start getting deep into the code (as you suggested "products that have addon "options") it will require some in-depth review...

Good luck with your solution.. if you find one give us an update! :)

Take care

Peter
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back