Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate pricing per customer..with product_listing.php


Guest

Recommended Posts

everythings are looking good except, i couldn't really find the exact line for this instructions:-

 

 

catalog/includes/modules/product_listing.php

 

catalog/includes/modules/product_listing.php



Around line 97



After:



if ($listing_numrows > 0) {

 $number_of_products = '0';

 $listing = tep_db_query($listing_sql);

 while ($listing_values = tep_db_fetch_array($listing)) {



Add:



$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");

$customer_group = tep_db_fetch_array($customer_group_query);

$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing_values['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");

if ( $customer_group['customers_group_id'] != 0) {

 if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {

   $listing_values['products_price'] = $customer_group_price['customers_group_price'];

 }

}

 

 

Anyway, i appended the new instructions at line 93. There is no errors generated except

 

1) the display of the pricing under sub-categories are not showing the "logged in" price. it shows the normal price. Do we need some "hack" at the following line?

         case 'PRODUCT_LIST_PRICE':

           $lc_align = 'right';

           if (tep_not_null($listing['specials_new_products_price'])) {

             $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

           } else {

             $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

           }

 

i am sure a lot of you have luck with this contri. thanks in advance

Link to comment
Share on other sites

You've been snagged by a code change in oscommerce - listing_values[ has changed to listing[

 

As in:

 

while ($listing_values = tep_db_fetch_array($listing)) {

is now

while ($listing = tep_db_fetch_array($listing)) {

 

so therefore lines such as

$listing_values['products_price'] = $customer_group_price

become

$listing['products_price'] = $customer_group_price

 

hope this helps.

Unexpect the Expected

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...