Add delete all in model cart delete function

24.06.2016 08:24
#1
Sofiosko
Joomshopping forum user no avatar
Name: Marek
25.01.2014
Posts: 4
Quote
Add delete all in model cart delete function

Hello,

i would like to suggest you adding a delete all function into cart model or adding a simple line of code like this

function delete($number_id){
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeDeleteProductInCart', array(&$number_id, &$this) );

unset($this->products[$number_id]);

// Simple delete all when passing all parameter
if($_GET['all'])
unset($this->products);

$this->loadPriceAndCountProducts();
$this->reloadRabatValue();
$this->saveToSession();

$dispatcher->trigger('onAfterDeleteProductInCart', array(&$number_id, &$this) );
}

OR whole function

function deleteAll()
{
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeDeleteProductInCart', array(&$number_id, &$this) );

unset($this->products);

$this->loadPriceAndCountProducts();
$this->reloadRabatValue();
$this->saveToSession();

$dispatcher->trigger('onAfterDeleteProductInCart', array(&$number_id, &$this) );
}

Thanks for reading.

 
24.06.2016 08:54
#2
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 19141
Quote
Aw: Add delete all in model cart delete function

will be in new version new function deleteAll()

 


Copyrights MAXXmarketing GmbH. All Rights Reserved
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.