Jump to content

knacknuss

Members
  • Content count

    20
  • Joined

  • Last visited

Profile Information

  • Real Name
    Brigitte
  1. HI all I have a (small?) problem. I?m using QT Pro with the pad_sequenced_dropdowns. My attributes are all shown in reverse order. eg XL L M S XS instead of XS S M L XL Is there a way to fix this? Thanks in advance :)
  2. Thanks a lot you made my day :) Now it works :)
  3. Hi all I have a similar problem. I can upload the file and insert it inserts just one new row the database. Then it takes a while and I see the following on my screen: File uploaded. Temporary filename: /tmp/phpmvPQG9 User filename: EP2006Sep06-1909.txt Size: 95904 | 79318R | half_cube2 | Eagle Cree | Packtasche | | 15,00 | 0.00 | | 04.09.2006 | 200 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zur Orient | | | | | 79339 | Reiseschir | Eagel Cree | Stabil und | | 39,00 | 0.00 | | 04.09.2006 | 200 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zur Orient | | | | | 79452 | Geldgurt_G | Eagle Cree | 2 grosse H | | 20,00 | 0.00 | | 04.09.2006 | 200 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zur Orient | | | | | 7781 | | Lekisport | Schutzkapp | | 9,80 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7465 | rettungsde | Rettungsde | Superleich | | 7,80 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7428 | seattle_so | Regenhut O | Regenhut O | | 99,00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7435 | rockymount | Rocky Moun | Rocky Moun | | 39,00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7400 | ponchoallg | W?fo Model | W?FO-Ponch | | 119,00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7409 | PonchoTaue | W?fo Model | W?FO-Ponch | | 164,90 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7410 | Wdfo-Regen | W?fo-Regen | W?FO-Ponch | | 89,00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4256 | RegenhoseW | Regen-?ber | Regen-?ber | | 199,00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 79601 | Stretch-Gu | G?rtel str | G?rtel str | | 21,00 | | | 7711 | Recta_Komp | Recta-Komp | Sehr genau | | 49,00 | | | 7713 | Recta_Komp | Recta-Komp | Wie DP2, d | | 98,00 | | | 7727 | Detail-Lup | Mini-Fernr | Als kleins | | 95,00 | | | 7718 | falkenhors | Fernglas F | Ferngl?ser | | 329,00 | | | 7719 | falkenhors | Fernglas F | Ferngl?ser | | 342,00 | | | 7731 | Wandergril | Wandergril | Ideal zum | | 45,00 | | | 7733 | rucksackgr | Rucksack-G | Der Grillr | | 49,80 | | | 6137 | solardynam | Solar-Dyna | Solar-Dyna | | 48,00 | | | 6210 | ECOCharger | ECO-Charge | ECO-Charge | | 109,50 | | | 7279 | Travelshee | COCOON Tra | Travelshee | | 219,00 | | | 7377M | Huettenfin | LITHA-H?tt | Aus 2/3 Na | | 49,00 | | | 71475 | Stirnlampe | Stirnlampe | Stirnlampe | | 42,00 | | | 78290 | KatadynCan | Katadyn Bo | Katadyn Bo | | 95,00 | | | 78291 | | Ersatzfilt | Ersatzfilt | | 79,00 | | | 79329R | 40375_Half | Eagle Cree | Pack-it Ha | | 15,00 | | | 79316 | 40138_Quar | Eagle Cree | Pack-it Qu | | 12,50 | | | 79330 | Koala_schw | Eagel Cree | Reise-N?ce | | 28,00 | | | 79459 | Brustbeute | Eagle Cree | Die Sicher | | 14,00 | | | 7272 | seidenatur | COCOON Tra | Seide natu | | 119,00 | | | 7251 | baumwolleu | COCOON Rei | Leichte un | | 27,00 | | | 7303 | pyjama.jpg | Reise-Pyja | Reise-Pyja | | 119,90 | | | 7278 | ripstops.j | COCOON Tra | Ripstop-Se | | 139,00 | | | 7366H | Air-Revol_ | Meindl Air | Der Hochge | | 398,00 | | | 73808 | Revolution | Meindl ''R | Meindl ''R | | 29,90 | | | 73816 | AirRevoSoc | Meindl ''R | Meindl ''R | | 39,90 | | | 1 | 5025T-Saan | Landeskart | Bitte im B | | 13,50 | | | 7277 | cocoon_Ult | COCOON Tra | Seide ''Ul | | 129,00 | | | 7233 | LIGHTEC-70 | Ferrino-Sc | Mit Kunstf | | 129,00 | | | 77933 | SIGG_Sport | Sigg Sport | Sigg Sport | | 25,00 | | | 77091 | GPSKartenS | GPS Karten | GPS Karten | | 248,00 | | | .................................and so on .......4424 | DamenhoseM | Sch?ffel D | Damenhose | | 69,50 !New Product! If I go to the database always only the first row (product) get?s imported... What am I doing wrong?
  4. HI Simon I worked it out :) It was actually quite simple...just one line of code to add :) For all Swiss people here it is: function calculate_credit($amount) { global $customer_id, $order, $cc_id; //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead. $od_amount = 0; if (isset($cc_id) ) { $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'"); if (tep_db_num_rows($coupon_query) !=0 ) { $coupon_result = tep_db_fetch_array($coupon_query); $this->coupon_code = $coupon_result['coupon_code']; $coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS ." where coupon_code = '". $coupon_result['coupon_code'] . "'"); $get_result = tep_db_fetch_array($coupon_get); $c_deduct = $get_result['coupon_amount']; if ($get_result['coupon_type']=='S') $c_deduct = $order->info['shipping_cost']; if ($get_result['coupon_minimum_order'] <= $this->get_order_total()) { if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) { for ($i=0; $i<sizeof($order->products); $i++) { if ($get_result['restrict_to_products']) { $pr_ids = split("[,]", $get_result['restrict_to_products']); for ($ii = 0; $ii < count($pr_ids); $ii++) { if ($pr_ids[$ii] == tep_get_prid($order->products[$i]['id'])) { if ($get_result['coupon_type'] == 'P') { /* Fixes to Gift Voucher module 5.03 ================================= Submitted by Rob Cote, robc@traininghott.com original code: $od_amount = round($amount*10)/10*$c_deduct/100; $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pod_amount = round($pr_c*10)/10*$c_deduct/100; */ //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pr_c = $this->product_price($pr_ids[$ii]); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $od_amount = $od_amount + $pod_amount; } else { $od_amount = $c_deduct; } } } } else { $cat_ids = split("[,]", $get_result['restrict_to_categories']); for ($i=0; $i<sizeof($order->products); $i++) { $my_path = tep_get_product_path(tep_get_prid($order->products[$i]['id'])); $sub_cat_ids = split("[_]", $my_path); for ($iii = 0; $iii < count($sub_cat_ids); $iii++) { for ($ii = 0; $ii < count($cat_ids); $ii++) { if ($sub_cat_ids[$iii] == $cat_ids[$ii]) { if ($get_result['coupon_type'] == 'P') { /* Category Restriction Fix to Gift Voucher module 5.04 Date: August 3, 2003 ================================= Nick Stanko of UkiDev.com, nick@ukidev.com original code: $od_amount = round($amount*10)/10*$c_deduct/100; $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pod_amount = round($pr_c*10)/10*$c_deduct/100; */ //$od_amount = round($amount*10)/10*$c_deduct/100; //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pr_c = $this->product_price(tep_get_prid($order->products[$i]['id'])); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $od_amount = $od_amount + $pod_amount; } else { $od_amount = $c_deduct; } } } } } } } } else { if ($get_result['coupon_type'] !='P') { $od_amount = $c_deduct; } else { $od_amount = $amount * $get_result['coupon_amount'] / 100; $od_amount = round(($od_amount *1.002)+0.05,1)-0.1; /// rundet auf 5 Rappen } } } } if ($od_amount>$amount) $od_amount = $amount; } return $od_amount; } I hope this is correct coding and doesn't do anything bad to the rest :blush:
  5. Hi Simon I'm not quite sure how to do it. I tryed something, but it's not working and to be honest my coding skills are just too bad :( Here's what I did function calculate_credit($amount) { global $customer_id, $order, $cc_id; //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead. $od_amount = 0; if (isset($cc_id) ) { $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'"); if (tep_db_num_rows($coupon_query) !=0 ) { $coupon_result = tep_db_fetch_array($coupon_query); $this->coupon_code = $coupon_result['coupon_code']; $coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS ." where coupon_code = '". $coupon_result['coupon_code'] . "'"); $get_result = tep_db_fetch_array($coupon_get); $c_deduct = $get_result['coupon_amount']; if ($get_result['coupon_type']=='S') $c_deduct = $order->info['shipping_cost']; if ($get_result['coupon_minimum_order'] <= $this->get_order_total()) { if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) { for ($i=0; $i<sizeof($order->products); $i++) { if ($get_result['restrict_to_products']) { $pr_ids = split("[,]", $get_result['restrict_to_products']); for ($ii = 0; $ii < count($pr_ids); $ii++) { if ($pr_ids[$ii] == tep_get_prid($order->products[$i]['id'])) { if ($get_result['coupon_type'] == 'P') { /* Fixes to Gift Voucher module 5.03 ================================= Submitted by Rob Cote, robc@traininghott.com original code: $od_amount = round($amount*10)/10*$c_deduct/100; $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pod_amount = round($pr_c*10)/10*$c_deduct/100; */ //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pr_c = $this->product_price($pr_ids[$ii]); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $pod_amount_2 = round($pod_amount *1.2+0.05,1)-0.1; ////round $od_amount = $od_amount + $pod_amount_2; } else { $od_amount = $c_deduct; } } } } else { $cat_ids = split("[,]", $get_result['restrict_to_categories']); for ($i=0; $i<sizeof($order->products); $i++) { $my_path = tep_get_product_path(tep_get_prid($order->products[$i]['id'])); $sub_cat_ids = split("[_]", $my_path); for ($iii = 0; $iii < count($sub_cat_ids); $iii++) { for ($ii = 0; $ii < count($cat_ids); $ii++) { if ($sub_cat_ids[$iii] == $cat_ids[$ii]) { if ($get_result['coupon_type'] == 'P') { /* Category Restriction Fix to Gift Voucher module 5.04 Date: August 3, 2003 ================================= Nick Stanko of UkiDev.com, nick@ukidev.com original code: $od_amount = round($amount*10)/10*$c_deduct/100; $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pod_amount = round($pr_c*10)/10*$c_deduct/100; */ //$od_amount = round($amount*10)/10*$c_deduct/100; //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty']; $pr_c = $this->product_price(tep_get_prid($order->products[$i]['id'])); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT! $pod_amount = round($pr_c*10)/10*$c_deduct/100; $pod_amount_2 = round($pod_amount *1.2+0.05,1)-0.1; ////round $od_amount = $od_amount + $pod_amount_2; } else { $od_amount = $c_deduct; } } } } } } } } else { if ($get_result['coupon_type'] !='P') { $od_amount = $c_deduct; } else { $od_amount = $amount * $get_result['coupon_amount'] / 100; } } } } if ($od_amount>$amount) $od_amount = $amount; } return $od_amount; } function calculate_tax_deduction($amount, $od_amount, $method) { global $customer_id, $order, $cc_id, $cart; //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead. $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'"); if (tep_db_num_rows($coupon_query) !=0 ) { $coupon_result = tep_db_fetch_array($coupon_query); $coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code = '". $coupon_result['coupon_code'] . "'"); $get_result = tep_db_fetch_array($coupon_get); if ($get_result['coupon_type'] != 'S') { //RESTRICTION-------------------------------- if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) { // What to do here. // Loop through all products and build a list of all product_ids, price, tax class // at the same time create total net amount. // then // for percentage discounts. simply reduce tax group per product by discount percentage // or // for fixed payment amount // calculate ratio based on total net // for each product reduce tax group per product by ratio amount. $products = $cart->get_products(); $valid_product = false; for ($i=0; $i<sizeof($products); $i++) { $valid_product = false; $t_prid = tep_get_prid($products[$i]['id']); $cc_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'"); $cc_result = tep_db_fetch_array($cc_query); if ($get_result['restrict_to_products']) { $pr_ids = split("[,]", $get_result['restrict_to_products']); for ($p = 0; $p < sizeof($pr_ids); $p++) { if ($pr_ids[$p] == $t_prid) $valid_product = true; } } if ($get_result['restrict_to_categories']) { $cat_ids = split("[,]", $get_result['restrict_to_categories']); for ($c = 0; $c < sizeof($cat_ids); $c++) { $cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'"); if (tep_db_num_rows($cat_query) !=0 ) $valid_product = true; } } if ($valid_product) { $price_excl_vat = $products[$i]['final_price'] * $products[$i]['quantity']; //Fred - added $price_incl_vat = $this->product_price($t_prid); //Fred - added $valid_array[] = array('product_id' => $t_prid, 'products_price' => $price_excl_vat, 'products_tax_class' => $cc_result['products_tax_class_id']); //jason //Fred - changed from $products[$i]['final_price'] 'products_tax_class' => $cc_result['products_tax_class_id']); // $total_price += $price_incl_vat; //Fred - changed $total_price += $price_excl_vat; // changed } } if (sizeof($valid_array) > 0) { // if ($valid_product) { if ($get_result['coupon_type'] == 'P') { $ratio = $get_result['coupon_amount']/100; } else { $ratio = $od_amount / $total_price; } if ($get_result['coupon_type'] == 'S') $ratio = 1; if ($method=='Credit Note') { $tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); if ($get_result['coupon_type'] == 'P') { $tod_amount = $od_amount / (100 + $tax_rate)* $tax_rate; $tod_amount_2 = round($tod_amount *1.2+0.05,1)-0.1; ////round } else { $tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount/100; $tod_amount_2 = round($tod_amount *1.2+0.05,1)-0.1; ////round } $order->info['tax_groups'][$tax_desc] -= $tod_amount_2; $order->info['total'] -= $tod_amount_2; // need to modify total ...OLD $order->info['tax'] -= $tod_amount_2; //Fred - added } else { for ($p=0; $p<sizeof($valid_array); $p++) { $tax_rate = tep_get_tax_rate($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']); $tax_desc = tep_get_tax_description($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']); if ($tax_rate > 0) { //Fred $tod_amount[$tax_desc] += ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; //OLD $tod_amount = ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // calc total tax Fred - added $order->info['tax_groups'][$tax_desc] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; $order->info['total'] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // adjust total $order->info['tax'] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // adjust tax -- Fred - added } } } } //NO RESTRICTION-------------------------------- } else { if ($get_result['coupon_type'] =='F') { $tod_amount = 0; if ($method=='Credit Note') { $tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tod_amount = $od_amount / (100 + $tax_rate)* $tax_rate; $tod_amount_2 = round($tod_amount *1.2+0.05,1)-0.1; //////round $order->info['tax_groups'][$tax_desc] -= $tod_amount_2; } else { // $ratio1 = $od_amount/$amount; // this produces the wrong ratipo on fixed amounts reset($order->info['tax_groups']); while (list($key, $value) = each($order->info['tax_groups'])) { $ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug $tax_rate = tep_get_tax_rate_from_desc($key); $net = $tax_rate * $order->info['tax_groups'][$key]; if ($net>0) { $god_amount = $order->info['tax_groups'][$key] * $ratio1; $tod_amount += $god_amount; $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount; } } } $order->info['total'] -= $tod_amount; //OLD $order->info['tax'] -= $tod_amount; //Fred - added } if ($get_result['coupon_type'] =='P') { $tod_amount=0; if ($method=='Credit Note') { $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount/100; $tod_amount_2 = round($tod_amount *1.2+0.05,1)-0.1; //////round $order->info['tax_groups'][$tax_desc] -= $tod_amount_2; ////round } else { reset($order->info['tax_groups']); while (list($key, $value) = each($order->info['tax_groups'])) { $god_amount=0; $tax_rate = tep_get_tax_rate_from_desc($key); $net = $tax_rate * $order->info['tax_groups'][$key]; if ($net>0) { $god_amount = $order->info['tax_groups'][$key] * $get_result['coupon_amount']/100; $tod_amount += $god_amount; $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount; } } } $order->info['total'] -= $tod_amount; // have to modify total also $order->info['tax'] -= $tod_amount; } } } } return $tod_amount; } Thanks for any help :) PS: Changes are marked with ////round
  6. Hi all I'm building a Swiss shop and tryed to include ccgv. Everything works fine apart from if I give a customer 10% the amount is not rounded to 5 e.g. Zwischensumme: CHF89.10 Pauschale Versandkosten (): CHF5.80 Gutscheine:123: -CHF8.91 Summe: CHF85.99 Here in Switzerland the smallest coin is 5 Rappen and therefore it should look like: Zwischensumme: CHF89.10 Pauschale Versandkosten (): CHF5.80 Gutscheine:123: -CHF8.90 Summe: CHF86.00 Any help is greatly appreciated :) Thanks, Brigitte PS: I'm using the following versions: $Id: ot_gv.php,v 1.37.3 2004/01/01 12:52:59 Strider Exp $ $Id: ot_gv.php,v 1.4.2.12 2003/05/14 22:52:59 wilt Exp $ $Id: ot_coupon.php,v 1.1.2.37.3 2004/01/01 22:52:59 Strider Exp $ $Id: ot_coupon.php,v 1.1.2.37 2003/07/24 22:52:59 Strider-Cote Exp $ $Id: ot_coupon.php,v 1.1.2.36 2003/05/14 22:52:59 wilt Exp $ (Package ccgb-513c)
  7. knacknuss

    Sales Report 2

    Hi Ich have installed sales report 2 but it gives me some troubles. Items with attributes are not counted right. See below: Thanks for your help :)
  8. Hi I guess these are the 2 functions you were mentioning: //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); //++++ QT Pro: End Changed Code } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // Shopping cart actions through POST variables from forms if (isset($HTTP_POST_VARS['wishlist_action'])) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset ($id)) { foreach($id as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } } break; But I havent got a clue what to do with it :( Can you point me in the right direction :)
  9. Hi all I'd like to use qtpro 4.2 and wishlist 2.3. The problem is, if I add a product to the wishlist the attributes are not written to the database. Without the QTPro mod everything works fine. I guess it's because the attributes are combined in pad_singel_dropdown.php I'd really love to use these 2 contributions together and would be greatful for any solution :) Thanks! Code from wishlist 2.3 in product_info.php <!-- Wish List 2.3 Start --> <td align="left" class="main"><?php if (tep_session_is_registered('customer_id')) echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '\';document.cart_quantity.submit();"'); ?></td> <!-- Wish List 2.3 End -->
  10. knacknuss

    Wishlist 2.0 Support Thread

    Hi all I found the solution for this problem :) Around line 174 in wishlist.php find this : if ($new_price = tep_get_products_special_price($products['products_id'])) { $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>'; and replace by this: if ($new_price = tep_get_products_special_price($products['products_id'])) { $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price+$attributes_addon_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  11. knacknuss

    Wishlist 2.0 Support Thread

    Hi all I have 2 problems: 1. I'd like to use qtpro 4.2 and wishlist 2.3. The problem is, if I add a product to the wishlist the attributes are not written to the database. Without the QTPro mod everything works fine. Did anyone get to work these two things together? 2. Wishlist 2.3 also seems to have a problem with group discount. It add's a discout to products which are already on a special price. When I add the wish to the basket the price is correct! e.g. 1 book special price $ 7.00 Discount does no apply to special prices so the price in the wishlist is dispayed as $ 6.30 (if 10% discount) When added to basket the price is on $ 7.00 again!! Where's the bug? Thanks for your help :)
  12. knacknuss

    PDF Packing Slip

    Hi all I have adapted Neil Westlakes PDF invoice to a PDF packing slip. The only thing missing, are the attributes belonging to the products eg. Nice Shirt - color: red - Size: 12 Can someone please help :) Thanks! <?php /* $Id: create_pdf,v 1.4 2005/04/07 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License Written by Neil Westlake (nwestlake@gmail.com) for www.Digiprintuk.com Version History: 1.1 Initial release 1.2 Corrected problem displaying PDF when from a HTTPS URL. 1.3 Modified item display to allow page continuation when more than 20 products are on one invoice. 1.4 Corrected problem with page continuation, now invoices will allow for an unlimited amount of products on one invoice */ define('FPDF_FONTPATH','fpdf/font/'); require('fpdf/fpdf.php'); require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ORDERS_INVOICE); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); include(DIR_WS_CLASSES . 'order.php'); while (list($key, $oID) = each($_GET)) { if ($key != "oID") break; $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . $oID . "'"); $order = new order($oID); class PDF extends FPDF { //Page header function RoundedRect($x, $y, $w, $h,$r, $style = '') { $k = $this->k; $hp = $this->h; if($style=='F') $op='f'; elseif($style=='FD' or $style=='DF') $op='B'; else $op='S'; $MyArc = 4/3 * (sqrt(2) - 1); $this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k )); $xc = $x+$w-$r; $yc = $y+$r; $this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k )); $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc); $xc = $x+$w-$r; $yc = $y+$h-$r; $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k)); $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r); $xc = $x+$r; $yc = $y+$h-$r; $this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k)); $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc); $xc = $x+$r; $yc = $y+$r; $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k )); $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r); $this->_out($op); } function _Arc($x1, $y1, $x2, $y2, $x3, $y3) { $h = $this->h; $this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c ', $x1*$this->k, ($h-$y1)*$this->k, $x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k)); } function Header() { global $oID; $date = strftime('%A, %d %B %Y'); //Logo $this->Image('images/invoice_logo.jpg',3,5,40); // Invoice Number and date $this->SetFont('Arial','B',8); $this->SetTextColor(0,102,153); $this->SetY(37); $this->MultiCell(50,4,"Lieferschein: #" . $oID . "\n" . $date ,0,'L'); // Company Address $this->SetX(0); $this->SetY(10); $this->SetFont('Arial','B',8); $this->SetTextColor(0,102,153); $this->Ln(0); $this->Cell(149); $this->MultiCell(50, 3.5, STORE_NAME_ADDRESS,0,'R'); } function Footer() { //Position at 1.5 cm from bottom $this->SetY(-19); //Arial italic 8 $this->SetFont('Arial','',12); $this->SetTextColor(0,102,153); $this->Cell(0,10, PRINT_INVOICE_TEXT, 0,0,'C'); $this->SetY(-15); $this->Cell(0,10, PRINT_INVOICE_URL, 0,0,'C'); //Page number //$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } } //Instanciation of inherited class $pdf=new PDF(); // Set the Page Margins $pdf->SetMargins(4,2,4); // Add the first page $pdf->AddPage(); //Draw the top line with invoice text $pdf->Cell(50); $pdf->SetY(62); $pdf->SetDrawColor(153,153,153); $pdf->Cell(15,.1,'',1,1,'L',1); $pdf->SetFont('Arial','BI',15); $pdf->SetTextColor(153,153,153); $pdf->Text(22,63.5,'Lieferschein'); $pdf->SetY(62); $pdf->SetDrawColor(153,153,153); $pdf->Cell(56); $pdf->Cell(142,.1,'',1,1,'L',1); //Draw Box for Invoice Address $pdf->SetDrawColor(0); $pdf->SetLineWidth(0.5); $pdf->SetFillColor(224); $pdf->RoundedRect(3, 67, 90, 35, 2, 'DF'); //Draw the invoice address text $pdf->SetFont('Arial','B',8); $pdf->SetTextColor(0); $pdf->Text(8,74,ENTRY_SOLD_TO); $pdf->SetX(0); $pdf->SetY(78); //$pdf->SetFont('Arial','B',8); //$pdf->SetTextColor(0); $pdf->Cell(5); $pdf->MultiCell(70, 3.3, tep_address_format(1, $order->customer, '', '', "\n"),0,'L'); //Draw Box for Delivery Address $pdf->SetDrawColor(0); $pdf->SetLineWidth(0.5); $pdf->SetFillColor(255); $pdf->RoundedRect(112, 67, 90, 35, 2, 'DF'); //Draw the invoice delivery address text $pdf->SetFont('Arial','B',8); $pdf->SetTextColor(0); $pdf->Text(117,74,ENTRY_SHIP_TO); $pdf->SetX(0); $pdf->SetY(78); $pdf->Cell(115); $pdf->MultiCell(50, 3.3, tep_address_format(1, $order->delivery, '', '', "\n"),0,'L'); //Draw Box for Order Number, Date & Payment method $pdf->SetDrawColor(0); $pdf->SetLineWidth(0.5); $pdf->SetFillColor(224); $pdf->RoundedRect(3, 107, 199, 11, 2, 'DF'); //Draw Order Number Text $temp = str_replace(' ', ' ', PRINT_INVOICE_ORDERNR); $pdf->Text(7,113, $temp . tep_db_input($oID)); //Draw Date of Order Text $temp = str_replace(' ', ' ', PRINT_INVOICE_DATE); $pdf->Text(75,113,$temp . tep_date_short($order->info['date_purchased'])); //Draw Payment Method Text $temp = substr ($order->info['payment_method'] , 0, 23); $pdf->Text(130,113,ENTRY_PAYMENT_METHOD . ' ' . $temp); //$pdf->Cell(198,29,ENTRY_PAYMENT_METHOD . ' ' . $temp, 0, 0, 'R'); //Fields Name position $Y_Fields_Name_position = 125; //Table position, under Fields Name $Y_Table_Position = 131; function output_table_heading($Y_Fields_Name_position){ global $pdf; //First create each Field Name //Gray color filling each Field Name box $pdf->SetFillColor(232,232,232); //Bold Font for Field Name $pdf->SetFont('Arial','B',8); $pdf->SetY($Y_Fields_Name_position); $pdf->SetX(5); $pdf->Cell(10,6,'Anz.',1,0,'C',1); $pdf->SetX(15); $pdf->Cell(25,6,TABLE_HEADING_PRODUCTS_MODEL,1,0,'C',1); $pdf->SetX(40); $pdf->Cell(160,6,TABLE_HEADING_PRODUCTS,1,0,'C',1); //$pdf->SetX(105); $pdf->Ln(); } output_table_heading($Y_Fields_Name_position); //Show the products information line by line for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { $pdf->SetFont('Arial','',8); $pdf->SetY($Y_Table_Position); $pdf->SetX(5); $pdf->MultiCell(10,6,$order->products[$i]['qty'],1,'C'); $pdf->SetY($Y_Table_Position); $pdf->SetX(40); if (strlen($order->products[$i]['name'] ) > 40 && strlen($order->products[$i]['name']) < 50){ $pdf->SetFont('Arial','',8); $pdf->MultiCell(160,6,$order->products[$i]['name'],1,'L'); } else if (strlen($order->products[$i]['name']) > 50){ $pdf->SetFont('Arial','',8); $pdf->MultiCell(160,6,substr($order->products[$i]['name'],0,50),1,'L'); } else{ $pdf->MultiCell(160,6,$order->products[$i]['name'],1,'L'); } $pdf->SetFont('Arial','',8); //$pdf->SetY($Y_Table_Position); //$pdf->SetX(95); //$pdf->MultiCell(15,6,tep_display_tax_value($order->products[$i]['tax']) . '%',1,'C'); $pdf->SetY($Y_Table_Position); $pdf->SetX(15); $pdf->SetFont('Arial','',8); $pdf->MultiCell(25,6,$order->products[$i]['model'],1,'C'); $pdf->SetY($Y_Table_Position); $pdf->SetX(120); $pdf->SetFont('Arial','',8); $pdf->SetY($Y_Table_Position); $pdf->SetX(140); $pdf->SetY($Y_Table_Position); $pdf->SetX(160); $pdf->SetY($Y_Table_Position); $pdf->SetX(180); $Y_Table_Position += 6; //Check for product line overflow $item_count++; if ((is_long($item_count / 32) && $i >= 20) || ($i == 20)){ $pdf->AddPage(); //Fields Name position $Y_Fields_Name_position = 125; //Table position, under Fields Name $Y_Table_Position = 70; output_table_heading($Y_Table_Position-6); if ($i == 20) $item_count = 1; } } // Draw the shipping address for label //Draw the invoice delivery address text /* $pdf->SetFont('Arial','B',11); $pdf->SetTextColor(0); //$pdf->Text(117,61,ENTRY_SHIP_TO); //$pdf->SetX(0); $pdf->SetY(240); $pdf->Cell(20); $pdf->MultiCell(50, 4, strtoupper(tep_address_format(1, $order->delivery, '', '', "\n")),0,'L'); */ } // PDF's created now output the file $pdf->Output(); ?>
  13. knacknuss

    actual_Attribute_price_v0.2 Contribution

    Sorted the problem :) and if someone is interested in the solution here it is: $original_price = $product_info['products_price']; $option_price = $products_options['options_values_price']; if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract. { $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0; } else { $show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0; } if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } }
  14. Hi all I have 2 problems with this contribution: 1. Price is not updatet when there are special offers. (Normal price is displayed) eg. T-Shirt is 29.-- special price is 20.-- still 29.-- is diplayed in the drop down! 2. The price should only be displayed if there is a different price for this attribute. If the price of the attribute is the same for all, just the text should appear in the dropdown. eg instead of : red - 29.-- blue -29.-- green - 29.-- only red blue green should be shown... The code to change in product_info.php is: $original_price = $product_info['products_price']; $option_price = $products_options['options_values_price']; if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract. { $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0; } else { $show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0; } $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; instead of if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price( $products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } Can someone help me with this :) Thanks!
×