Jump to content

Goerg

Members
  • Content count

    4
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Jorge
  1. I wanted to say: $products['products_price'] = $listing[$x]['products_price'] in some part of the code. Jorge
  2. Hi Yicon I did a try without success. I guess the place to make the insert is right, not line 293 but 332 in current version. Yesterday I was trying to solve it all the day. I think that besides of doing this insert, changes must be done in other places, some 30 lines after this insert. I see the problem like this: In Separate Prices, the array is builded with: $listing[$x]['products_price'] where $x will be the different kind of clients list. The original one is $listing[$x]['products_price'] In Product Listing Enhancements Sam works with other array: $products['products_id'] So, besides of inserting the Separate Price code in Product Listing Enhancements, some modifications must be done in the arrays, maybe make $products['products_id'] = $listing[$x]['products_price'] in some part of the code. Perhaps Sam can help with it Jorge
  3. Hi I installed succesfully Separate Price per Customer 4.2 and it´s working ok. Now I want to add the Product Listing Enhancements and have problems to join both contributions specially in /include/modules/product_listing.php, because this file is quite different from the original one. I asked Sam, the creator of Product Listing, but he thinks I must do the modification in index.php. Has anyone has accomplished to install both modules? Jorge
  4. Hi Sam (and anyone who can help me) I have an oscommerce with Separate Price per customer 4.2 installed and working. I'm trying to add this contribution and I´m having problems specially with product_listing.php. If I add the Separate Price code (I tried in line 86 of the Product Listing version), I have errors. This is the code I guess is what must be added (but maybe not the only one) ************************************************************************************* // BOF Separate Pricing per Customer $no_of_listings = tep_db_num_rows($listing_query); // 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'; } while ($_listing = tep_db_fetch_array($listing_query)) { $listing[] = $_listing; $list_of_prdct_ids[] = $_listing['products_id']; } // next part is a debug feature, when uncommented it will print the info that this module receives /* echo '<pre>'; print_r($listing); echo '</pre>'; */ // get all product 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 products_id in (" . implode(',', $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' => '', 'final_price' => $pg_array['price']); } for ($x = 0; $x < $no_of_listings; $x++) { // replace products prices with those from customers_group table if(!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $listing[$x]['products_price'] = $new_prices[$i]['products_price']; $listing[$x]['final_price'] = $new_prices[$i]['final_price']; } } } // end if(!empty($new_prices) $listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group $listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price } // end for ($x = 0; $x < $no_of_listings; $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 products_id in (" . implode(',', $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'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']); } // add the correct specials_new_products_price and replace final_price for ($x = 0; $x < $no_of_listings; $x++) { if(!empty($new_s_prices)) { for ($i = 0; $i < count($new_s_prices); $i++) { if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) { $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price']; $listing[$x]['final_price'] = $new_s_prices[$i]['final_price']; } } } // end if(!empty($new_s_prices) } // end for ($x = 0; $x < $no_of_listings; $x++) **************************************************************** Anyone can help me? Thanks! Jorge
×