0

私はmagentoのサイトを持っていて、布素材を販売しています。そこで、さまざまなサイズの製品を販売するためのグループ製品を作成しました。個々の製品としてではなく、グループ全体として製品を販売する必要があります。そこで、入力値を無効にしました。

グループ化されたプロジェクトではなく、単一の製品ページでカートに追加ボタンを無効にする必要があります。

つまり、単品ではなく、グループ全体をまとめて販売する必要があります。私は何をすべきか?

あなたが私を助けてくれることを願っています。ありがとうございました。

4

2 に答える 2

4

たとえば、製品詳細ページのカートに追加ボタンを無効にするには、以下のコードを追加できます。

app\design\frontend\\\template\catalog\product\view\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; ?>

そして、あなたは完了です!

于 2014-10-15T06:54:29.973 に答える