"paul@veliti.nl", "password" => "test1234"), JSON_UNESCAPED_UNICODE); $responses = ioAPIv2('/v2/authorization', $data,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = '400';} $clientsecret = $responses['token']; $img_url = substr(api_url, 0, -8); //===================================== //end move to index //===================================== //Pagination $current_page = isset($_GET['p']) && is_numeric($_GET['p']) ? (int)$_GET['p'] : 1; $num_products_on_each_page = 25; //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //Get all the categories from the database $categories = ioAPIv2('/v2/categories/','',$clientsecret); $categories = json_decode($categories,true); //IF CATEGORY IS RECEIVED ONLY GET RELATED PRODUCTS $url_input = ''; if(isset($_GET['category'])){ $url_input = 'category='.$_GET['category']; } if (isset($_POST['category'])){ $filter_input = ''; foreach (array_keys($_POST['category']) as $cat_filter){ $filter_input .= $cat_filter.','; } if ($url_input != ''){ $url_input = $url_input.','.substr($filter_input,0, -1); } else { $url_input = 'category='.substr($filter_input,0, -1); } } //GET CATALOG DATA $products = ioAPIv2('/v2/catalog/'.$url_input,'',$clientsecret); $products = json_decode($products,true); //Return QueryTotal from API $total_products = ioAPIv2('/v2/products/'.$GET_VALUES.'&totals=&salesflag=1&status=1','',$clientsecret); $total_products = json_decode($total_products,true); //INCLUDE THE HEADER template_header_top($products_text); $view = '
'.show_offer_product_text.'
'.$stock_status.'
'; if (free_shipment_indicator){ $shipment = freeShipment($product_price,'span'); $view .= $shipment; } $option_id =''; $view .=' '.$product['productname'].''; if (isset($product_price)){ $view .= ''.(($product_price != 0.00) ? currency_code.number_format($product_price,2) : '').''; if (isset($product['rrp']) && $product['rrp'] > 0){ $view .= ''.currency_code.number_format($product['rrp'],2).''; } $view .= ''; } $view .= '