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

Problem with Add to cart popup message

Started by AtPaul, October 23, 2009, 12:24:14 PM

Previous topic - Next topic

AtPaul

Hi all,

Here is the problem I have. Not sure yet if this is a bug.

- For instance: identify a product for which only 5 items are available in stock (5 products left)
- Add to cart this product one by one up to five
- Pop up says "Product added to the cart" or something like that --> which is excellent

- However if you now try to add one more product (when stock says zero) the popup comes up showing no message at all.
Searching a bit in the code I found that this might be dealt with in ps_cart.php. It seems that the key PHPSHOP_CART_QUANTITY_EXCEEDED would not be printed.

Any idea ?

Thanks



Scar

Confirmed. No message with either AJAX or without AJAX add to cart is displayed when trying to add 0 stock products with Check Stock enabled.

Fresh install with standard milkyway template, J1.5.14 and VM 1.1.4, on XAMPP 1.7.1 (PHP5.2.9)

Scar

Problem is in ps_cart.php. I think this line:$vmLogger->tip( $VM_LANG->_('PHPSHOP_CART_QUANTITY_EXCEEDED',false) );

should be in the elseif right before return false, it seems to work then. So the whole thing should look like:

(Line 283-290)
else if ($request_stock ) {
           $vmLogger->tip( $VM_LANG->_('PHPSHOP_CART_GOTO_WAITING_LIST',false) );
} elseif( $total_quantity == 0 ) {
vmRequest::setVar('product_id', $product_id );
$GLOBALS['last_page'] = 'shop.product_details';
$vmLogger->tip( $VM_LANG->_('PHPSHOP_CART_QUANTITY_EXCEEDED',false) );
return false;
}

AtPaul

Thanks a lot Scar. This works great. Good job.
For those who get the same pb please also make sure you have a key PHPSHOP_CART_QUANTITY_EXCEEDED valued in your language file (it happened to me  ;D)

deemee3

#6
Dear Scar,

I said in the other topic ( http://forum.virtuemart.net/index.php?topic=61913.0 ) that this didn't work for me. I discovered why: when you add 1 (or more) with the add-to-cart button after the stock limit is already reached, your solution works fine and the message correctly appears in the cart dropdown saying "Info: The selected quantity exceeds quantity available in stock". If you enter an excessive quantity right from the start though (let's say 6 when 5 are in stock), than it's the out-of-stock message that loads instead of the dropdown one. So we're half way through the solution...:-)) Hope you (or someone else) can help us.

:)

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
7x3:
Shortcuts: ALT+S post or ALT+P preview