";
// VIDEO
// deaktiviert seit 09.02.2022
//$is_video = url_check("https://salonfinder.newsha.pro/videos/".$store_data["kundennummer"].".mp4");
//
$headline = "Willkommen bei Friseur SALONNAME,
deinem NEWSHA Partnersalon in STADT";
$headline = str_ireplace(array("SALONNAME", "STADT"), array('
'.$store_data['shopname'].'', '
'.$store_data['stadt'].''), $headline);
// HEADLINE
echo "
".$headline."
";
// TAGS
/*echo "
";*/
echo "
";
foreach($services as $index=>$service) {
if (strpos($store_data["tags"], "-".$index."-") !== false) {
echo "
{$service}
";
}
}
echo "
";
// ICONS
$icon_cols = 0;
// Icons zählen für korrekte COL-Anzahl
if (strpos($store_data["provision_shoppartner"], "50") !== false) {
$icon_cols++;
}
if ($store_data["NACHFUELLBAR_SALONFINDER"] == "J") {
$icon_cols++;
}
if ($store_data["RESCUE_SYSTEM_SALONFINDER"] == "J") {
$icon_cols++;
}
if ($store_data["STRAIGHTENING_SYSTEM_SALONFINDER"] == "J") {
$icon_cols++;
}
if ($store_data["GLAMOUR_SHOPPING_WEEK_SALONFINDER"] == "J") {
$icon_cols++;
}
$icon_cols = floor(12/$icon_cols);
echo "
";
// ICON SALON SHOPPARTNER
//if ($store["salon_mitgliedschaft"] == "D") {
if (strpos($store_data["provision_shoppartner"], "50") !== false) {
echo "
";
}
// ICON ECO / REFILL
if ($store_data["NACHFUELLBAR_SALONFINDER"] == "J") {
echo "
";
}
// RESCUE SYSTEM
if ($store_data["RESCUE_SYSTEM_SALONFINDER"] == "J") {
echo "
";
}
// STRAIGHTENING SYSTEM
if ($store_data["STRAIGHTENING_SYSTEM_SALONFINDER"] == "J") {
echo "
";
}
// GLAMOUR SHOPPING WEEK
/*if ($store_data["GLAMOUR_SHOPPING_WEEK_SALONFINDER"] == "J") {
echo "
GLAMOUR Shopping Week Salon
";
}*/
if ($store_data["GLAMOUR_SHOPPING_WEEK_SALONFINDER"] == "J") {
echo "
";
}
echo "
";
// TEXT "ÜBER UNS"
if ($show_ueberuns) {
echo "
";
echo "
";
echo nl2br($store_data["salonfinder_text"]);
echo "
";
}
// TEXT "AKTUELLES"
if ($show_aktuelles) {
echo "
";
if ($store_data["salonfinder_headline_aktuelles1"] != "") {
echo "
".$store_data["salonfinder_headline_aktuelles1"]."
";
}
if ($store_data["salonfinder_text_aktuelles_1"] != "") {
echo "
".nl2br($store_data["salonfinder_text_aktuelles_1"])."
";
}
if ($store_data["salonfinder_headline_aktuelles2"] != "") {
echo "
".$store_data["salonfinder_headline_aktuelles2"]."
";
}
if ($store_data["salonfinder_text_aktuelles_2"] != "") {
echo "
".nl2br($store_data["salonfinder_text_aktuelles_2"])."
";
}
}
// FAVORITEN
if ($store_data["salon_mitgliedschaft"] == "D") {
echo "
SHOPPE JETZT UNSERE SALON FAVORITEN
";
echo "
";
define('BASEURL','https://newsha.de/');
$apiUser = 'newshasalons';
$apiPass = 'njudah&%gzusd114';
$apiUrl = BASEURL.'index.php/rest/V1/integration/admin/token';
/*
Magento 2 REST API Authentication
*/
$data = array("username" => $apiUser, "password" => $apiPass);
$data_string = json_encode($data);
try{
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$token = curl_exec($ch);
$token = json_decode($token);
if(isset($token->message)){
echo $token->message;
}else{
$key = $token;
}
}catch(Exception $e){
echo 'Error: '.$e->getMessage();
}
/*
Get Product By SKU REST API Magento 2
Use above key into header
*/
$headers = array("Authorization: Bearer $key");
//$requestUrl = BASEURL.'index.php/rest/V1/products/S-351?fields=custom_attributes,name';//24-MB01 is the sku.
//$requestUrl = BASEURL.'index.php/rest/V1/products?searchCriteria[page_size]=10';// get total 10 products
//$requestUrl = BASEURL.'index.php/rest/V1/categories/24/products';// 24 category id
//$requestUrl = BASEURL.'index.php/rest/V1/products?searchCriteria=';//get all products
//echo "-----------------------
";
/*
$ch = curl_init();
try{
$ch = curl_init($requestUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$result = json_decode($result);
if(isset($result->message)){
echo "OKOK";
echo "
";
print_r(get_object_vars($result->message));
echo "
";
}else{
echo "
";
print_r(get_object_vars($result));
echo "
";
//print_r($result);
}
}catch(Exception $e){
echo 'Error: '.$e->getMessage();
}
*/
//echo "-----------------------";
$image = 'category_page_grid';
$hover_image = 'category_page_grid-hover';
$image_width = 300;
$image_height = 300;
$_category_config['aspect_ratio'] = 0;
$auffuell_produkte = array("S-351", "S-346", "S-340", "S-347", "S-349", "S-348", "S-342", "S-345", "S-363", "S-367");
shuffle($auffuell_produkte);
// Harburg: https://www.newsha.de/shoppartner/20986/newsha-classic-heat-protecting-blowout-spray.html
// Mo7: https://www.newsha.de/shoppartner/23982/newsha-classic-heat-protecting-blowout-spray.html
// Alle 5 möglichen Favoriten durchgehen
// Sollten es zu wenige geben, dann auffüllen mit Newsha Auffüll-Produkten
for ($i = 1; $i <= 5; $i++) {
$proddata_arr = array(
);
try {
$requestUrl = BASEURL.'index.php/rest/V1/products/'.$store_data["favoriten_{$i}"].'?fields=custom_attributes,name';
$ch = curl_init();
$ch = curl_init($requestUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$result = json_decode($result);
if(isset($result->message)){
/*echo "ERROR: -> ".$store_data["favoriten_{$i}"];
echo "
";
print_r(($result->message));
echo "
";*/
throw new Exception();
}else{
/*echo "
";
print_r(get_object_vars($result));
echo "
";*/
$proddata_arr = get_object_vars($result);
//print_r($result);
}
} catch (Exception $e) {
//$_item = $productRepository->get($auffuell_produkte[$i]);
$requestUrl = BASEURL.'index.php/rest/V1/products/'.$auffuell_produkte[$i].'?fields=custom_attributes,name';
$ch = curl_init();
$ch = curl_init($requestUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$result = json_decode($result);
if(isset($result->message)){
/*echo "ERROR";
echo "
";
print_r(get_object_vars($result->message));
echo "
";*/
//throw new Exception();
}else{
/*echo "
";
print_r(get_object_vars($result));
echo "
";*/
$proddata_arr = get_object_vars($result);
//print_r($result);
}
}
/*echo "
";
print_r($proddata_arr);
echo "
";*/
if (empty($proddata_arr)) { continue; }
$proddata_arr["url_key"] = get_object_vars($proddata_arr["custom_attributes"][2])["value"];
$proddata_arr["image_url_key"] = get_object_vars($proddata_arr["custom_attributes"][1])["value"];
$product_link = $base_newsha_url."/shoppartner/".$store_data["kundennummer"]."/".$proddata_arr["url_key"].".html";
$product_name = $proddata_arr["name"];
?>
}
// Shop-Grafik nach den Favoriten-Produkten
$product_link = $base_newsha_url."/shoppartner/".$store_data["kundennummer"]."/alle-produkte.html";
$product_name = " ";
?>
echo "
";
}
// UNSERE TIPPS
$slide_items_txt = "";
$slide_ctr = 0;
for ($i = 1; $i <= 3; $i++) {
if ($store_data["multipage_slide_{$i}_headline"] != "") {
$slide_img = "";
if(url_check("https://salonfinder.newsha.pro/multipage_slider/".$store_data["kundennummer"]."_{$i}.jpg")) {
$slide_img = "

";
}
$active_slide = "";
if (++$slide_ctr == 1) {
$active_slide = " active";
}
$slide_items_txt .= "
{$slide_img}
".$store_data["multipage_slide_{$i}_headline"]."
".$store_data["multipage_slide_1_text"]."
";
}
}
if ($slide_items_txt != "") {
echo "
";
echo "
{$slide_items_txt}
";
if ($slide_ctr > 1) {
echo "
Previous
Next
";
}
echo "
";
}
// ECO
if ($store_data["salon_mitgliedschaft"] == "D") {
echo "
PRODUKTE NACHFÜLLEN & SPAREN
";
echo "
Das Zusammenspiel aus Nachhaltigkeit & Fortschritt steht bei NEWSHA an erster Stelle. NEWSHA verfügt nicht nur über recyclebare Produktverpackungen, sondern schont zusätzlich die Umwelt mit einem Eco-Nachfüllservice in teilnehmenden Partner-Salons.
";
}
// TEXT "GOOGLE BEWERTUNGEN"
if($store_data["googleplaceid"]!="NOPLACE" && !empty($store_data["googleplaceid"])){
echo "
";
$fullurl = "https://maps.googleapis.com/maps/api/place/details/json?place_id=".$store_data["googleplaceid"]."&fields=name,reviews,user_ratings_total,rating&language=de&key=AIzaSyBipMMdEEUc92uzr9-T8pxy1C3F1vtxQgM";
$string = file_get_contents($fullurl);
$json = json_decode($string, true);
$ratingstring = "";
$rest = $json["result"]["rating"];
for($i=1;$i<6;$i++){
if($rest >= 1) $ratingstring .= "
";
elseif($rest > 0) $ratingstring .= "
";
else $ratingstring .= "
";
$rest -= 1;
}
echo "
".$json["result"]["rating"]." / 5
".$ratingstring."
".$json["result"]["user_ratings_total"]." Bewertungen
";
if(count($json["result"]["reviews"])>0){
$counter = 0;
foreach($json["result"]["reviews"] as $review){
$ratingstring = "";
$rest = $review["rating"];
for($i=1;$i<6;$i++){
if($rest >= 1) $ratingstring .= "
";
elseif($rest > 0) $ratingstring .= "
";
else $ratingstring .= "
";
$rest -= 1;
}
echo "
".$review["author_name"]."
".$ratingstring." ".$review["relative_time_description"]."
".$review["text"]."
";
$counter++;
}
}
}
// SALONSYSTEME
$show_systems = false;
if (
($store_data["RESCUE_SYSTEM_SALONFINDER"] == "J") ||
($store_data["STRAIGHTENING_SYSTEM_SALONFINDER"] == "J")
) {
$show_systems = true;
}
if ($show_systems) {
echo "
";
echo "
";
if ($store_data["STRAIGHTENING_SYSTEM_SALONFINDER"] == "J") {
echo"
";
}
if ($store_data["RESCUE_SYSTEM_SALONFINDER"] == "J") {
echo"
";
}
echo "
";
}
// GUTSCHEIN VERKAUF (Affiliate-Gutschein-Links)
/*
if ($store_data["verkauf_gutscheine"] == "J") {
echo "
Support your local Hairdresser
Unterstütze jetzt deinen NEWSHA Lieblingsfriseur! Wie sagt man so schön: Vorfreude ist die schönste Freude und genau aus diesem Grund kannst du dir ab sofort Gutscheine für den nächsten Besuch im Salon sichern. Du hast die Wahl zwischen 3 Wertgutscheinen in Höhe von 30€, 60€ oder 120€ und kannst diese in deinem Lieblings-Salon für Dienstleistungen und NEWSHA Produkte einlösen.
Kaufe jetzt einen Salon-Gutschein und sichere dir gratis deine limitierte Mysterybox im Wert von bis zu 86,50€.
Wähle jetzt deinen Wunschgutschein:
Hinweis: Die Einlösung des Gutscheines ist nur im ausgewählten Salon möglich. Der Gutschein gilt nicht für den Kauf von Waren im NEWSHA Onlineshop www.newsha.de. Umtausch/Rückgabe des Gutscheines sind ausgeschlossen.
";
}
*/
/*echo "
";*/
// LINKS: DATEN | RECHTS: TEXT | BILDER | VIDEO
echo "