Zen Cart Logo
Forums / General Questions / odd information on page.

odd information on page.

Locked

Views: 1,861

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
5 Aug 2006, 10:16 PM
#1
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

odd information on page.

I am getting this odd sting

qty'] .= '-' . number_format($products_discounts_query->fields['discount_qty']-1); } } } $disc_cnt=0; $columnCount++; } ?>

when i click on a product this comes up at the top of the page.

http://www.gclefjewelry.com/index.php?main_page=product_info&cPath=1&products_id=39

there is a sample.

any ideas?

G Clef Jewelry
Dichroic and Beaded Jewelry

5 Aug 2006, 10:25 PM
#2
stumped avatar

stumped

New Zenner

Join Date:
Oct 2004
Posts:
84
Plugin Contributions:
0

Re: odd information on page.

I think it may have something to do with the missing "add to cart" button

5 Aug 2006, 10:32 PM
#3
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

Re: odd information on page.

i didnt even know that was missing, lol

ummm.....

G Clef Jewelry
Dichroic and Beaded Jewelry

5 Aug 2006, 11:03 PM
#4
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

Re: odd information on page.

okay fixed the add to cart button.

i had added an php file i didnt need anymore that was screwing that part up.

however i am still getting

qty'] .= '-' . number_format($products_discounts_query->fields['discount_qty']-1); } } } $disc_cnt=0; $columnCount++; } ?>

:cry:

G Clef Jewelry
Dichroic and Beaded Jewelry

6 Aug 2006, 2:12 AM
#5
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

Re: odd information on page.

okay here is the php file that string is in, but i dont understand why it is hanging out on its own and causing problems

<?php
/**
 * products_quantity_discounts module
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: products_quantity_discounts.php 3453 2006-04-18 00:31:01Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

// if customer authorization is on do not show discounts

$zc_hidden_discounts_on = false;
$zc_hidden_discounts_text = '';
switch (true) {
  case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
  // customer must be logged in to browse
  $zc_hidden_discounts_on = true;
  $zc_hidden_discounts_text = 'MUST LOGIN';
  break;
  case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
  // customer may browse but no prices
  $zc_hidden_discounts_on = true;
  $zc_hidden_discounts_text = TEXT_LOGIN_FOR_PRICE_PRICE;
  break;
  case (CUSTOMERS_APPROVAL == '3' and TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM != ''):
  // customer may browse but no prices
  $zc_hidden_discounts_on = true;
  $zc_hidden_discounts_text = TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM;
  break;
  case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customer_id'] == ''):
  // customer must be logged in to browse
  $zc_hidden_discounts_on = true;
  $zc_hidden_discounts_text = TEXT_AUTHORIZATION_PENDING_PRICE;
  break;
  case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customers_authorization'] > '0'):
  // customer must be logged in to browse
  $zc_hidden_discounts_on = true;
  $zc_hidden_discounts_text = TEXT_AUTHORIZATION_PENDING_PRICE;
  break;
  default:
  // proceed normally
  break;
}
// create products discount output table

// find out the minimum quantity for this product
$products_min_query = $db->Execute("select products_quantity_order_min from " . TABLE_PRODUCTS . " where products_id='" . $products_id_current . "'");
$products_quantity_order_min = $products_min_query->fields['products_quantity_order_min'];

// retrieve the list of discount levels for this product
$products_discounts_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . (int)$products_id_current . "' and discount_qty !=0 " . " order by discount_qty");


$discount_col_cnt = DISCOUNT_QUANTITY_PRICES_COLUMN;

$display_price = zen_get_products_base_price($products_id_current);
$display_specials_price = zen_get_products_special_price($products_id_current, true);

// set first price value
if ($display_specials_price == false) {
  $show_price = $display_price;
} else {
  $show_price = $display_specials_price;
}

switch (true) {
  case ($products_discounts_query->fields['discount_qty'] <= 2):
  $show_qty = '1';
  break;
  case ($products_quantity_order_min == ($products_discounts_query->fields['discount_qty']-1) || $products_quantity_order_min == ($products_discounts_query->fields['discount_qty'])):
  $show_qty = $products_quantity_order_min;
  break;
  default:
  $show_qty = $products_quantity_order_min . '-' . number_format($products_discounts_query->fields['discount_qty']-1);
  break;
}
//$discounted_price = $products_discounts_query->fields['discount_price'];
// $currencies->display_price($discounted_price, zen_get_tax_rate(1), 1)

$display_price = zen_get_products_base_price($products_id_current);
$display_specials_price = zen_get_products_special_price($products_id_current, true);
$disc_cnt = 1;
$quantityDiscounts = array();
$columnCount = 0;
while (!$products_discounts_query->EOF) {
  $disc_cnt++;
  switch ($products_discount_type) {
    // none
    case '0':
      $quantityDiscounts[$columnCount]['discounted_price'] = 0;
    break;
    // percentage discount
    case '1':
      if ($products_discount_type_from == '0') {
        $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100));
      } else {
        if (!$display_specials_price) {
          $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100));
        } else {
          $quantityDiscounts[$columnCount]['discounted_price'] = $display_specials_price - ($display_specials_price * ($products_discounts_query->fields['discount_price']/100));
        }
      }
    break;
    // actual price
    case '2':
      if ($products_discount_type_from == '0') {
        $quantityDiscounts[$columnCount]['discounted_price'] = $products_discounts_query->fields['discount_price'];
      } else {
        $quantityDiscounts[$columnCount]['discounted_price'] = $products_discounts_query->fields['discount_price'];
      }
    break;
    // amount offprice
    case '3':
      if ($products_discount_type_from == '0') {
        $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - $products_discounts_query->fields['discount_price'];
      } else {
        if (!$display_specials_price) {
          $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - $products_discounts_query->fields['discount_price'];
        } else {
          $quantityDiscounts[$columnCount]['discounted_price'] = $display_specials_price - $products_discounts_query->fields['discount_price'];
        }
      }
    break;
  }

  $quantityDiscounts[$columnCount]['show_qty'] = number_format($products_discounts_query->fields['discount_qty']);
  $products_discounts_query->MoveNext();
  if ($products_discounts_query->EOF) {
    $quantityDiscounts[$columnCount]['show_qty'] .= '+';
  } else {
    if (($products_discounts_query->fields['discount_qty']-1) != $show_qty) {
      if ($quantityDiscounts[$columnCount]['show_qty'] < $products_discounts_query->fields['discount_qty']-1) {
        $quantityDiscounts[$columnCount]['show_qty'] .= '-' . number_format($products_discounts_query->fields['discount_qty']-1);
      }
    }
  }
  $disc_cnt=0;
  $columnCount++;
}
?>qty'] .= '-' . number_format($products_discounts_query->fields['discount_qty']-1);
      }
    }
  }
  $disc_cnt=0;
  $columnCount++;
}
?>

what do i need to change to make that right?

G Clef Jewelry
Dichroic and Beaded Jewelry

6 Aug 2006, 2:16 AM
#6
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,656
Plugin Contributions:
0

Re: odd information on page.

If your add to cart was broken- it is possible your broke the call to the quantity discounts while customizing your tpl_product_info_display.php

Have you tried replacing it with a fresh copy to see if things are fixed, then reapply your customizations a little at a time.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

6 Aug 2006, 2:46 AM
#7
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

Re: odd information on page.

thats just it, i didnt do any customizations to it. not that im aware of anyways.

i got this string right after a fresh zen cart install w/ future_zen template and only ep added to it and its first upload of the ep file.

i have added a few other things (returns mod, xsell sidebox & cross sell mods (although not working yet) ) and so far i havent seen a change in that string.

i would like to use tabbed lite mod for the cross sell items (which i know uses that php file) but not yet. however that file did get put up with i uploaded some of my backup files. :( that broke my add to cart button, as soon as i deleted that file from my server i had my add to cart button back.

ill look for another copy of products_quantity_discounts.php im sure i have one around here..i havent deleted anything... lol

G Clef Jewelry
Dichroic and Beaded Jewelry

6 Aug 2006, 3:23 AM
#8
lala_g_clef_jewelry avatar

lala_g_clef_jewelry

Zen Follower

Join Date:
Apr 2006
Location:
Kansas
Posts:
233
Plugin Contributions:
0

Re: odd information on page.

okay found new copy, uploaded

fixed that odd string :D

G Clef Jewelry
Dichroic and Beaded Jewelry