私のタイトルが言うように、magento ショッピング カートで数量編集を無効にする方法はありますか? 現在、magento にテキストボックスが表示されています。数量をプレーンテキストで表示するか、テキストボックスを無効にしたいです。
2 に答える
.phtml
このファイルは にあると思いapp/design/frontend/base/default/checkout
ますので、ある場合は、ファイルをコピーして、独自のカスタム テーマ ( app/design/frontend/[custom_package]/[custom_theme]/template/checkout/...
) に貼り付けてください。
.phtml
そのテンプレート ファイルで、テキスト ボックスを読み取り専用に変更するか、必要に応じて変更します。
コア ファイルを変更することはお勧めできません。コードについてapp/design/
は、独自のパッケージ/テーマを作成し、デフォルトのコンテンツをコピーして貼り付けてそこに変更することをお勧めします (パッケージ/テーマが管理パネルで設定されていることを確認してください)。
元のファイルの場所:/app/design/frontend/base/default/template/checkout/cart/item
はい、パス app\design\frontend\base\default\template\catalog\product\view\addtocart.phtml に移動してください。
<?php $_product = $this->getProduct(); ?>
<?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; ?>
入力タグをテキストに編集するか、必要に応じてコメントアウトします