Quantity in cart not showing correctl
I do have a half finished template installed, the 'programmer' abandoned the job after receiving most of their payment.
I am trying to fix some of the easier bugs myself until I can find reliable help. - pardon me if I use incorrect terminology.
Problem:
Quantity in cart always shows '1' even if there is more than one item in cart, calculated price is CORRECT.
I think the problem is here:
----website: http://www.kwmagic.com--------------...--------------
File: includes/templates/evoluzion/templates/tpl_shopping_cart_default.php
Line #75 : echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
Line #77 : echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
----------------------------------------
value="1" - I think I need this to be the variable for quantity in cart.
Could anyone guide me as to what the variable is AND how if it is possible to change the value="1" to Value = product in cart.
any help appreciated,
thanks
Phil
Re: Quantity in cart not showing correctl
Are you running access restriction?
As a guest I'm not able to view products just your header, categories and footer.
Re: Quantity in cart not showing correctl
Just a glitch I think, I was trying a fix, descriptions are back now.
I can add multiple quantities to the cart, and the total is correct, but the shopping cart only says '1'
thanks for looking
Re: Quantity in cart not showing correctl
Thanks, I can see your quantity input is incorrect now, the input-mini line is not stock.
Test One:
What happens when you use the default Classic Template?
Test Two:
My next guess would be to replace your tpl_shopping_cart_default.php in the current Evoluzion Template with a stock v1.51.
Results?
Re: Quantity in cart not showing correctl
Thanks for the reply
reverting the file did fix the problem, however there are now layout problems.
I used winmerge to compare the files:
this is what is in the stock:
echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
This is in the evoluzion template:
if($product['flagStockCheck'] > 0){
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}else{
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
}
Re: Quantity in cart not showing correctl
This is in the evoluzion template:
<?php
if($product['flagStockCheck'] > 0){
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}else{
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
}
?>
This is stock:
<?php
if ($product['flagShowFixedQuantity']) {
echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}
?>
So this would take the stock code and use the template class
<?php
if ($product['flagShowFixedQuantity']) {
echo $product['showFixedQuantityAmount'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}
?>
The question, where did this come from?
<?php
if($product['flagStockCheck'] > 0){
?>
Because if you're going to keep using it we need to add it back into the code...
Re: Quantity in cart not showing correctl
Thanks for your help on this, it is very much appreciated:
I might be in a little over my head here - I have butchered the code that is on the site right now.
This is the code as it sits in the evoluzion before I started trying to fix this today.
<?php
if ($product['flagShowFixedQuantity']) {
if($product['flagStockCheck'] > 0){
echo $product['showFixedQuantityAmount'] . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}else{
echo $product['showFixedQuantityAmount'] . '<br /><br />' . $product['showMinUnits'];
}
} else {
if($product['flagStockCheck'] > 0){
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}else{
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
}
}
?>
Re: Quantity in cart not showing correctl
This is the code I am using, there are alignment issues now, but the functions seem to work:
<?php
if ($product['flagShowFixedQuantity']) {
if($product['flagStockCheck'] > 0){
echo $product['showFixedQuantityAmount'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '<br /><span class="input-mini">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}
} else {
if($product['flagStockCheck'] > 0){
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><span class="text-error">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}else{
echo '<input type="text" name="cart_quantity[]" value="1" size="4" class="input-mini" />' . '<br /><br />' . $product['showMinUnits'];
}
}
?>
Re: Quantity in cart not showing correctl
Looks like you've almost got it...
your CSS needs this change:
.input-mini{width:60px;}
to this:
.input-mini{width:30px; text-align:center;}
to make the quantity box a reasonable size.
Then the <td> has a class="cartQuantity", you'll want to center it as well.
Anything else?