2014-10-15 3 views
0

나는 magento 사이트를 가지고 있으며 천을 판매하고 있습니다. 나는 크기가 다른 제품을 판매하기위한 그룹 제품을 만들었습니다. 개별 제품이 아닌 전체 그룹으로 제품을 판매해야합니다. 그래서 나는 입력 값을 비활성화했다.자그마한 단순한 제품에 장바구니에 담을 수 없음

이제 그룹화 된 프로젝트가 아닌 단일 제품 페이지의 장바구니에 추가 버튼을 비활성화해야합니다.

이는 단일 그룹이 아닌 전체 그룹을 함께 판매해야 함을 의미합니다. 어떻게해야합니까?

희망을 보내 주시면 감사하겠습니다. 고맙습니다.

답변

4

예를 들어 제품 세부 정보 페이지에서 장바구니에 추가 버튼을 사용 중지하려면 아래 코드를 추가하십시오.

이동 응용 프로그램에 \ 디자인 \ 프론트 엔드 \\\ 템플릿 \ 카탈로그 \ 제품 \보기 \ addtocart.phtml getProduct() 후 코드 아래에 추가;? 다음과 같은>

<?php if($_product->getTypeId() != 'simple'): ?> 
<?php endif; ?> 

그래서 당신의 파일보기.

<?php $_product = $this->getProduct();?> 
<?php if($_product->getTypeId() != 'simple'): ?> 
<?php $buttonTitle = $this->__('Add to Cart'); ?> 
<?php if($_product->isSaleable()): ?> 
    <div class="add-to-cart"> 
     <?php if(!$_product->isGrouped()): ?> 
     <label for="qty"><?php echo $this->__('Qty:') ?></label> 
     <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" /> 
     <?php endif; ?> 
     <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button> 
     <?php echo $this->getChildHtml('', true, true) ?> 
    </div> 
<?php endif; ?> 
<?php endif; ?> 

그리고 끝났습니다!

관련 문제