Joomla.it Forum
Componenti per Joomla! => Gestione e-commerce => : pippo30 02 Jul 2013, 11:40:01
-
fare in modo che il pulsante aggiungi carrello sia cliccabile solo una volta dove modificare il codice??? vi ringrazio anticipatamente
-
qualcuno mi da qualche spunto??
-
vorrei che dopo la prima volta che io aggiungo nel carrello un prodotto mi venga fupri un messaggio e che nn mi faccia + aggiungere prodotti
-
components\com_virtuemart\controllers\
public function add() {
$mainframe = JFactory::getApplication();
if (VmConfig::get('use_as_catalog', 0)) {
$msg = JText::_('COM_VIRTUEMART_PRODUCT_NOT_ADDED_SUCCESSFULLY');
$type = 'error';
$mainframe->redirect('index.php', $msg, $type);
}
$cart = VirtueMartCart::getCart();
if ($cart) {
$virtuemart_product_ids = JRequest::getVar('virtuemart_product_id', array(), 'default', 'array');
$success = true;
if ($cart->add($virtuemart_product_ids,$success)) {
$msg = JText::_('COM_VIRTUEMART_PRODUCT_ADDED_SUCCESSFULLY');
$type = '';
} else {
$msg = JText::_('COM_VIRTUEMART_PRODUCT_NOT_ADDED_SUCCESSFULLY');
$type = 'error';
}
$mainframe->enqueueMessage($msg, $type);
$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'));
} else {
$mainframe->enqueueMessage('Cart does not exist?', 'error');
}
}
potrebbe essere qui???