For those interested, I wrote the below code and put it under the checkout->cart override. It checks to see if a custom product is in the cart - in this case product id 723 "R10 donation to Children at Risk Centres".
If not, it displays a link and notice that read the following:
"Click here to add R10.00 to your order for the Outreach Mission Fund for support of the Children at Risk Centres in Africa."
If the customer has clicked the donation link, the cart reads as follows:
"Thank you! Your donation to the Outreach Mission Fund is greatly appreciated."
Any comments to refactor/refine?
<?php
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart(true);
if ($cart) {
$numberOfProducts = count($cart->products);
for ($i=0; $i < $numberOfProducts; $i++) {
$productName[$i] = $cart->products[$i]->product_name;
}
if (in_array("R10 donation to Children at Risk Centres", $productName)) { ?>
<div class="alert alert-success"><strong>Thank you!</strong> Your donation to the Outreach Mission Fund is greatly appreciated.</div><?php
}
else { ?>
<div class="alert alert-warning"><strong><a href="/index.php?option=com_hikashop&ctrl=product&task=updatecart&product_id=723&quantity=1&checkout=2">Click here to add R10.00</a></strong> to your order for the Outreach Mission Fund for support of the Children at Risk Centres in Africa.</div><?php
}
}
?>