-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.10
So I've been playing around with Hikashop the past few days and really like some of the ideas here:
https://www.virgowebdesign.com/blog/5-awesome-enhancements-you-can-apply-to-your-hikashop-e-commerce-store
Is there any sort of tutorial for adding the cart product count into a custom module and have it refresh by AJAX on events? Have been toying now with:
if(window.Oby) {
window.Oby.registerAjax(["cart.updated","wishlist.updated"],function(params){
var cart = (params.type == "cart"),
p = window.cartNotifyParams,
text = p.text,
class_name = "success",
class_icon = "check";
var userCart = document.getElementById('user-console-cart-count');
var productCount = userCart.innerHTML;
productCount++;
userCart.innerHTML = productCount;
if(params.notify === false)
return;
if(params.resp.ret == 0) {
class_name = "warning",
class_icon = "close",
text = p.err_text;
}
if(params.resp.message)
text = params.resp.message;
UIkit.notify("<i class='uk-icon-" +class_icon+ "'></i> " + text, {status:class_name});
return true;
});
}
Update runs also on delete from cart so still need to correct that, but was wondering if there isn't a build in and more robust solution which I haven't found yet.
After this, next would be to make the cart module in a UIkit modal