Pagina 1 di 1
manudiscount
Inviato: 27/03/2009, 15:17
da giammi73
sto iniziando a usare manudiscount
utilizzo 3 prezzi
volevo sapere se c'e' un modo per dare uno sconto al prezzo 1 che uso per ili utenti
GUEST
Re: manudiscount
Inviato: 27/03/2009, 15:21
da giammi73
in pratica un modo per associare gli utenti GUEST al prezzo 1 (defaut) e appicare unosconto diverso marca per marca
Re: manudiscount
Inviato: 27/03/2009, 20:12
da giammi73
ok ho trovato la soluzione devo aggiornare la contrib
volevo aggiungere solo questa parte
ma devo sparare nel DB questa query
ALTER TABLE `manufacturers` ADD `guest_discount` VARCHAR( 32 ) NOT NULL ;
DELETE FROM `configuration` WHERE `configuration_id` = 402 LIMIT 1;
la seconda stringa a cosa serve?
Re: manudiscount
Inviato: 28/03/2009, 12:20
da giammi73
(un aiutino sarebbe gradito....)
allora l'upgrade mi fa sostituire questa query nella classe "shopping cart"
$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['configuration_value'];
con quest' altra
$query_guest_discount = tep_db_query("select m.guest_discount from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manufacturers_id");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['guest_discount'];
che dovrebbe calcolare lo sconto agli ospiti nel carrello
ma questo rigo mi da errore questo rigo
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
HELP!
Re: manudiscount
Inviato: 29/03/2009, 13:57
da lavoriamopervoi
che errore ti da?
Re: manudiscount
Inviato: 30/03/2009, 9:26
da giammi73
Re: manudiscount
Inviato: 30/03/2009, 13:36
da lavoriamopervoi
sei sicuro che il rigo 230 sia proprio questo:
Codice: Seleziona tutto
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
Re: manudiscount
Inviato: 30/03/2009, 20:40
da giammi73
229 $query_guest_discount = tep_db_query("select m.guest_discount from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manufacturers_id");
230 $query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
231 $customer_discount = $query_guest_discount_result['guest_discount'];
questo e' quello che ho aggiunto
Re: manudiscount
Inviato: 31/03/2009, 13:33
da lavoriamopervoi
giammi73 ha scritto:
229 $query_guest_discount = tep_db_query("select m.guest_discount from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manufacturers_id");
230 $query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
231 $customer_discount = $query_guest_discount_result['guest_discount'];
questo e' quello che ho aggiunto
allora... l'errore non sta quì, l'errore è nel rigo 230 di includes/classes/shopping_cart.php
controlla lì e se non riesci posta quì il codice
Ciao
Antonello
Re: manudiscount
Inviato: 31/03/2009, 15:54
da giammi73
quello che ho postato e' proprio quel file!!
Re: manudiscount
Inviato: 31/03/2009, 16:44
da lavoriamopervoi
giammi73 ha scritto:quello che ho postato e' proprio quel file!!
capito... posta allora tutto il codice di shopping_cart.php devi aver inserito le stringhe fuori dai function
Ciao
Antonello
Re: manudiscount
Inviato: 05/02/2010, 16:22
da giammi73
vorrei risolvere quest' errore...
allora
currencies.php
mi dice di fare questa modifica
Codice: Seleziona tutto
2.includes/classes/currencies.php
$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['configuration_value'];
change to:
$query_guest_discount = tep_db_query("select m.guest_discount from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manufacturers_id");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['guest_discount'];
l'errore e' qui:
Codice: Seleziona tutto
$query_guest_discount = tep_db_query("select m.guest_discount from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manufacturers_id");
ma poi mi dice che c'e' l'errore
ora
ma quale?
questo e' l'errore che mi esce
Codice: Seleziona tutto
Parse error: syntax error, unexpected T_VARIABLE in /web/htdocs/www.magicsound.it/home/shopguest/includes/classes/currencies.php on line
PLEASE HELP!!!
Re: manudiscount
Inviato: 05/02/2010, 16:36
da giammi73
tanto per...
tutta la pagina
Codice: Seleziona tutto
<?php
/*
$Id: currencies.php,v 1.16 2003/06/05 23:16:46 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
////
// Class to handle currencies
// TABLES: currencies
class currencies {
var $currencies;
// class constructor
function currencies() {
$this->currencies = array();
$currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
while ($currencies = tep_db_fetch_array($currencies_query)) {
$this->currencies[$currencies['code']] = array('title' => $currencies['title'],
'symbol_left' => $currencies['symbol_left'],
'symbol_right' => $currencies['symbol_right'],
'decimal_point' => $currencies['decimal_point'],
'thousands_point' => $currencies['thousands_point'],
'decimal_places' => $currencies['decimal_places'],
'value' => $currencies['value']);
}
}
// class methods
function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
global $currency;
if (empty($currency_type)) $currency_type = $currency;
if ($calculate_currency_value == true) {
$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
}
} else {
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
}
return $format_string;
}
function is_set($code) {
if (isset($this->currencies[$code]) && tep_not_null($this->currencies[$code])) {
return true;
} else {
return false;
}
}
function get_value($code) {
return $this->currencies[$code]['value'];
}
function get_decimal_places($code) {
return $this->currencies[$code]['decimal_places'];
}
//fix for conflict between osc affiliates contribution and totalB2B contribution
function display_affiliates_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
// BEGIN EASY CALL FOR PRICE v1.0
// END EASY CALL FOR PRICE v1.0
//TotalB2B start
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if (($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) {
$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['configuration_value'];
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} elseif (tep_session_is_registered('customer_id')) {
$query_A = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_B = tep_db_query("select m.manudiscount_discount from " . TABLE_CUSTOMERS . " c, " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = c.customers_groups_id and m.manudiscount_customers_id = 0 and c.customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_C = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = 0 and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
if ($query_result = tep_db_fetch_array($query_A)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_B)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_C)) {
$customer_discount = $query_result['manudiscount_discount'];
} else {
$query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join " . TABLE_CUSTOMERS . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customers_groups_discount = $query_result['customers_groups_discount'];
$query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customer_discount = $query_result['customers_discount'];
$customer_discount = $customer_discount + $customers_groups_discount;
}
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}
function display_price_nodiscount($products_price, $products_tax, $quantity = 1) {
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if ((($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}
//TotalB2B end
/* BEGIN EASY CALL FOR PRICE v1.0
function display_price($products_price, $products_tax, $quantity = 1) {
define ('CALL_FOR_PRICE_VALUE', 0);
// If you sell products for $0.00 and want to display "Call for Price!" for other products, set their price and the CALL_FOR_PRICE_VALUE to -1.
if ($products_price > CALL_FOR_PRICE_VALUE){
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}else{
define ('TEXT_CALL_FOR_PRICE', 'telefonare');
// You can set CALL_FOR_PRICE_TEXT to anything you want. Its style is determined by the page it is displayed on. Changes made here will be visible throughout your site.
return TEXT_CALL_FOR_PRICE;
//END EASY CALL FOR PRICE v1.0 */
}
?>