Hello to everything,
I urgently needs your help.
I try Voluntary self-control of for ZC 1.3.7 the film economy to provide. There is an older version for ZC 1.2.6 (Zen_FSK18_v_2.0_zen1.2.6d), but, unfortunately, it does not function with ZC 1.3.7 were
able to do to me somebody help this Script to circumscribe, because my PhP is not so good.
I have inserted a field in New Product with the name FSK status. If I give a number in this field, should be indicated in product_info a suitable picture and text.
For it I have inserted the following:
In admin/includes/modules/product/collect_info.php
in ca. Zeile 17 nach
'products_quantity' => '',
folgendes ein:
'products_fsk_18' => '',
suche folgende Zeile ca. 47 - 64
if (isset($_GET['pID']) && empty($_POST)) {
ersetzte mit:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
p.products_id, p.products_quantity, p.products_model,
p.products_image, p.products_price, p.products_virtual, p.products_weight,
p.products_date_added, p.products_last_modified,
date_format(p.products_date_available, '%Y-%m-%d') as
products_date_available, p.products_status, p.products_fsk_18, p.products_tax_class_id,
p.manufacturers_id,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed,
p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
p.products_sort_order,
p.products_discount_type, p.products_discount_type_from,
p.products_price_sorter, p.master_categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = '" . (int)$_GET['pID'] . "'
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
suche Zeile 281 und füge folgendes ein:
<td class="main"><?php echo TEXT_PRODUCTS_FSK_18; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_fsk_18', $pInfo->products_fsk_18); ?></td>
<tr>
<td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
************************************************************************
In admin/includes/languages/german/product.php
suche folgende Zeile:
define('TEXT_PRODUCTS_STATUS', 'Artikelstatus:');
folgende ein:
define('TEXT_PRODUCTS_FSK_18', 'FSK 18 Status:');
*************************************************************************
In admin/includes/languages/german/products_price_manager.php
in Zeile 39 einfügen:
define('TEXT_PRODUCTS_FSK_18', 'FSK 18 Status:');
*************************************************************************
In admin/includes/modules/update_product.php
in Zeile 37 einfügen:
//FSK 18
'products_fsk_18' => zen_db_prepare_input($_POST['products_fsk_18']),
//FSK 18 EOF
*************************************************************************
In includes/languages/german.php
Scrollt an das Ende der Datei und fügt VOR
?>
folgendes ein:
// FSK Anzeige
define('TEXT_FSK_STATUS_1', 'Ohne Altersbeschränkung');
define('TEXT_FSK_STATUS_6', 'Freigegeben ab 6 Jahre');
define('TEXT_FSK_STATUS_12', 'Freigegeben ab 12 Jahre');
define('TEXT_FSK_STATUS_16', 'Freigegeben ab 16 Jahre');
define('TEXT_FSK_STATUS_18', 'Freigegeben ab 18 Jahre');
define('TEXT_FSK_STATUS_0', 'noch keine Altersfreigabe bekannt');
*************************************************************************
In includes/functions/functions_general.php
Scrollt an das Ende der Datei und fügt VOR
/////////////////////////////////////////////
////
// call additional function files
// prices and quantities
folgendes ein:
// START FSK Anzeige
function picto_fsk_18($products_fsk_18=0) {
if ($products_fsk_18 <=1 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_0.gif', TEXT_FSK_STATUS_1).'<br>'. TEXT_FSK_STATUS_1 ;
}
if ($products_fsk_18 <=6 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_6.gif', TEXT_FSK_STATUS_6 ).'<br>'. TEXT_FSK_STATUS_6 ;
}
if ($products_fsk_18 <=12 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_12.gif', TEXT_FSK_STATUS_12).'<br>'. TEXT_FSK_STATUS_12 ;
}
if ($products_fsk_18 <=16 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_16.gif', TEXT_FSK_STATUS_16).'<br>'. TEXT_FSK_STATUS_16 ;
}
if ($products_fsk_18 <=18 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_18.gif', TEXT_FSK_STATUS_18).'<br>'. TEXT_FSK_STATUS_18 ;
}
if ($products_fsk_18 <=0 ) { $picto = zen_image(DIR_WS_IMAGES . '/fsk/' . 'usk_tba.gif', TEXT_FSK_STATUS_0) . '<br>' . TEXT_FSK_STATUS_0 ;
}
return $picto;
}
// ENDE FSK Anzeige
**************************************************************************
In includes/templates/template_default/templates/tpl_product_info_display.php
Solltet ihr ein eigenes Template angelegt haben öffnet die Datei entsprechend in eurem Template
Suche die Zeile
<!--eof Product Price block -->
folgendes ein:
<!--bof FSK Status-->
<h4 id="products_fsk_18"><?php echo picto_fsk_18($products_fsk_18); ?></h4>
<!--eof FSK Status-->
**************************************************************************
In includes/index_filters/default_filter.php
nach der Zeile 28 - 85
// We are asked to show only a specific category
folgendes damit abändern:
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_fsk_18, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_status = 1
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'" .
$alpha_sort;
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_fsk_18, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m
where p.products_status = 1
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
$alpha_sort;
}
} else {
// show the products in a given category
if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id'])) {
// We are asked to show only specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_fsk_18, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_status = 1
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$current_category_id . "'" .
$alpha_sort;
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_fsk_18, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id
where p.products_status = 1
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$current_category_id . "'" .
$alpha_sort;
}
}
**************************************************************************
In includes/modules/new_products.php
Suche die Zeile 18 - 21
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query =
mit folgendes ersetzen:
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added, p.products_fsk_18
from " . TABLE_PRODUCTS . " p
where p.products_status = 1 " . $display_limit;
**************************************************************************
In includes/modules/pages/product_info/main_template_vars.php
suche Zeile ca. 114
$products_quantity = $product_info->fields['products_quantity'];
folgendes danach einfügen:
$products_fsk_18 = $product_info->fields['products_fsk_18'];
**************************************************************************
Database field:
INSERT INTO products (products_FSK_18 float NOT NULL default,
*******************************************************************************
I can give the number, however, unfortunately, I get a wrong picture as well as a wrong text indicated.
Here the link in him you can look this:
http://www.23093.webhosting0.1blu.de...&products_id=1
I know I have here somewhere a mistake in it. Can somebody help me please that in the shop the right picture and text is indicated if I give my number in New Product?
Many thanks!
greeting Lissy
Sorry the Shop is in German!!! :-)
Bookmarks