Bildschirm abhängig Artikel Auflistung festlegen für VEYTON 4.0.12
Um dies einzusetzen brauchst du Kenntnisse von SQL, PHP, JScript.
Alle Angaben ohne gewahr.
Vorher deine Webseite als Backup speichern. Auch die SQL Tabelle beim Provider oder auf deinem Server. Damit kannst du der alte Stand wieder zurück setzen.
Basis sind die CSS Stylesheets für die gewünschte Bildschirmauflösung, die musst du selber erstellen.
Dieser Scripts Anpassungen sorgen dafür das beim ersten Seiten Aufruf eine Cookie abgelegt wird und beim zweite Seiten aufruf das Cookie verwendet wird um die Artikel Auflistung wie gewünscht darzustellen. Habt ihr eine Seite die zuerst abgerufen wird ist aber nicht der Shop dann auch das js auf dieser Seite ein pflegen. Damit erreicht man dass wenn danach auf der Shop geklickt wird die Artikel Auflistung direkt richtig dargestellt wird. Geht der Kunde direkt in den Shop rein dann wird dieses erst nach der zweiten Seitenaufruf richtig gelistet.
Beispiel auf ww.gis-style.com:D
Viel Spaß beim programmieren!
Auf Fragen reagiere ich nicht!
Die aufgelistet xy1 bis xy8 musst du ersetzen mit deine Werte.
xy1 dein Webroot verzeichnis
xy2 dein Template
xy3 dein shopdatenbank
xy4 tabelle _config_1
xy5 tabelle _config_plugin
xy6 SQL Server provider
xy7 User SQL Server provider
xy8 Passwort User SQL Server provider
Im Datei:
xy1 \shop\xtCore\style.php
Nachfolgende script hinzufügen:
<script type="text/javascript">
if (screen.width > 1920){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1920.css'; ?>" />');
}
else if (screen.width == 1920){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1920.css'; ?>" />');
}
else if (screen.width == 1776){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1776.css'; ?>" />');
}
else if (screen.width == 1680){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1600.css'; ?>" />');
}
else if (screen.width == 1600){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1600.css'; ?>" />');
}
else if (screen.width == 1440){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1440.css'; ?>" />');
}
else if (screen.width == 1400){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1440.css'; ?>" />');
}
else if (screen.width == 1280){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1280.css'; ?>" />');
}
else if (screen.width == 1360){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1280.css'; ?>" />');
}
else if (screen.width == 1152){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1152.css'; ?>" />');
}
else if (screen.width == 1184){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1152.css'; ?>" />');
}
else if (screen.width == 1024){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet1024.css'; ?>" />');
}
else if (screen.width == 800){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet800.css'; ?>" />');
}
else if (screen.width > 0){
document.write('<link rel="stylesheet" type="text/css" href="<?php echo _SYSTEM_BASE_URL._SRV_WEB._SRV_WEB_TEMPLATES._STORE_TEMPLATE.'/css/stylesheet.css'; ?>" />');
}
</script>
Im Datei:
xy1 \shop\templates\xy2\javascript\js.php
Nachfolgende script hinzufügen:
<script type='text/javascript'>
<!--
var a = new Date();
a = new Date(a.getTime() +1000*60*60*24*365);
var b = screen.width;
document.cookie = 'Bildschirmbreite='+ b +'; expires='+a.toGMTString()+';';
//-->
</script>
Im Datenbank xy3 die Tabelle xy4 die Variable config_value anpassen.
Dies gilt für Auflistung von Kategorien und unter Kategorien.
SQL-Befehl:
UPDATE `xy4` SET `config_value` = '20',
`last_modified` = NULL ,
`type` = NULL ,
`url` = NULL WHERE `id` =32 LIMIT 1 ;
UPDATE `xy4` SET `config_value` = '20',
`last_modified` = NULL ,
`type` = NULL ,
`url` = NULL WHERE `id` =33 LIMIT 1 ;
Im Datenbank xy3 die Tabelle xy5 die Variable XT_STARTPAGE_PRODUCTS_PAGE_LIMIT anpassen.
Dies gilt für Auflistung von der Startseite
SQL-Befehl:
UPDATE `xy5` SET `config_value` = '4',
`last_modified` = NOW( ) ,
`date_added` = NULL WHERE `id` =75 LIMIT 1 ;
Im Datenbank xy3 die Tabelle xy5 die Variable XT_NEW_PRODUCTS_PAGE_LIMIT anpassen.
Dies gilt für Auflistung von Neue Produkte
SQL-Befehl:
UPDATE `xy5` SET `config_value` = '3',
`last_modified` = NOW( ) ,
`date_added` = NULL WHERE `id` =92 LIMIT 1 ;
Im Datenbank xy3 die Tabelle xy5 die Variable XT_SPECIAL_PRODUCTS_PAGE_LIMIT anpassen.
Dies gilt für Auflistung von Angebote
SQL-Befehl:
UPDATE `xy5` SET `config_value` = '1',
`last_modified` = NOW( ) ,
`date_added` = NULL WHERE `id` =72 LIMIT 1 ;
Im Datenbank xy3 die Tabelle xy5 die Variable XT_BESTSELLER_PRODUCTS_PAGE_LIMIT anpassen.
Dies gilt für Auflistung von Top Artikel
SQL-Befehl:
UPDATE `xy5` SET `config_value` = '10',
`last_modified` = NOW( ) ,
`date_added` = NULL WHERE `id` =132 LIMIT 1 ;
Neue Datei erstellt im Verzeichnis
Xy1\shop\conf\artlisting.php
Mit der Inhalt;
defined('_VALID_CALL') or die('Direct Access is not allowed.');
$cookie = $_COOKIE["Bildschirmbreite"];
if ( $cookie > 1920 ) { $AnzahlArtikelProSeite = 40 ; } else
if ( $cookie == 1920 ) { $AnzahlArtikelProSeite = 35 ; } else
if ( $cookie == 1776 ) { $AnzahlArtikelProSeite = 35 ; } else
if ( $cookie == 1680 ) { $AnzahlArtikelProSeite = 30 ; } else
if ( $cookie == 1600 ) { $AnzahlArtikelProSeite = 30 ; } else
if ( $cookie == 1440 ) { $AnzahlArtikelProSeite = 25 ; } else
if ( $cookie == 1400 ) { $AnzahlArtikelProSeite = 25 ; } else
if ( $cookie == 1360 ) { $AnzahlArtikelProSeite = 20 ; } else
if ( $cookie == 1280 ) { $AnzahlArtikelProSeite = 20 ; } else
if ( $cookie == 1184 ) { $AnzahlArtikelProSeite = 15 ; } else
if ( $cookie == 1152 ) { $AnzahlArtikelProSeite = 15 ; } else
if ( $cookie == 1024 ) { $AnzahlArtikelProSeite = 15 ; } else
if ( $cookie == 800 ) { $AnzahlArtikelProSeite = 4 ; } else
if ( $cookie == '' ) { $AnzahlArtikelProSeite = 15 ; }
$server="xy6";
$user="xy7";
$passwort="xy8";
$datenbank="xy3";
MYSQL_CONNECT($server, $user, $passwort) or die ("<H3>Datenbankserver nicht erreichbar</H3>");
MYSQL_SELECT_DB($datenbank) or die ( "<H3>Datenbank nicht vorhanden</H3>");
MYSQL_QUERY("UPDATE xy4 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = '_STORE_PRODUCT_LIST_RESULTS' ");
MYSQL_QUERY("UPDATE xy4 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = '_STORE_SEARCH_RESULTS' ");
MYSQL_QUERY("UPDATE xy5 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = 'XT_STARTPAGE_PRODUCTS_PAGE_LIMIT' ");
MYSQL_QUERY("UPDATE xy5 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = 'XT_NEW_PRODUCTS_PAGE_LIMIT' ");
MYSQL_QUERY("UPDATE xy5 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = 'XT_SPECIAL_PRODUCTS_PAGE_LIMIT' ");
MYSQL_QUERY("UPDATE xy5 SET config_value = '$AnzahlArtikelProSeite' WHERE config_key = 'XT_BESTSELLER_PRODUCTS_PAGE_LIMIT' ");
In der Datei:
Xy1\shop\xtCore\main.php
Ein Kode hinzugefügt:
include _SRV_WEBROOT.'conf/config.php';
zwischen:
if($_SYSTEM_INSTALL_SUCCESS != 'true'){
header('Location: ' . _SRV_WEB.'xtInstaller/index.php');
}
include _SRV_WEBROOT.'conf/artlisting.php';
include _SRV_WEBROOT.'conf/database.php';