2016-12-03 3 views
0

を動作していないに追加カートに追加]ボタン: カートボタンが*に基づいて、私はMagentoの1で問題を抱えている

私はjQueryのエラーを取得するボタンを押してみてください

。誰もが、これらのエラーがどのように解決する方法を知っていますか?

エラーは次のとおりです。Uncaught TypeError: Cannot read property 'validate' of undefined(…)

マイview.phtmlは次のようになります。

<?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_blank 
* @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'); ?> 
<?php $_product = $this->getProduct(); ?> 

    <h1><?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getName()), 'name') ?></h1> 

    <div class="product-essential"> 

       <div class="add-to-box"> 


       </div> 



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

     <div class="product-shop"> 

      <?php if ($_product->getShortDescription()):?> 
       <div class="short-description std"> 
        <?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?> 
       </div> 
      <?php endif;?> 
      <div class="essential-data"> 
       <?php echo $this->getChildHtml('product_type_data') ?> 
       <?php echo $this->getChildHtml('tierprices') ?> 
      </div> 
      <?php if ($this->canEmailToFriend()): ?> 
       <a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a> 
      <?php endif; ?> 

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

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

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

      <?php if ($_product->isSaleable() && $this->hasOptions()):?> 
       <?php echo $this->getChildChildHtml('container1', '', true, true) ?> 
      <?php endif;?> 
      <a class="prev-page" onclick="javascript:history.go(-1)" href="#"><?php echo $this->__('Terug naar vorige pagina'); ?></a> 

     </div> 
     <div class="clearer"></div> 

     <?php if ($_product->isSaleable() && $this->hasOptions()):?> 
      <?php echo $this->getChildChildHtml('container2', '', true, true) ?> 
     <?php endif;?> 
    </form> 
    <script type="text/javascript"> 
    //<![CDATA[ 
      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="description"> 
       <h2><?php echo $this->__('Product Description') ?></h2> 
       <?php echo $_description ?> 
      </div> 
     <?php endif;?> 
     <?php if ($_additional = $this->getChildHtml('additional')):?> 
      <div class="additional"> 
       <?php echo $_additional ?> 
      </div> 
     <?php endif;?> 
     <?php echo $this->getChildHtml('upsell_products') ?> 
     <?php echo $this->getChildHtml('product_additional_data') ?> 
    </div> 
</div> 

そして、私のaddtocart.phtmlは、次のようになります。あなたがよ添付ファイルで

<?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_blank 
* @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) 
*/ 
?> 

<?php $_product = $this->getProduct() ?> 

<?php if($_product->isSaleable()): ?> 
    <fieldset class="add-to-cart"> 
     <legend><?php echo $this->__('Add Items to Cart') ?></legend> 
     <?php if(!$_product->isGrouped()): ?> 
     <label for="qty"><?php echo $this->__('Qty') ?>:</label> 
       <?php 
       $multiplier = $_product->getVerpakkingseenheid(); 
       if (!$multiplier){ 
        $multiplier = 1; 
       } 
       $iselect = $multiplier; 
       $max_package = 20; 
       $ix = 1; 
       ?> 
       <select name="qty" id="qty" maxlength="12"> 
        <? for ($ix; $ix <= $max_package; $ix++){ 
         echo '<option value="' . $iselect . '">' . $iselect . '</option>'; 
         $iselect = $iselect + $multiplier; 

        } ?> 
       </select> 
     <?php endif; ?> 
     <button type="button" class="button" onclick="productAddToCartForm.submit()"><span><?php echo $this->__('Add to Cart') ?></span></button> 
    </fieldset> 
<?php endif; ?> 

エラーを見つけるhttp://www.wijnmaat.nl/errors.png

+0

この質問は、私が恐れているスタックオーバーフローでうまくいくには広すぎます。いずれにしても、まず最初に、Googleにエラーメッセージを表示することをお勧めします。解決策は頻繁にあります。 'jQuery is not defined'はjQueryが現在のドキュメントに含まれていないという強いヒントです。残りのエラーは、同じ根本原因を持つ可能性があります。 (また、常にテキストとして質問にエラーを含めることを忘れないでください!SOの質問は自給自足する必要があります、他の人にはあなたのイメージがオフラインになったら質問は無益です) –

答えて

0

あなたはusiですajax cart aur someshadobox私はいくつかのjsファイルがあなたのフォルダに存在しないと思うなぜカートに追加されていないファイルがjsファイルが不足しているかどうかをチェックしてください、または単にあなたのcqartに追加して、ない。

関連する問題