Product successfully removed message

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Fri Jun 28, 2013 10:44 am
Reply with quote
Report this post
Good day -

I don't want the user of my shop to see the Product successfully removed message displayed in the system message container (or indeed at all).

Please advise how I can stop this message displaying?

Thanks!
User avatar
Gold Boarder

GK User
Fri Jun 28, 2013 2:19 pm
Reply with quote
Report this post
Hi,
two solutions (tips):

1) Remove this message from language file - client wont see it
2) OR find this message phrase in language file copy big letters then search in VM source code where is it, and remove this line from code with <span> or <div> around it.


You can always request support from us, but you need take in your mind that customization is not regular Template support.
User avatar
Platinum Boarder

GK User
Fri Jun 28, 2013 4:21 pm
Reply with quote
Report this post
Hi Pavel,

First of all, I tried just removing the text from the language file but although this stopped displaying the text it still showed the black bar at the top of the screen.

So, next I tried your alternative method.
I searched the language file and found big letters were: COM_VIRTUEMART_PRODUCT_REMOVED_SUCCESSFULLY

I searched for this and the only place I found it in was /components/com_virtuemart/controllers/cart.php

I found it twice within the code: at line 334 - 362

public function delete() {
$mainframe = JFactory::getApplication();
/* Load the cart helper */
$cart = VirtueMartCart::getCart();
if ($cart->removeProductCart())
$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_REMOVED_SUCCESSFULLY'));
else
$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_NOT_REMOVED_SUCCESSFULLY'), 'error');

$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'));
}

/**
* Delete a product from the cart
*
* @author RolandD
* @access public
*/
public function update() {
$mainframe = JFactory::getApplication();
/* Load the cart helper */
$cartModel = VirtueMartCart::getCart();
if ($cartModel->updateProductCart())
$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_UPDATED_SUCCESSFULLY'));
else
$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_NOT_UPDATED_SUCCESSFULLY'), 'error');

$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'));
}

Unfortunately, when I modified this code it broke the add item to cart function.

Did I change it correctly?

I rewrote line 339 as

<div>$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_REMOVED_SUCCESSFULLY'));</div>

and line 357 as

<div>$mainframe->enqueueMessage(JText::_('COM_VIRTUEMART_PRODUCT_UPDATED_SUCCESSFULLY'));</div>


Thanks for your further advice in advance!
User avatar
Gold Boarder


cron