News:

Support the VirtueMart project and become a member

Main Menu

Do not want quantity updates in cart

Started by lbmessick, August 19, 2012, 00:30:28 AM

Previous topic - Next topic

lbmessick

How can I hide/remove the quantity update/change option in cart?  I have made the changes from "textinput" and "submit" to hidden but must be wrong file.  I do not want the user to be able to change quantity.  Thanks!

Joomla 2.5
VM 2.0.8

bytelord

#1
Hello,

in your custom template, inside the file html/com_virtuemart/cart/default_pricelist.php around line 153 there the line you seach for:

<input type="text" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="inputbox" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" />

You could change the input type property from text to hidden:

<input type="hidden" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="inputbox" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" />

so the quantity box is not showing.

Update: You could use the attribute disabled="disabled" instead of changing the field to hidden ... so the user can see the quantity.


If you also want to hide the refresh or remove icon you could just hide them using css or add some css inside your php file (same file as above)

around line 157

<input type="submit" class="vmicon vm2-add_quantity_cart" name="update" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" align="middle" value=" "/>


add a style attribute, like style="display:none". that line will become

<input type="submit" class="vmicon vm2-add_quantity_cart" name="update" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" align="middle" value=" " style="display:none"/>


Hope it helps you.

Regards,

Bytelord.
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

John2400

bytelord,

how about stopping the plus and minus in the actual product - How can you do that ?

So the item is always  "1"  no multiple products

bytelord

#3
Hi John,

if you asking how to stop it inside product details page i can think various ways.
An easy one is to hide the plus/minus icons through css (span.quantity-control{display:none} and as for the quantity box you can easily disable it.

around line 74 inside productdetails\default_addtocart.php

<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int) $this->product->min_order_level 0) {


changes to:

<input type="text" disabled="disabled" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int) $this->product->min_order_level 0) {


we add the attribute disabled="disabled". the same thing can be done inside cart page that before we just hide it ... so the user will be able to see the quantity.

At the end  the user cannot change the quantity by "hand" and after we hide the arrows then the only quantity will the min_order_level or "1".

BUT: he can just press twice or more the button addtocart :)
In that case i think needs javascript to "block" adding in cart same product more than once...

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lbmessick

SOLVED!!

Thanks to bytelord!! His solution works.  I happen to be using component Pre-Order so I had to change it there also.  STUPID ME!

BTW bytelord, I cannot get the attribute "disabled" to work.  I must be putting it in the wrong line of code or the wrong place in the line.

Again, many, many thanks to John2400 and bytelord for there help.  Sorry guys, but now I know where to go.

Brett

bytelord

#5
Hello,

You are welcome.

to disable the quantity field inside cart/default_pricelist arrount line 153 change the line to:

<input type="text" disabled="disabled" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="inputbox" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" />


Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lbmessick

John,
Tell me when you have had enough......

1    Dumb question but do you type the ?  I tried it just 'disabled = "disabled" with no result.

2    Do you know which language file to look to to change Quantity / Update header.  Think I have looked through them all but obviously not.

Thanks again for all the help!

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bytelord

For change the language files i suggest you ti use joomla language override.

take a look here: http://forum.virtuemart.net/index.php?topic=106497.msg355752#msg355752
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lbmessick

Bytelord,
You are a VM GOD!!!!!  Worked like a charm.
When I make my millions, let me know if you want a job.   LOL

Brett

MartinSchmied

hi,

I have a problem which is related to this topic! Maybe you have an answer for me:

I want to limit the possible amount of products which can be added to the shopping cart! In my research I only found the possibility to set a maximum amount of a product or of products of one categorie. Is is possible to limit the generel amount of products in the shopping cart? Would be necessary for my Online-Shop!

friendly greedings,
martin

raunhar

Will this work fr joomla 1.5.26 with VM 2.0.12f

I do not need the qnty button.

bytelord

Hello,

I don't use joomla 1.5

You could use some CSS to hide the quantity button:

.input.quantity-input {
display:none;
}

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

raunhar


raunhar

#14
Where can I find the language folder in the new version.

Please help