Ejemplo n.º 1
0
            $off_percentage = 100 - $sale['sale_price'] * 100 / $sale['product_price'];
        }
        ?>
                <span style="float:left;"> Före:
                <?php 
        echo makeCurrency($sale['product_price']);
        ?>
                kr <br>
                <label style="color:red">Nu:
                  <?php 
        echo makeCurrency($new_value);
        ?>
                  kr</label>
                </span> <span class="persentage_img">-
                <?php 
        echo makeCurrency($off_percentage);
        ?>
                %</span> </li>
              <!--pro_slider-->
              <?php 
    }
} else {
    echo '<li>No product available</li>';
}
?>
            </ul>
          </div>
          <div class="clear"></div>
        </div>
        <!--showcase-->
        <div class="clear"></div>
Ejemplo n.º 2
0
        echo trim_text(strip_tags($sale['product_name']), 25);
        ?>
                </p>
                <span class="clear"></span>
                <span style="float:left;"> Före:
                <?php 
        echo makeCurrency($sale['product_price']);
        ?>
                kr <br>
                <label style="color:red">Nu:
                  <?php 
        echo makeCurrency($sale['sale_value']);
        ?>
                  kr</label>
                </span> <span class="persentage_img">-<?php 
        echo makeCurrency($sale['api_reduction_percent']);
        ?>
%</span></li>
              <!--pro_slider-->
              <?php 
    }
} else {
    echo '<li>No product available</li>';
}
?>
            </ul>
          </div>
          <div class="clear"></div>
        </div>
        <!--showcase-->
        <div class="clear"></div>
Ejemplo n.º 3
0
    public function wishlist()
    {
        $this->load->library('pagination');
        $config['base_url'] = base_url() . 'category/whishlist_product';
        $config['total_rows'] = $this->wishlist_model->get_all_wishedproducts_count();
        $config['per_page'] = 24;
        $config['uri_segment'] = $this->uri->segment(3);
        $this->pagination->initialize($config);
        $offset = $config['uri_segment'];
        $limit = $config['per_page'];
        $this->pagination->initialize($config);
        $wishlist_products = $this->wishlist_model->get_all_wishedproducts($limit, $offset);
        $pro_html = '';
        if ($wishlist_products) {
            foreach ($wishlist_products as $wishlist_product) {
                $products = $this->product_model->get_product_detail($wishlist_product['product_id']);
                if ($products) {
                    if ($products['from_api'] == 0) {
                        $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                        $iarr = getimagesize($image_path_original);
                        if (!is_array($iarr)) {
                            $image_path_original = image_asset_url('no_image.gif');
                        }
                    } else {
                        //$image_path_original = $products['product_image'];
                        $image_path_original = str_replace('440', '220', $products['product_image']);
                    }
                    $img_featue = 'heart_red.jpg';
                    $heart_class = '<div class="remove_wish" rel="' . $wishlist_product['wish_id'] . '" id="wish_heart_' . $wishlist_product['wish_id'] . '" style="display:none">
									' . image_asset($img_featue) . '
								</div>';
                    $sale_tag = '';
                    if ($products['sale_type_id'] == '1') {
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
								<br>
								<label style="color:red">Nu: ' . makeCurrency($products['sale_value']) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . makeCurrency(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
								</div>';
                    } elseif ($products['sale_type_id'] == '2') {
                        $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
								<br>
								<label style="color:red">Nu: ' . makeCurrency($products['product_price'] - $now_price) . ' kr</label> </span>
								<div class="persentage_imgs">
									-' . makeCurrency($products['sale_value']) . '%
								</div><!--persentage_img-->';
                    } elseif ($products['sale_type_id'] == '5') {
                        $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_price']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . $products['api_reduction_percent'] . '%
							</div>';
                    }
                    $pro_html .= '<div class="cata_pro product_detail"  rel="' . $wishlist_product['wish_id'] . '">
										<a id="product_' . $products['pro_id'] . '" href="' . base_url() . 'product/product_detail/' . $products['pro_id'] . '" ><img src="' . $image_path_original . '"/></a>
										
										' . $heart_class . '
										<p>
											' . $products['product_name'] . '
										</p>
										<div class="clear"></div>									
										' . $sale_tag . '
									</div>';
                }
            }
        } else {
            $pro_html .= '
                            Det finns inga produkter i önskelistan.
                            <h2 style="margin-top:10px;">
                                Fördelar med SaleFinder önskelista
                            </h2>
                            <ul>
                               <li> 
                                Du kan spara produkter till nästa gång du loggar in
                               </li>
                               <li>
                                Du kan enkelt jämföra produkterna du har i önskelistan
                               </li>
                               <li>
                                Det blir lätt att ha alla dina favorit reavaror på ett ställe
                               </li>
                            </ul>
                ';
        }
        // $data['category_name']     = get_categroy_name(149);
        // $data['product_category']  = get_product_oncategory(149);
        // //$data['product_category']  = '';
        // $data['other_choice']      = other_choice_category();
        // $data['related_categories']= related_categories(149);
        // $data['sales_to_missed']   = sales_not_missed();
        $data['products'] = $pro_html;
        $data['pagination'] = $this->pagination->create_links();
        $this->template->load('responsive/default', 'responsive/wishlist', $data);
    }
Ejemplo n.º 4
0
    public function index()
    {
        $query_params = $this->input->get();
        $tmp_url = '';
        if (isset($query_params['brand'])) {
            $tmp_url .= "&brand=" . $query_params['brand'];
        }
        if (isset($query_params['min_price'])) {
            $tmp_url .= "&min_price=" . $query_params['min_price'];
        }
        if (isset($query_params['max_price'])) {
            $tmp_url .= "&max_price=" . $query_params['max_price'];
        }
        $cat_id = $_GET['cat_id'];
        $config['base_url'] = base_url() . 'category/?cat_id=' . $_GET['cat_id'] . $tmp_url;
        $config['total_rows'] = $this->product_model->total_product_by_category($_GET['cat_id']);
        $config['per_page'] = 24;
        $config['prev_link'] = '&lt; Föregående';
        $config['next_link'] = 'Nästa &gt;';
        $config['uri_segment'] = isset($_GET['per_page']) ? $_GET['per_page'] : 0;
        //$this->pagination->initialize($config);
        $offset = $config['uri_segment'];
        $limit = $config['per_page'];
        $config['enable_query_strings'] = TRUE;
        $config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);
        $products = $this->product_model->product_by_category($cat_id, $limit, $offset);
        $pro_html = '';
        if ($products) {
            foreach ($products as $products) {
                if ($products['from_api'] == 0) {
                    $image_path_original = other_asset_url($products['product_image'] . '_m.' . $products['product_ext'], '', 'uploads/images/products');
                } else {
                    $image_path_original = str_replace('440', '220', $products['product_image']);
                }
                //        echo $image_path_original ;
                //$iarr = @getimagesize($image_path_original);
                //if(!is_array($iarr)){
                //$image_path_original = image_asset_url('no_image.gif');
                //      }
                $img_featue = 'header.jpg';
                $heart_class = '<div class="heart" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '" style="display:none">
										' . image_asset($img_featue) . '
									</div>';
                $whislist_detail = $this->wishlist_model->get_wishlist_detail_product($products['pro_id']);
                if ($this->wishlist_model->get_wishlist_detail_product($products['pro_id'])) {
                    $img_featue = 'heart_red.jpg';
                    $heart_class = '<div class="heartred" rel="' . $products['pro_id'] . '" id="wish_heart_' . $products['pro_id'] . '">
										' . image_asset($img_featue) . '
									</div>';
                }
                $sale_tag = '';
                if ($products['sale_type_id'] == '1') {
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_value']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . makeCurrency(100 - $products['sale_value'] / $products['product_price'] * 100) . '%
							</div>';
                } elseif ($products['sale_type_id'] == '5') {
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['sale_price']) . ' kr</label> </span>
							<div class="persentage_imgs">
								-' . $products['api_reduction_percent'] . '%
							</div>';
                } elseif ($products['sale_type_id'] == '2') {
                    $now_price = $products['product_price'] * ($products['sale_value'] / 100);
                    $sale_tag = '<span style="float:left;"> Före: ' . makeCurrency($products['product_price']) . ' kr
							<br>
							<label style="color:red">Nu: ' . makeCurrency($products['product_price'] - $now_price) . ' kr</label> </span>
							<div class="persentage_imgs">
										-' . makeCurrency($products['sale_value']) . '%
							</div><!--persentage_img-->';
                } else {
                    $sale_tag = '<span style="float:left;"> 
							<label style="color:red">Nu:' . makeCurrency($products['product_price']) . ' kr</label> </span>';
                    if ($products['sale_type_id'] == '3') {
                        $sale_tag .= '<br /><span style="float:left;"><label> Buy 1 get ' . $products['sale_value'] . ' free</label></span>';
                    }
                    if ($products['sale_type_id'] == '4') {
                        $deals = explode('_', $products['sale_value']);
                        $sale_tag .= '<span style="float:left;"><label >Buy ' . $deals[0] . ' and pay for ' . $deals[1] . '</label></span>';
                    }
                }
                $pro_html .= '<div class="cata_pro product_detail" rel="' . $products['pro_id'] . '">
									<a id="product_' . $products['pro_id'] . '" href="' . base_url() . 'product/product_detail/' . $products['pro_id'] . '" ><img src="' . $image_path_original . '"/></a>
									
									' . $heart_class . '
									<p>
										' . trim_text(strip_tags($products['product_name']), 32) . '
									</p>
									<div class="clear"></div>									
									' . $sale_tag . '
								</div><!--cata_pro-->';
            }
        } else {
            $pro_html .= '<div class="cata_pro"><p>Kommer snart! </p></div>';
        }
        $cat_id = $this->input->get("cat_id");
        $data['category_name'] = get_categroy_name($cat_id);
        $data['category_detail'] = $this->categories_model->get_category_detail($cat_id);
        $data['product_category'] = get_product_oncategory($cat_id);
        //$data['product_category']  = '';
        $data['other_choice'] = other_choice_category();
        $data['related_categories'] = related_categories($cat_id);
        $data['sales_to_missed'] = sales_not_missed();
        $data['products'] = $pro_html;
        $data['pagination'] = $this->pagination->create_links();
        $data['query_params'] = $this->input->get();
        $data['total_records'] = $config['total_rows'];
        $this->template->load('responsive/default', 'responsive/category', $data);
        //$this->output->enable_profiler(TRUE);
    }