LIGHT
LIGHT

Reputation: 5712

Is there anyway to disable quantity edit in magento?

As my title says, Is there anyway to disable the quantity edit in magento shopping cart? Currently, I can see the textbox there in the magento. I want to see the quantity in plain text or the textbox disabled.

Upvotes: 0

Views: 4753

Answers (2)

Nick Rolando
Nick Rolando

Reputation: 26177

I believe the .phtml file for this is in app/design/frontend/base/default/checkout so if it is, you can copy the file and paste it into your own custom theme (app/design/frontend/[custom_package]/[custom_theme]/template/checkout/...).

Modify the textbox to be readonly, or however you'd like, in that .phtml template file.

Note, it is not good practice to modify core files. For app/design/ code, it's better to make your own package/theme and copy/paste the default content over and modify it there (be sure your package/theme is set in the admin panel).

ORGINAL FILE LOCATION: /app/design/frontend/base/default/template/checkout/cart/item

Upvotes: 1

chanz
chanz

Reputation: 1267

Yes you can, go to following path 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; ?>

Edit the Input Tag to text or comment it out as your wish

Upvotes: 0

Related Questions