Get coupon code in function onAfterCartProductsLoad

  • Posts: 199
  • Thank you received: 12
  • Hikashop Business
8 years 9 months ago #255706

-- url of the page with the problem -- : watchit11.net
-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6
-- Browser(s) name and version -- : FF

Hi,

I'm developing a plugin got Hikashop. How can I see if the coupon is set and if set, what the values is from the function onAfterCartProductsLoad?
Hope you have a nice tip?

Regards

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
8 years 9 months ago #255731

Hi,

The cart_coupon value is not available in the $cart data passed to the trigger.
So you would have to load it yourself with something like that:

$class = hikashop_get('class.cart');
$cartData = $class->loadCart($cart->cart_id);
echo $cartData->cart_coupon;

The following user(s) said Thank You: Rixters

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum