Php Hook Pre_Add_To_Cart

Hello everyone,

I would like to change the price of the producs that client inserting in the cart under specific circumstances..

For now I have done these steps. Inside my_changes addon in init.php file:

fn_register_hooks(
'pre_add_to_cart'
);
And inside func.php of my_changes addon I want make my processes:
function fn_my_changes_pre_add_to_cart($product_data, $cart, $auth, $update) {
//coding
var_dump($product_data);
//coding
}

But the problem is that I can't see anything.. and I do not know if it is working or made any mistakes..

I want to check if the user belongs to a specific usergroup, (and if yes) change the price of the current product being inserted in the cart. Any ideas or help, please?

Thanks in advance

Hello,

Go into config_local.php, and in the section $config['tweaks'], change the parameter disable_dhtml to true.

This disables ajax processing in most parts of the store, and should let you preview what's happening when customer is adding product to the cart.

Best regards,

Robert

Hello,

Go into config_local.php, and in the section $config['tweaks'], change the parameter disable_dhtml to true.

This disables ajax processing in most parts of the store, and should let you preview what's happening when customer is adding product to the cart.

Best regards,

Robert

Thank you for your reply Robert

Let me try that and get back to you!

Thanks in advance

try

fn_set_notification('W', 'W', var_export($product_data, true));

Hello again,

Both solutions works in order to display the variables. thank you both for your answers