config->get('catalogue', false) && $this->params->get('add_to_cart'); $user = JFactory::getUser(); $enable_wishlist = (hikashop_level(1) && $this->config->get('enable_wishlist', 1) && $this->params->get('add_to_wishlist', 0) && (!$this->config->get('hide_wishlist_guest', 1) || empty($user->guest))); if(!$enable_cart && !$enable_wishlist) return; $classical_url = 'product&task=updatecart&add=1&product_id='.$this->row->product_id.$this->itemid; if(!empty($this->return_url)) $classical_url .= '&return_url=' . urlencode(base64_encode(urldecode($this->redirect_url))); $in_stock = (((int)$this->row->product_quantity == -1 && (empty($this->element->main) || $this->element->main->product_quantity == -1 || $this->element->main->product_quantity > 0)) || (int)$this->row->product_quantity > 0); $has_fields = !empty($this->row->itemFields); $has_required_fields = !empty($this->row->has_required_item_field); $is_free = empty($this->row->prices); $display_free_cart = (int)$this->config->get('display_add_to_cart_for_free_products', 0); $display_free_wishlist = (int)$this->config->get('display_add_to_wishlist_for_free_products', 1); $display_fields = (int)$this->params->get('display_custom_item_fields', 0); $display_quantity_field = (int)$this->params->get('show_quantity_field', 0); $global_on_listing = $this->config->get('show_quantity_field') == 2; if($global_on_listing){ $this->row->quantityFieldName = 'data['.$this->row->product_id.']'; $display_quantity_field = true; } $display_waitlist = (int)$this->params->get('product_waitlist', 0); $waitlist = (int)$this->config->get('product_waitlist', 0) && $display_waitlist; $waitlist_btn = !$in_stock && (hikashop_level(1) && ($waitlist == 2 || ($waitlist == 1 && (!empty($this->element->main->product_waitlist) || !empty($this->row->product_waitlist))))); $has_options = !empty($this->row->has_options) || (!$display_fields && $has_required_fields); $css_button = $this->config->get('css_button', 'hikabtn'); $css_button_cart = $this->config->get('css_button_cart', 'hikacart'); $css_button_wishlist = $this->config->get('css_button_wishlist', 'hikawishlist'); $now = time(); $start_date = (int)(@$this->row->product_sale_start || empty($this->element->main)) ? @$this->row->product_sale_start : $this->element->main->product_sale_start; $end_date = (int)(@$this->row->product_sale_end || empty($this->element->main)) ? @$this->row->product_sale_end : $this->element->main->product_sale_end; $product_available = ($end_date <= 0 || $end_date >= $now) && ($start_date <= 0 || $start_date < $now); $add_to_cart = $enable_cart && $in_stock && (!$is_free || $display_free_cart) && $product_available; $add_to_wishlist = $enable_wishlist && (!$is_free || $display_free_wishlist); $extra_div_name = $this->params->get('extra_div_name', ''); ?> 0 && $end_date < $now) { ?> 0 && $start_date > $now) { ?> params->get('date_format', '%d %B %Y'))); ?>