News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Cart - Cant change quantity + Sprite gone

Started by Ihateit, December 13, 2012, 12:38:04 PM

Previous topic - Next topic

Ihateit

Hey forum,

i have implemented a new custom cart template, but now i cant change the quantity of the product, or remove it. The quantity is just set to the number of products, not inside a "editing" box or anything. How to i add these features again? So i am able to edit quantity and remove the product from the cart.

//Anders J.

Jumbo!

Probably you are using some ajax script to update the quantity and it is creating Javascript errors.

Please check the Error Console of your browser. Your Firebug tools in Firefox to locate the error.

Ihateit

Thanks for the answer :-)

Im not a regular FireFox user, and i cant find any ajax errors in the console of Firebug :/

Couldnt find any ajax erros in Google Chrome developer tool either though

//Anders J.

Ihateit

#3
This is the html/php from the cart/default.php file:

<div class="quantity">
<div class="spacer">
<?php // We Are in The Last Step
if ($cart->mws_cart) { ?>

<form action="<?php echo JRoute::_('index.php'); ?>" method="post" class="inline">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="text" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="quantity" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" />
<?php } else { ?>
<input type="text" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="quantity-confirm" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" disabled="disabled" />
<?php ?>
<?php // We Are in The Last Step
if ($cart->mws_cart) { ?>

<input type="hidden" name="view" value="cart" />
<input type="hidden" name="task" value="update" />
<input type="hidden" name="cart_virtuemart_product_id" value="<?php echo $prow->cart_item_id  ?>" />
<input type="submit" class="refresh-icon" name="update" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" align="middle" value=" "/>
</form>
<?php ?>
</div>
</div>

And this is the only thing that is shown on the site using developer tool from chrome:

http://ajytzler.dk/pics/vmquantityerror.png

Dont know if that helps

Ihateit

I found out!

The form was setup completely wrong. So i made a few adjustments and included everything inside the if, else and second if statements:

<form action="<?php echo JRoute::_('index.php'); ?>" method="post" class="inline">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="text" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" class="quantity" size="3" maxlength="4" name="quantity" value="<?php echo $prow->quantity ?>" />
                                <input type="hidden" name="view" value="cart" />
<input type="hidden" name="task" value="update" />
<input type="hidden" name="cart_virtuemart_product_id" value="<?php echo $prow->cart_item_id  ?>" />
<input type="submit" class="refresh-icon" name="update" title="<?php echo  JText::_('COM_VIRTUEMART_CART_UPDATE'?>" align="middle" value=" "/>
                                </form>