Cena obejmuje i nie obejmuje. WyÅ›wietlony podatek VAT. Ikona wyÅ›wietla siÄ™ również przed cenÄ…, gdy tylko produkt znajdzie siÄ™ w koszyku.
Warunkiem wstępnym tego rozszerzenia jest dodatek "[zmiana ceny atrybutu 1.3]".
Otwórz stronÄ™: katalog/ajax_onchange_price.php i zamieÅ„ caÅ‚y kod źródÅ‚owy.
<?php
require('includes/application_top.php');
$oscTemplate->buildBlocks();
$optionid = explode(",",$_GET['option_id']);
$product_id = $_GET['product_id'];
$product_opt = explode(",",$_GET['product_opt']);
$modified_price = $_GET['price'];
$sp_price = $_GET['sp_price'];
$modified_netto_price = isset($_GET['specials_new_products_price']);
$product_info_query = tep_db_query("select p.products_id, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$product_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info_ajx = tep_db_fetch_array($product_info_query);
$new_price = tep_get_products_special_price($product_info_ajx['products_id']);
for($k=0; $k<count($optionid); $k++)
{
$product_new_price_query = tep_db_query("select * from " .TABLE_PRODUCTS_ATTRIBUTES. " where products_id = '" . (int)$product_id . "' and options_id = '".$optionid[$k]."' AND options_values_id ='" . $product_opt[$k] . "'");
$product_new_price = tep_db_fetch_array($product_new_price_query);
$sp_price = $sp_price + ($product_new_price['price_prefix'] . $product_new_price['options_values_price']); // specials
$modified_price = $modified_price + ($product_new_price['price_prefix'] . $product_new_price['options_values_price']);
$modified_netto_price = $modified_netto_price + ($product_new_price['price_prefix'] . $product_new_price['options_values_price']); // specials
$special_products_price_query = tep_db_query("select s.specials_new_products_price, p.products_id from " . TABLE_SPECIALS . " s left join " . TABLE_PRODUCTS . " p on s.products_id = p.products_id where s.products_id = '" . (int)$product_id . "'");
$special_products_price = tep_db_fetch_array($special_products_price_query);
$special_n_price = '';
$special_npp_price = '';
$special_n_price = (isset($special_products_price['specials_new_products_price']) ? $special_products_price['specials_new_products_price'] : '');
if (tep_has_product_attributes((isset($special_products_price['products_id']) ? $special_products_price['products_id'] : '') )) {
$special_npp_price = $special_n_price + $modified_netto_price;
}else{
$special_npp_price = $special_n_price;
}
}
// Item in cart start
if ( SHOW_ITEM_IN_CART == 'True' ) {
$products = $cart->get_products();
$in_cart = '';
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$first = current(explode("{", $products[$i]['id']));
if ($first == $product_info_ajx['products_id']) {
$in_cart = '<i class="fa fa-cart-plus"></i> ';
}}}
// Item in cart ende
if ($new_price = tep_get_products_special_price($product_info_ajx['products_id'])) {
if (SHOW_PRODUCT_NETT_PRICE_ABOWE_PRICE == 'True') {
$products_price = '<div><span class="w3-small w3-text-gray"> ( ';
$products_price .= $currencies->display_price($special_npp_price, '');
$products_price .= TAX_INFO_OFF . ' )</span></div>';
$products_price .= $in_cart . '<s class="w3-text-red">' . $currencies->display_price($modified_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id'])) . '</s>';
$products_price .= '<span class="productSpecialPrice">' . $currencies->display_price($sp_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id'])) . '</span>';
}else{
$products_price = $in_cart . '<s class="w3-text-red">' . $currencies->display_price($modified_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id'])) . '</s>';
$products_price .= '<span class="productSpecialPrice">' . $currencies->display_price($sp_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id'])) . '</span>';
}
} else {
if (SHOW_PRODUCT_NETT_PRICE_ABOWE_PRICE == 'True') {
$products_price = '<div><span class="w3-small w3-text-gray"> ( ';
$products_price .= $currencies->display_price($modified_price, '');
$products_price .= TAX_INFO_OFF . ' )</span></div>';
$products_price .= $in_cart . $currencies->display_price($modified_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id']));
}else{
$products_price = $in_cart . $currencies->display_price($modified_price, tep_get_tax_rate($product_info_ajx['products_tax_class_id']));
}
}
$s_simbol = array("?", "$", "?");
$s_entidad = array("€", "$", "£");
echo str_replace($s_simbol, $s_entidad, $products_price); // cambia el simbolo por la entidad html.
?>
Dodaj do: catalog/includes/languages/polish.php
define('TEXT_INCL_VAT', 'Cena zawiera %s VAT');
define('TEXT_SC_INCL_VAT', 'Zawiera %s VAT');
define('TEXT_EXCL_VAT', 'bez VAT § 19 UStG.');
define('TEKST_VAT', 'VAT');
define('TAX_INFO', 'z VAT');
define('TAX_INFO_OFF', 'bez VAT');
define('TAX_LF_INFO', 'w tym');
Zaimportuj instrukcjÄ™ SQL za pomocÄ… PhpMyAdmin:
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function)
VALUES ('Chcesz pokazac produkt w koszyku po cenie ?', 'SHOW_ITEM_IN_CART', 'True', 'Czy chcesz, aby obok ceny wyświetlała się informacja (Już w koszyku)?', '1', '205', now(), NULL , 'tep_cfg_select_option(array('True', 'False'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function)
VALUES ('Pokazać cenÄ™ netto?', 'SHOW_PRODUCT_NETT_PRICE_ABOWE_PRICE', 'True', 'Chcesz, żeby nad cenÄ… gÅ‚ównÄ… wyÅ›wietlaÅ‚a siÄ™ cena netto?', '1', '206', now(), NULL , 'tep_cfg_select_option(array('True', 'False'),');
W panelu administracyjnym w zakÅ‚adce Konfiguracja -> Mój Sklep znajdziesz teraz opcje ustawieÅ„ wyÅ›wietlania.