Quantity option on category page

StartPrev 1 2 NextEnd
22.02.2013 16:40
#1
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Quantity option on category page

Can anyone tell me if it is possible to have a quantity option on the category page?

For example I would like to have a + and - sign on the category page so that the visitor easily can select the quantity of products to buy.

Is there someone with an example of a script like this? Or maybe it's possible to buy this somewhere?

I very much appreciate the time you take to answer my question.

 
22.02.2013 20:30
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

http://www.webdesigner-profi.de/joomla-webdesign/shop/addons/ajax-cart.html?lang=en

 
01.03.2013 15:02
#3
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Thank you! I've purchased the AJAX cart.

Now I've got a little problem I can't solve. In the page jshoppingproducts/cartajax/cartajax.php I've editted the code so I have a plus and minus to increase and decrease the value but it's not working.

The reason for this is because an enter is automatically added to my variable element ID in this row:

<input type="button" name="add" onclick="javascript: document.getElementById("quantity'.$product->product_id.'").value++;" value="+" />

The space is added before 'quantity' so it comes out as:

<input type="button" name="add" onclick="javascript: document.getElementById(" quantity49").value++;"="" value="+">

Could you please help me with this?

This is the complete code of cartajax.php:

<?php
....
?>


Joomla: 2.5
JoomShopping: 3.7.2

Last change: 04.03.2013 21:42
 
04.03.2013 16:27
#4
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Why do I get a link to buy a module but don't get help to integrate it the way I've described?? I ordered this module because you said I should and thought you would help me integrate this. Please give me a reply.


Last change: 04.03.2013 16:27
 
04.03.2013 21:58
#5
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

...
foreach($products as $key => $product)
{
if($product->product_quantity > 0)$products[$key]->_tmp_var_top_buttons .= _JSHOP_QUANTITY.': <input type="text" id="iq_'.$product->product_id.'" maxlength="2" size="2" value="1" name="quantity" />';
$products[$key]->_tmp_var_top_buttons .= '<input type="hidden" value="'.$product->product_id.'" name="product_id" />';
$products[$key]->_tmp_var_top_buttons .= '<input type="button" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value++;" value="+">';
$products[$key]->_tmp_var_top_buttons .= '<input type="button" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value--;" value="-">';
}

 
13.03.2013 01:34
#6
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

On the product page the quantity value is automatically set by default_count_product like this:

<input type = "text" name = "quantity" id = "quantity" onkeyup="reloadPrices();" class = "inputbox" style = "width: 20px" value = "<?php print $this->default_count_product?>" />

On the category page I would like this value to be automatically set in the same way as on the product page. I use Ajax cart and my code looks like this:

foreach($products as $key => $product)
{
if($product->product_quantity > 0)$products[$key]->_tmp_var_top_buttons .= '<div style="float:left;">Aantal: <input type="text" id="iq_'.$product->product_id.'" maxlength="2" size="2" value="THIS IS WHERE THE VALUE HAS TO BE ENTERED" name="quantity" class="inputbox" /></div>';
$products[$key]->_tmp_var_top_buttons .= '<input type="hidden" value="'.$product->product_id.'" name="product_id" />';
$products[$key]->_tmp_var_top_buttons .= '<div style="height:27px;float:left;margin-left:5px;"><input type="image" src="images/plus.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value++;" value="+">';
$products[$key]->_tmp_var_top_buttons .= '<br /><input type="image" style="margin-top:1px;" src="images/min.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value--;" value="-"></div>';
}

Can you please help me with the PHP code I have to put in here?

 
13.03.2013 07:59
#7
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

foreach($products as $key => $product)
{
if($product->product_quantity > 0)$products[$key]->_tmp_var_top_buttons .= '<div style="float:left;">Aantal: <input type="text" id="iq_'.$product->product_id.'" maxlength="2" size="2" value="'.$this->config->min_count_order_one_product.'" name="quantity" class="inputbox" /></div>';
$products[$key]->_tmp_var_top_buttons .= '<input type="hidden" value="'.$product->product_id.'" name="product_id" />';
$products[$key]->_tmp_var_top_buttons .= '<div style="height:27px;float:left;margin-left:5px;"><input type="image" src="images/plus.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value++;" value="+">';
$products[$key]->_tmp_var_top_buttons .= '<br /><input type="image" style="margin-top:1px;" src="images/min.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value--;" value="-"></div>';
}


Last change: 13.03.2013 08:00
 
13.03.2013 14:00
#8
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Thank you, but it's not working. Entering the above returns this:

<input type="text" id="iq_49" maxlength="2" size="2" value="" name="quantity" class="inputbox">

 
13.03.2013 20:43
#9
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

$this->config = JSFactory::getConfig();

before foreach

 
08.05.2013 00:38
#10
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

I got this partially to work thank you.

Could you please help me to get the minimum/maximum value displayed on the category page?

When I set the minimum quantity to 5 on my product page you'll automatically see a 5 in the quantity input field but on the category page you'll still see a 1. Can you help me connect this value to the minimum/maximum value?


Last change: 08.05.2013 00:40
 
08.05.2013 10:14
#11
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

Use variable

$config = JSFactory::getConfig();
$config->min_count_order_one_product.


Last change: 08.05.2013 10:15
 
08.05.2013 11:42
#12
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Could you please copy the code above and fit in the variables you just replied so I can see where these variables have to be put.

At this point I get the value .$this->config->min_count_order_one_product. returned.

Adding $config->min_count_order_one_product right before foreach doesn't work at all.

Could you please send me the full cartajax.php code??

 
11.05.2013 10:21
#13
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

See code "Ajax Cart 3.0.2"

 
15.05.2013 13:52
#14
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Hi,

I downloaded ajax cart 3.0.2 to see the code and now I've got this:

function onBeforeDisplayProductList(&$products)
{
$config = JSFactory::getConfig();
$this->_includeScripts();
if(count($products) > 0)
{
$minqty = $config->min_count_order_one_product;
if ($minqty<1) $minqty = 1;
foreach($products as $key => $product)
{
if($product->product_quantity > 0)$products[$key]->_tmp_var_top_buttons .= '<div style="float:left;">Aantal: <input type="text" id="iq_'.$product->product_id.'" maxlength="2" size="2" value="'.$minqty.'" name="quantity" /></div>';
$products[$key]->_tmp_var_top_buttons .= '<input type="hidden" value="'.$product->product_id.'" name="product_id" />';
$products[$key]->_tmp_var_top_buttons .= '<div style="height:27px;float:left;margin-left:5px;"><input type="image" src="images/plus.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value++;" value="+">';
$products[$key]->_tmp_var_top_buttons .= '<br /><input type="image" style="margin-top:1px;" src="images/min.png" onclick="document.getElementById(\'iq_'.$product->product_id.'\').value--;" value="-"></div><br />';
}

}
}
}

This still doesn't work....

Please help me! But really help me.. No hints anymore, I've paid a lot for this module so I just like to have a little bit of help.. Not every time a little hint this or that way.. You probably have a lot to do but I'm still a paying customer so I think I should be helped like one...


Last change: 15.05.2013 13:54
 
15.05.2013 16:04
#15
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

Work for my test project.

url?
admin login?
(privat message)


Last change: 15.05.2013 16:04
 
16.05.2013 07:58
#16
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

Work for configuration / checkout / Minimum number of items to be able to order

Not work for Addon "Minimum/maximum number of products in order"
Wiil be fixed latter.



For quick solutions to problems, describe that you use addon


Last change: 16.05.2013 10:14
 
16.05.2013 10:11
#17
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

See code "Ajax Cart 3.0.4"

 
16.05.2013 23:06
#18
maxxrik
Joomshopping forum user no avatar
Name: Rik
24.08.2012
Posts: 16
Quote
Aw: Quantity option on category page

Thank you. I got it to work.

Could you tell me how the following is possible:

If the minimum quantity is 4 and I try to order 1 I do get the message 'minimum quantity should be 4', but then when I order a different product the 4 of the first product is also added to the cart. So the minimum quantity is ALWAYS added when you press the buy button. But that shouldn't be the case because maybe the customer decides not wanting to buy the product if the minimum quantity is 4.

So my question is why is the minimum quantity always added to the cart and how can I change the script so it doesn't add the minimum quantity?


Last change: 16.05.2013 23:08
 
17.05.2013 08:05
#19
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

Addon minimum maximum quantity product
1. Display error "Minimum number of items to be able to order .."
2. add product to cart
3. redirect to cart


will be fixed latter


Last change: 17.05.2013 08:11
 
17.05.2013 14:23
#20
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25938
Quote
Aw: Quantity option on category page

Instal Min/max number of products in order 2.0.2

 
StartPrev 1 2 NextEnd


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.