VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: lipes on February 01, 2012, 04:52:28 AM

Title: Featured Products
Post by: lipes on February 01, 2012, 04:52:28 AM
Its possible to add (in any next version) one option in Featured Products like:

Show Quantity Input? (Yes/No)

I want to remove the product input box... but i dont want to remove the code from all website...
Any solution to remove this only in featured products module?
Title: Re: Featured Products
Post by: PRO on February 01, 2012, 07:54:51 AM
Featured products where? Module? Frontpage?

Sent from my DROID BIONIC using Tapatalk
Title: Re: Featured Products
Post by: lipes on February 01, 2012, 13:38:01 PM
Hi. In the Module Backend .. it's possible?

I want to hide the Product Quantity Input Box (in front end)... but the solution could be in the module BackEnd, right?
Title: Re: Featured Products
Post by: PRO on February 01, 2012, 17:28:37 PM
prolipes, do you want the add to cart?
Title: Re: Featured Products
Post by: lipes on February 01, 2012, 17:36:17 PM
Yes!
If the front page i would love to have only the "add to cart" buttom to the fast buy.. like this link with "shop now"
brandsource.com  (http://brandsource.com)  or like many others sites do...

I really only want to remove that box of the quantity... it's possible without removing all the code in the products page?
Title: Re: Featured Products
Post by: PRO on February 01, 2012, 18:18:34 PM
prolipes, 1 way to do this is to add a css class to the moduleparams, and then do a display:none; with the quantity box.

The only other way would be to copy the module, and rename it, and then remove this

<!-- <label for="quantity<?php echo $product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
         <span class="quantity-box">
         <input type="text" class="quantity-input" name="quantity[]" value="1" />
         </span>
         <span class="quantity-controls">
         <input type="button" class="quantity-controls quantity-plus" />
         <input type="button" class="quantity-controls quantity-minus" />
         </span>


from helper.php
/modules/mod_virtuemart_product/helper.php

if you do rename the module, you would have to add this code to the add to cart form
<input type="hidden" name="quantity[]" value="1" />

ANOTHER way would be to do a template override, and change the add to cart button to link to the product page (if thats what u want)
Title: Re: Featured Products
Post by: lipes on February 01, 2012, 23:47:00 PM
many thanks BanquetTables.pro !
i removed that lines in /modules/mod_virtuemart_product/helper.php
i had opened that file before but i put another words in my CTRL + F search box and didnt find anything :)

now i think that its perfect!
thanks again!
Title: Re: Featured Products
Post by: lipes on February 03, 2012, 04:27:02 AM
now i know what do you mean about making a "override"...

i test that transition from /modules/mod_virtuemart_product/helper.php
to templates/mp3/html/mod_virtuemart_product/helper.php

but nothing changes..

if i do that modifications in /modules/mod_virtuemart_product/helper.php works ..
Title: Re: Featured Products
Post by: PRO on February 03, 2012, 14:27:17 PM
Quote from: BanquetTables.pro on February 01, 2012, 18:18:34 PM


The only other way would be to copy the module, and rename it, and then remove this


^^^

you can only override the view.

YOU can copy the module, and rename it. BUT you have to change a couple of the files.
this module I made here
http://www.kaizenmediaworks.com/virtuemart-20-show-product-module

I just used the original product module,. and took out most of the code. BUT I used the files, and structure as a template. And renamed it

Title: Re: Featured Products
Post by: buhnad on February 13, 2012, 18:13:26 PM
i followed these steps and now i got only add to cart button but when i click on it this message pops up [Continue Shopping
Please enter a valid quantity for this item.]
Title: Re: Featured Products
Post by: buhnad on February 13, 2012, 20:47:09 PM
its solved , i just deleted the .php file and copy it again
Title: Re: Featured Products
Post by: PRO on February 13, 2012, 21:20:12 PM
Quote from: BanquetTables.pro on February 01, 2012, 18:18:34 PM

if you do rename the module, you would have to add this code to the add to cart form
<input type="hidden" name="quantity[]" value="1" />

^^^^^^^^^
Title: Re: Featured Products
Post by: srajca on June 12, 2012, 16:25:19 PM
I don't get it. What do I have to do in order to have the add to cart button on frontpage? I have it working on the category view but can't get it to work on the front-end. Can you tell me step by step. Thanks a ton
Title: Re: Featured Products
Post by: lipes on October 18, 2012, 00:37:51 AM
Hi. This files was changed with the last VM version now i am in trouble to discover how to remove again the quantity button from the website frontend in the module... and the add to cart popup doesnt work too if i do the same change..


Quote from: PRO on February 01, 2012, 18:18:34 PM
<!-- <label for="quantity<?php echo $product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
         <span class="quantity-box">
         <input type="text" class="quantity-input" name="quantity[]" value="1" />
         </span>
         <span class="quantity-controls">
         <input type="button" class="quantity-controls quantity-plus" />
         <input type="button" class="quantity-controls quantity-minus" />
         </span>
Title: Re: Featured Products
Post by: PRO on October 18, 2012, 01:33:49 AM
<input type="hidden" name="quantity[]" value="1" />

The "hidden" will make it add 1