Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.


Guest

Recommended Posts

Using osc 2.3.1 and an AlgoZone template.

 

This is the first time that the template has actually caused problems. I'm installing the contribution Separate Pricing Per Customer. It calls for some changes to files that have been modified by AlgoZone.

 

I haven't found any documentation on what changes have been made by AlgoZone to osc 2.3.1 to be able to find the areas to modify for the contribution.

 

Most of the contribution works fine - the Admin is great, and most of the prices show correctly. Some don't, and some of the display for products is awry. The main culprits that I can find are in index.php, includes/modules/new_products.php, and possibly includes/modules/product_listing.php

 

Has anyone run into this before, and where can I find some kind of road map? I'm still awaiting a reply from AlgoZone, but don't expect to get one.

Link to comment
Share on other sites

Thanks. I am awaiting another reply with them. I was hoping that someone here has had some experience with this before to shed some light on the subject. Algozone is not the quickest to reply on this, and someone in the trillions of people using oscommerce surely has dealt with this before.

Link to comment
Share on other sites

Thanks. I am awaiting another reply with them. I was hoping that someone here has had some experience with this before to shed some light on the subject. Algozone is not the quickest to reply on this, and someone in the trillions of people using oscommerce surely has dealt with this before.

 

 

ALL templates are written differently, it would be a waste of time to 'guess' what the issue may be with your template.

 

 

 

 

Chris

Link to comment
Share on other sites

Algozone is not the quickest to reply on this, and someone in the trillions of people using oscommerce surely has dealt with this before.

 

Maybe true, but this here is not the algozone product support.

Link to comment
Share on other sites

Sorry, but the reason it's a template from a company that makes templates is because it's basically a cookie-cutter that AlgoZone uses for a group of their templates, which doesn't stray too far from most of their other templates.

 

I appreciate the input, but I think you're missing the point of why I was asking. If someone has dealt with AlgoZone template issues along the same lines that I have, then POSSIBLY there may be at least some direction from someone else's experience that I can take and find the issue in my own problem. I'm not necessarily looking for a real solution (although it would be nice), but more of a direction that I could look into.

 

If someone with more experience knows where to look to fix my issue, then that would be wonderful. I'm definitely not into wasting my time, but I am open for suggestions to try.

 

Here's a shot in the dark for you... and yes, I've posted this issue on SPPC's forum...

 

SPPC (4.2.2 for osc 2.3.1):

 

So I've narrowed it down to includes/modules/new_products.php, at least for the prices. I took the version of this file from new_installations_2.3.1, and the prices display correctly as long as you're selecting a category that has subcategories. When you're in the last category displaying its products, the prices are not the customer's group prices.

 

The other issue is the display of the products within category listings:

 

When you select a category with subcategories:

  • the products do not display properly
  • it only displays up to nine or ten products
  • there's no Sort By, Page #, or Display x items per page
  • the prices are correct

But - when you get the category without any more subcategories:

  • the products display correctly
  • all products display
  • the page is complete with the Sort By, Page #, and Display x items per page
  • the prices are wrong

So I'm guessing that the display properties are in another file... Does anyone have an educated guess on this?

Link to comment
Share on other sites

I realize this is not AlgoZone's support center... Why is it so difficult to comprehende what I'm trying to do here? I'm just a person trying to solve a problem I have, and for some reason you guys are taking my approach the wrong way. I've tried several ways to get an answer for this problem, and this is just one of them. In the hopes that someone has also been in my shoes and found something useful that I could try or look in a different direction, then that is what I seek. I'm not into wasting my time. I'm not 100% sure that the issue is in the template, but I'm more than a little sure that someone out there has dealt with an AlgoZone template and could offer something useful instead of bashing me for posting here.

Link to comment
Share on other sites

Do you have a screen shot of your error or problem plus you got your template code . I know they dont support it but we are here to help each other out. I know abit of code here and there and I have been all over this code for the last 3 days none stop so I may beable to help yeah

 

 

Cheers

Link to comment
Share on other sites

Thanks Carlton -

 

I can't get the images to show up on this site...

 

 

 

Are you familiar with Separate Pricing Per Customer, not that it may matter or not here...?

 

My includes/modules/new_products.php:

<!-- new_products //-->
<?php
//  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 37b) ### */
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (FIXED 9.24.11) ##### */
/*	$listing_sql = "select p.products_id, p.products_image, p.products_model, p.products_weight, p.products_quantity, p.products_tax_class_id, pd.products_name, pd.products_description, p.products_msrp, p.products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (p.products_id = pd.products_id) left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) where p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc";
 } else {
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (FIXED 9.24.11) ##### */
/* $listing_sql = "select distinct p.products_id, p.products_image, p.products_model, p.products_weight, p.products_quantity, p.products_tax_class_id, pd.products_name, pd.products_description, p.products_msrp, p.products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (p.products_id = pd.products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on (p.products_id = p2c.products_id) left join " . TABLE_CATEGORIES . " c on (p2c.categories_id = c.categories_id) left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) where p2c.categories_id IN (" . implode($subcategories, ',') . ") and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc";
 }
*/
 //$listing_query = tep_db_query($listing_sql . " LIMIT " . MAX_DISPLAY_NEW_PRODUCTS);
 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (PART OF Separate Pricing Per Customer Step 37b (10.17.11)) ##### */
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_msrp, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$subcategories = array( $new_products_category_id );
tep_get_subcategories( $subcategories, $new_products_category_id );

/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (PART OF Separate Pricing Per Customer Step 37b (10.17.11)) ##### */
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_msrp, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on pd.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id) where c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id
 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
$customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
$customer_group_id = '0';
 }
 if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0) {
  while ($_new_products = tep_db_fetch_array($new_products_query)) {
  $new_products[] = $_new_products;
  $list_of_prdct_ids[] = $_new_products['products_id'];
 }

 $select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
 if ($no_of_new_products > 1) {
  for ($n = 1 ; $n < count($list_of_prdct_ids) ; $n++) {
$select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' ";
  }
 }
// get all customers_group_prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
 if ($customer_group_id != '0') {
  $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'");
  while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '');
  }

  for ($x = 0; $x < $no_of_new_products; $x++) {
// replace products prices with those from customers_group table
 if(!empty($new_prices)) {
  for ($i = 0; $i < count($new_prices); $i++) {
   if( $new_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
	$new_products[$x]['products_price'] = $new_prices[$i]['products_price'];
   }
  }
 } // end if(!empty($new_prices)
  } // end for ($x = 0; $x < $no_of_products_new; $x++)
 } // end if ($customer_group_id != '0')

// an extra query is needed for all the specials
 $specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "' ");
 while ($specials_array = tep_db_fetch_array($specials_query)) {
  $new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price']);
 }

// replace products_price with the correct specials_new_products_price
 if(!empty($new_s_prices)) {
  for ($x = 0; $x < $no_of_new_products; $x++) {
for ($i = 0; $i < count($new_s_prices); $i++) {
 if( $new_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
  $new_products[$x]['products_price'] = $new_s_prices[$i]['specials_new_products_price'];
 }
}
  }
 } // // end if(!empty($new_s_prices)
//  $num_new_products = tep_db_num_rows($new_products_query);
//if ($no_of_new_products > 0) {
//  $counter = 0;
$col = 0;
$new_prods_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">'; //ORIGINALLY 0,100,0,2
//  while ($new_products = tep_db_fetch_array($new_products_query)) {
//	$counter++;
 for ($counter = 0; $counter < $no_of_new_products; $counter++) {
  if ($col === 0) {
	$new_prods_content .= '<tr>';
  }
  $new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$counter]['products_image'], $new_products[$counter]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '"><u>' . $new_products[$counter]['products_name'] . '</u></a><br />' . '<b>'.$currencies->display_price($new_products[$counter]['products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])).'</b>' . '  <font size=1.5 color="red">MSRP: ' . $currencies->display_price($new_products[$counter]['products_msrp'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])) . '</font>' . '</td>';
  $col ++;
  if (($col > 2) || ($counter == $no_of_new_products)) {
	$new_prods_content .= '</tr>';
	$col = 0;
  }
}
$new_prods_content .= '</table>';
?>
<!-- ## BEGIN: TO REMOVE PRODUCTS BEING LISTED WHEN SELECTING CATEGORIES WITH SUBCATEGORIES ## -->
 <h2><?php echo sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')); ?></h2>
 <div class="contentText">
<?php echo $new_prods_content; ?>
 </div>
<!-- ## END: TO REMOVE PRODUCTS BEING LISTED WHEN SELECTING CATEGORIES WITH SUBCATEGORIES ## -->
<?php
 }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 37b) ### */
?>
<!-- new_products_eof //-->

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...