News:

Looking for documentation? Take a look on our wiki

Main Menu

JS Add to Cart Enhancement

Started by balai, March 13, 2012, 19:52:47 PM

Previous topic - Next topic

balai

Hi

It would be nice for the developers to be able to create their own "Add to Cart" popups which contain their own messages.
e.g. Screen was added to the cart or Keyboard was added to the cart

The solution is really simple:
In the ajax request (vmprice.js line 100) to add 2 more vars.
e.g. successmsg=success_something and failmsg=fail_something

Then in the cart's controller (components\com_virtuemart\controllers\cart.php) in the function addJS
to get that messages and pass them to the returned HTML instead of the static $errorMsg Jtext strings

Its easy to be done and would be very helpfull for 3rd party developers

rupesh

Quote from: balai on March 13, 2012, 19:52:47 PM
Hi

It would be nice for the developers to be able to create their own "Add to Cart" popups which contain their own messages.
e.g. Screen was added to the cart or Keyboard was added to the cart

The solution is really simple:
In the ajax request (vmprice.js line 100) to add 2 more vars.
e.g. successmsg=success_something and failmsg=fail_something

Then in the cart's controller (components\com_virtuemart\controllers\cart.php) in the function addJS
to get that messages and pass them to the returned HTML instead of the static $errorMsg Jtext strings

Its easy to be done and would be very helpfull for 3rd party developers
Hii sir!
I want to create a add to cart pop up with more message like product price and product quantity ,product category with same continue and show cart link at bottom?

can it be possible? if yes can u tell me which files to modified !
i research on it and i found  in views/cart/view.html.php   on line 123
$this->json->msg = '<a class="continue" href="' . $continue_link . '" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
      $this->json->msg .= '<a class="floatright" href="' . JRoute::_("index.php?option=com_virtuemart&view=cart") . '">' . JText::_('COM_VIRTUEMART_CART_SHOW_MODAL') . '</a>';
      if ($errorMsg) $this->json->msg .= '<div>'.$errorMsg.'</div>';

got code for continue and show cart  ! but can u tell me from where "product_name  was added to your cart." is coming?

i dont know more about ajax but still i'm trying!
Thank you for consideration!