Jump to content



Photo
* * * * * 14 votes

Seperate Pricing Per Customer v3.5


  • Please log in to reply
5950 replies to this topic

#5841   The Munch

The Munch
  • Members
  • 67 posts
  • Real Name:Scott
  • Gender:Male
  • Location:Iowa, USA

Posted 26 October 2011 - 00:54

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?
Thank You!!
----------
Using: OSC 2.3.1, Algozone Template, Jcow 5 Pro, CometChat 4 Premium.

Contributions for OSC-2.3.1: QT Pro 4.6.1, Easy Populate EPv2.77a, Admin Notes, Contribution Tracker, Multi-Product Manager, myQBi Quickbooks Sync, Order Editor 5.0.9, Dynamic Sitemap, Tax ID in Order Editor, Separate Pricing Per Customer v4.2.2 ... etc ...

Contributions for OSC-2.2 I've Modified for OSC-2.3.1: Admin Level Account with Categories 2.3.4, File Logging or Email for Failed Admin Login Attempts, Autologon v1.09, Admin Specials by Categories, CCGV 6.0_1, Hide Categories, How Did You Hear About Us, MSRP Listing, Multiple Sales Per Product, osc as info site, OSC Checkout Security Boost v1.1, Points and Rewards Module, Quick Stock Updater, Quick Updates 292, RMA Returns System 2.6, Show Unit Price, Store Mode, Supplier Admin v1.3, Tell A Friend, Required Customer Details v22rc2a, Admin Change Customers Password v3.3, PDF Invoice & PackingSlip 1.6, Quick Price Updates for SPPC v1.5, Country-State Selector v1.5.5 + Limit Countries v2.2, Contact Us Popup Business Card, No Right Click, Delete Customer Account v1.2, Control Login v2.2, Member Type Control v1.1, .... etc...

#5842   The Munch

The Munch
  • Members
  • 67 posts
  • Real Name:Scott
  • Gender:Male
  • Location:Iowa, USA

Posted 29 October 2011 - 12:40

... is there anybody... out... there?

This is the last thing killing my site right now, and I could REALLY use some educated assistance!!

Edited by The Munch, 29 October 2011 - 12:41.

Thank You!!
----------
Using: OSC 2.3.1, Algozone Template, Jcow 5 Pro, CometChat 4 Premium.

Contributions for OSC-2.3.1: QT Pro 4.6.1, Easy Populate EPv2.77a, Admin Notes, Contribution Tracker, Multi-Product Manager, myQBi Quickbooks Sync, Order Editor 5.0.9, Dynamic Sitemap, Tax ID in Order Editor, Separate Pricing Per Customer v4.2.2 ... etc ...

Contributions for OSC-2.2 I've Modified for OSC-2.3.1: Admin Level Account with Categories 2.3.4, File Logging or Email for Failed Admin Login Attempts, Autologon v1.09, Admin Specials by Categories, CCGV 6.0_1, Hide Categories, How Did You Hear About Us, MSRP Listing, Multiple Sales Per Product, osc as info site, OSC Checkout Security Boost v1.1, Points and Rewards Module, Quick Stock Updater, Quick Updates 292, RMA Returns System 2.6, Show Unit Price, Store Mode, Supplier Admin v1.3, Tell A Friend, Required Customer Details v22rc2a, Admin Change Customers Password v3.3, PDF Invoice & PackingSlip 1.6, Quick Price Updates for SPPC v1.5, Country-State Selector v1.5.5 + Limit Countries v2.2, Contact Us Popup Business Card, No Right Click, Delete Customer Account v1.2, Control Login v2.2, Member Type Control v1.1, .... etc...

#5843   The Munch

The Munch
  • Members
  • 67 posts
  • Real Name:Scott
  • Gender:Male
  • Location:Iowa, USA

Posted 30 October 2011 - 12:17

I think I've (possibly) figured out that the problem may lie in that I'm using an AlgoZone template. They've changed some coding, files, and whatnot. I can not find any information on a roadmap of changes to be able to find what's needed for this contribution in osc 2.3.1. The template has never really caused any problems before, when it comes to addons, so I've been a little surprised with this.

It's really sucking because the Admin works fine, and most of the site works. It's just this problem I've been describing on the last page of this forum.

Has anyone else gotten this to work using an AlgoZone template?
Thank You!!
----------
Using: OSC 2.3.1, Algozone Template, Jcow 5 Pro, CometChat 4 Premium.

Contributions for OSC-2.3.1: QT Pro 4.6.1, Easy Populate EPv2.77a, Admin Notes, Contribution Tracker, Multi-Product Manager, myQBi Quickbooks Sync, Order Editor 5.0.9, Dynamic Sitemap, Tax ID in Order Editor, Separate Pricing Per Customer v4.2.2 ... etc ...

Contributions for OSC-2.2 I've Modified for OSC-2.3.1: Admin Level Account with Categories 2.3.4, File Logging or Email for Failed Admin Login Attempts, Autologon v1.09, Admin Specials by Categories, CCGV 6.0_1, Hide Categories, How Did You Hear About Us, MSRP Listing, Multiple Sales Per Product, osc as info site, OSC Checkout Security Boost v1.1, Points and Rewards Module, Quick Stock Updater, Quick Updates 292, RMA Returns System 2.6, Show Unit Price, Store Mode, Supplier Admin v1.3, Tell A Friend, Required Customer Details v22rc2a, Admin Change Customers Password v3.3, PDF Invoice & PackingSlip 1.6, Quick Price Updates for SPPC v1.5, Country-State Selector v1.5.5 + Limit Countries v2.2, Contact Us Popup Business Card, No Right Click, Delete Customer Account v1.2, Control Login v2.2, Member Type Control v1.1, .... etc...

#5844   Rhino13

Rhino13
  • Members
  • 8 posts
  • Real Name:Morne

Posted 01 November 2011 - 12:15

After adding Add Multi with Plus Minus Button the product_listing.php changed to product_listing_multi.php so I try to get the price group to work with it But now getting the following
Parse error: syntax error, unexpected T_ELSE in C:\Program Files\EasyPHP-5.3.8.0\www\includes\modules\product_listing_multi.php on line 229
What is wrong?
case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; //$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; $lc_text = '<input type=button value=" -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return false;"><input type="text" name="add_id['.$number_of_products.']" id="add_id_'.$listing[$x]['products_id'].'" value="0" size="4"><input type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return false;">'; $lc_text .= '<input type="hidden" name="products_id['.$number_of_products.']" value="'.$listing[$x]['products_id'].'">'; break; } $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } new productListingBox($list_box_contents); } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new productListingBox($list_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> </tr> </table> </form> <?php
This is the whole file[code=auto:0] <form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>">


Hi peteravu

Did you manage to get this working I'm strangling with the same problem, I'm not and php guru only a beginner and winmerge does not help me to many lines that need to change

could you please assist me in this

#5845   peteravu

peteravu
  • Members
  • 324 posts
  • Real Name:peter avu
  • Gender:Male

Posted 01 November 2011 - 20:02

After adding Add Multi with Plus Minus Button the product_listing.php changed to product_listing_multi.php so I try to get the price group to work with it But now getting the following

Parse error: syntax error, unexpected T_ELSE in C:\Program Files\EasyPHP-5.3.8.0\www\includes\modules\product_listing_multi.php on line 229
What is wrong?
case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; //$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; $lc_text = '<input type=button value=" -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return false;"><input type="text" name="add_id['.$number_of_products.']" id="add_id_'.$listing[$x]['products_id'].'" value="0" size="4"><input type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return false;">'; $lc_text .= '<input type="hidden" name="products_id['.$number_of_products.']" value="'.$listing[$x]['products_id'].'">'; break; } $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } new productListingBox($list_box_contents); } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new productListingBox($list_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> </tr> </table> </form> <?php
This is the whole file
<form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>">

Hi peteravu

Did you manage to get this working I'm strangling with the same problem, I'm not and php guru only a beginner and winmerge does not help me to many lines that need to change

could you please assist me in this

I change the file bacause the product_listing_multi.php is a 2003. So I change the curent product_listing.php to make a new product_listing_multi.php

Not sure if I changed other things so please compare witht your old product_listing.php

this is my product_listing_multi.php now

<form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>">
<script language=javascript> function changeValue(textObject,delta){ var myVal = parseInt(textObject.value); if (myVal == NaN) { myVal = 0; } else { myVal = myVal + delta; } /* check that it is not negetive */ if (myVal < 0) { myVal = 0; } textObject.value = myVal; return; } </script>
<?php
/*
$Id$
adapted for Separate Pricing Per Customer v4.2 2007/08/23
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
?>
 
<div class="contentText">
<?php
if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td>
</tr>
</table>
<br>
<div>
<span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
<span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<br />
<?php
}
$prod_list_contents = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header ui-corner-top infoBoxHeading">' .
' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingHeader">' .
' <tr>';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right';
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
break;
case 'PRODUCT_LIST_MIN_ORDER_QTY':
$lc_align = 'center';
$lc_text = ' ' . TABLE_HEADING_MIN_ORDER_QTY . ' ';
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_text = TABLE_HEADING_BUY_NOW;
$lc_align = 'center';
break;
}
if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
}
$prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . '>' . $lc_text . '</td>';
}
$prod_list_contents .= ' </tr>' .
' </table>' .
' </div>';
if ($listing_split->number_of_rows > 0) {
$rows = 0;
$listing_query = tep_db_query($listing_split->sql_query);
// 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 . "'");
// $no_of_pg_products = tep_db_num_rows($pg_query) ;
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++)
$prod_list_contents .= ' <div class="ui-widget-content ui-corner-bottom productListTable">' .
' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingData">';
// while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
$rows++;
$prod_list_contents .= ' <tr>';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$prod_list_contents .= ' <td>' . $listing[$x]['products_model'] . '</td>';
break;
case 'PRODUCT_LIST_NAME':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
} else {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a></td>';
break;
case 'PRODUCT_LIST_PRICE':
if (tep_not_null($listing[$x]['specials_new_products_price'])) {
$prod_list_contents .= ' <td align="right"><del>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span></td>';
} else {
$prod_list_contents .= ' <td align="right">' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</td>';
}
break;
case 'PRODUCT_LIST_QUANTITY':
$prod_list_contents .= ' <td align="right">' . $listing[$x]['products_quantity'] . '</td>';
break;
case 'PRODUCT_LIST_MIN_ORDER_QTY':
$prod_list_contents .= ' <td align="right">' . $lc_text = ' ' . $listing[$x]['products_min_order_qty'] . ' ';
break;
case 'PRODUCT_LIST_WEIGHT':
$prod_list_contents .= ' <td align="right">' . $listing[$x]['products_weight'] . '</td>';
break;
case 'PRODUCT_LIST_IMAGE':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
} else {
$prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
}
break;
case 'PRODUCT_LIST_BUY_NOW':
$prod_list_contents .= ' <td align="center">' . $lc_text = '<input type=button value=" -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return false;"><input type="text" name="add_id['.$number_of_products.']" id="add_id_'.$listing[$x]['products_id'].'" value="0" size="3"><input type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return false;">';
$lc_text .= '<input type="hidden" name="products_id['.$number_of_products.']" value="'.$listing[$x]['products_id'].'">';
break;
}
}
$prod_list_contents .= ' </tr>';
}
$prod_list_contents .= ' </table>' .
' </div>' .
'</div>';
echo $prod_list_contents;
} else {
?>
<p><?php echo TEXT_NO_PRODUCTS; ?></p>
<?php
}
if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<br />
<div>
<span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
<span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td>
</tr>
</table>
</form>
<?php
}
?>
</div>


#5846   Rhino13

Rhino13
  • Members
  • 8 posts
  • Real Name:Morne

Posted 02 November 2011 - 07:28

Hi peteravu
will give it a go thank you

#5847 ONLINE   14steve14

14steve14
  • Members
  • 3,539 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 04 November 2011 - 16:29

Has anyone added this contribution in 2.3.1 and qtpro.

I am having trouble with the code changes to product_info.php.
REMEMBER BACKUP, BACKUP AND BACKUP

Don't take life too seriously. no one gets out alive anyway

#5848 ONLINE   14steve14

14steve14
  • Members
  • 3,539 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 07 November 2011 - 16:53

Has anyone sucessfully added this contibution and the qtpro addon. I have come unstuck at adding the code for the product_info.php page. Qtpro alters some code in this page, and its not their. Cabn anyone give any help.
REMEMBER BACKUP, BACKUP AND BACKUP

Don't take life too seriously. no one gets out alive anyway

#5849   The Munch

The Munch
  • Members
  • 67 posts
  • Real Name:Scott
  • Gender:Male
  • Location:Iowa, USA

Posted 09 November 2011 - 22:24

I have a heavily modified product_info.php, but a little over half way down... a bunch of stuff got moved to /includes/classes/pad_base.php for QT Pro.

/* ### LINE EDIT: Separate Pricing Per Customer v4.2.2  - Hide attributes from customer groups - ADD: and find_in_set()=0 ### */
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 ");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
//++++ QT Pro: Begin Changed code
/* EVERYTHING IN HERE WAS PUT INTO /includes/classes/pad_base.php, LINES 287-313 FOR QT Pro */
	  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);
	  require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
	  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
	  $pad = new $class($products_id);
	  echo $pad->draw();
    }
//Display a table with which attribute combinations is in stock to the customer?
if(PRODINFO_ATTRIBUTE_DISPLAY_STOCK_LIST == 'True'): require(DIR_WS_MODULES . "qtpro_stock_table.php"); endif;
//++++ QT Pro: End Changed Code

Thank You!!
----------
Using: OSC 2.3.1, Algozone Template, Jcow 5 Pro, CometChat 4 Premium.

Contributions for OSC-2.3.1: QT Pro 4.6.1, Easy Populate EPv2.77a, Admin Notes, Contribution Tracker, Multi-Product Manager, myQBi Quickbooks Sync, Order Editor 5.0.9, Dynamic Sitemap, Tax ID in Order Editor, Separate Pricing Per Customer v4.2.2 ... etc ...

Contributions for OSC-2.2 I've Modified for OSC-2.3.1: Admin Level Account with Categories 2.3.4, File Logging or Email for Failed Admin Login Attempts, Autologon v1.09, Admin Specials by Categories, CCGV 6.0_1, Hide Categories, How Did You Hear About Us, MSRP Listing, Multiple Sales Per Product, osc as info site, OSC Checkout Security Boost v1.1, Points and Rewards Module, Quick Stock Updater, Quick Updates 292, RMA Returns System 2.6, Show Unit Price, Store Mode, Supplier Admin v1.3, Tell A Friend, Required Customer Details v22rc2a, Admin Change Customers Password v3.3, PDF Invoice & PackingSlip 1.6, Quick Price Updates for SPPC v1.5, Country-State Selector v1.5.5 + Limit Countries v2.2, Contact Us Popup Business Card, No Right Click, Delete Customer Account v1.2, Control Login v2.2, Member Type Control v1.1, .... etc...

#5850   YuhnavSingh

YuhnavSingh
  • Members
  • 3 posts

Posted 26 November 2011 - 22:58

Hi

I am having problems intergrating the product_listing.php from SPPC 2.3.1 with my product_listing.php from my modified oscommerce 2.3.1 with built in template.

Any help would be appreciated.

Regards.

#5851   RCHobbyAddict

RCHobbyAddict
  • Members
  • 54 posts
  • Real Name:Anam Aggarwal

Posted 27 November 2011 - 06:26

I am facing a problem. I have created 2 customer groups. But when a customer from any of the groups place an order, no tax is added to it. But is a customer who is not under any group places an order, the tax is added to the items in his cart. How to fix that?
I am running OSC 2.3.1

Edited by anam_funny, 27 November 2011 - 06:38.


#5852   gaspower

gaspower
  • Members
  • 453 posts
  • Real Name:JR
  • Gender:Male
  • Location:OR

Posted 27 November 2011 - 15:08

Hello,

thanks again for a great contribution. I am using it in 2.31 and all works fine, accept for an issue I just noticed on the admin. When creating a new product, I enter all the details including the (SPPC) dealer price. When I save for the first time, all is saved to the database but the (SPPC) dealer price? If I edit again and re-enter the dealer price and save, it is then inserted into the database and shows? What would cause the database for the SPPC dealer input not to save the first time, but accept on the second save?

Thanks JR

#5853   RCHobbyAddict

RCHobbyAddict
  • Members
  • 54 posts
  • Real Name:Anam Aggarwal

Posted 30 November 2011 - 17:32

Yes. That is the smae problem I was going to report... After doing all the calculations, and entering them, I had to redo them again...

#5854   YuhnavSingh

YuhnavSingh
  • Members
  • 3 posts

Posted 11 December 2011 - 23:44

Could someone please provide me with the correct code that needs to be added to the product_listing.php file. This is for oscommerce 2.3.1.

Thanks in advance

#5855   ShaGGy

ShaGGy
  • Members
  • 77 posts
  • Real Name:Les

Posted 13 December 2011 - 00:39

Hopefully someone with brains in here can help with this [img]http://forums.oscommerce.com//public/style_emoticons/default/smile.png[/img]

What I am trying to do is get SPPC to use prices from two extra price columns I have in the products table (special_price_2 & Special_price_3) rather than let it get the prices from the -customers_group_price from " . TABLE_PRODUCTS_GROUPS-

I have tried changing if ($customer_group_id > 0) to if ($customer_group_id = 1)

and "select customers_group_price from " . TABLE_PRODUCTS_GROUPS to "select special_price_2 from " . TABLE_PRODUCTS

but it then fails because of and customers_group_id = '" . $customer_group_id . not being in the table.

If i am thinking correctly and remove the and customers_group_id = '" . $customer_group_id . it should then work?

Can anyone give me the correct syntax for the line after removing this part as i beleive it does not need to look up the customer_group_id as it gets this from the customers account table and i am setting the if ($customer_group_id = 1)




// BOF Separate Pricing per Customer
	  if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
	    $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	    if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
		  $product_info['products_price']= $scustomer_group_price['customers_group_price'];
    	  }
	  } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer
	  $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
    } else {
// BOF Separate Pricing per Customer
	  if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
	    $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	    if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
                    $product_info['products_price']= $scustomer_group_price['customers_group_price'];
                }
            } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer


Edited by ShaGGy, 13 December 2011 - 00:44.


#5856   kozsar

kozsar
  • Members
  • 12 posts
  • Real Name:Az igazi nevem

Posted 08 January 2012 - 16:44

Hi Everybody!

First of all big-big thanks for the feedback for every person who sended especially for Mr. Jan Zonjee and for the GREAT contirb!

After trying lots of hours unsuccessfully manage my problem I am trying to ask some help for my problem.

My problem details:
Everything works great (minimum order quantity, rounding, volume discounts etc) except one half thing.

I am selling products in different colors and of course I setted up for every product a discount category (if someone orders 5 red and 10 black thing from the same product it would count as it would be 15).

The problem is with the price calculation. It doesn't corrects the price after adding 2-3 colors from the same product (of course after reaching a volume discount category) when product_info.php has is a quantity field. When the customer cicks on the update cart or if the customers logs in-out or the customer updates the quantity (at shopping_cart.php) everything is correct.

I have already went through 2-3 times if it is everything correct or not, and to tell you the truth I am fully disappointed...
I really really hope that somebody could help me out.

#5857   peteravu

peteravu
  • Members
  • 324 posts
  • Real Name:peter avu
  • Gender:Male

Posted 08 January 2012 - 21:32

I have modified the product_listing.php as below.
but I now have the problem when I want attribute price to add 12USD retail and 10USD on group "1", then for every attribute price changes I add on groupe"1" some attribute disappears and finally non of the attributes shows in group"1".
What is wrong in the code below?

// BOF SPPC Hide attributes from customer groups
	$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 ");
	$products_attributes = tep_db_fetch_array($products_attributes_query);
	if ($products_attributes['total'] > 0) {
?>
	<p><?php echo TEXT_PRODUCT_OPTIONS; ?></p>
	<p>
<!--
			// Code segment includes/modified for Multiple product option lines.
	 // maintainance and Qns : Harishyam :> feenix_666@yahoo.com
-->
<?php	
		if ($products_options_total['total'] == 1) {
   for($i=0;$i<$products_attributes['total'];$i++)
   {
	  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name");
	  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
		$products_options_array = array();
		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0");
	$list_of_prdcts_attributes_id = '';
	$products_options = array(); // makes sure this array is empty again
		while ($_products_options = tep_db_fetch_array($products_options_query)) {
	 $products_options[] = $_products_options;
	 $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].",";
	}
	if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') {
	  $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")";
	  $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'");
	  while ($pag_array = tep_db_fetch_array($pag_query)) {
	   $cg_attr_prices[] = $pag_array;
	  }
  
	  // substitute options_values_price and prefix for those for the customer group (if available)
	  if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) {
	   for ($n = 0 ; $n < count($products_options); $n++) {
		for ($i = 0; $i < count($cg_attr_prices) ; $i++) {
		 if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) {
		  $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix'];
		  $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price'];
		 }
		} // end for ($i = 0; $i < count($cg_att_prices) ; $i++)
	   }
	  } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices))
	 } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0')
	 for ($n = 0 ; $n < count($products_options); $n++) {
	  $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']);
	  if ($products_options[$n]['options_values_price'] != '0') {
	   $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	 }
// EOF SPPC attributes mod
		if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {	  
	  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
	} else {
	  $selected_attribute = false;
	}
?>
	  
		
<?php			
$count	  = 1;
$maxPerList = 20;
$total = $products_attributes['total'];
if ($products_options_total['total'] == 1) {
echo "<ul style='float:left;'>"; //Start list
for($i=0;$i<$products_attributes['total'];$i++) {
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name");
  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
   $products_options_array = array();
   $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0");
   $list_of_prdcts_attributes_id = '';
   $products_options = array(); // makes sure this array is empty again
   while ($_products_options = tep_db_fetch_array($products_options_query)) {
	$products_options[] = $_products_options;
	$list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].",";
   }
   if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') {
	$select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")";
	$pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'");
	while ($pag_array = tep_db_fetch_array($pag_query)) {
	 $cg_attr_prices[] = $pag_array;
	}
  
	// substitute options_values_price and prefix for those for the customer group (if available)
	if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) {
	 for ($n = 0 ; $n < count($products_options); $n++) {
	  for ($i = 0; $i < count($cg_attr_prices) ; $i++) {
	   if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) {
		$products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix'];
		$products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price'];
	   }
	  } // end for ($i = 0; $i < count($cg_att_prices) ; $i++)
	 }
	} // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices))
   } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0')
   for ($n = 0 ; $n < count($products_options); $n++) {
	$products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']);
	if ($products_options[$n]['options_values_price'] != '0') {
	 $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	}
   }
 
   if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {	  
	$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
   } else {
	$selected_attribute = false;
   }
		
 
			echo '<li><input type="text" name='.$i.'_quantity value="" style="text-align:right;" size="3">';
			echo tep_draw_hidden_field($i.'_id[' . $products_options_name['products_options_id'] . ']', $products_options_array[$i]['id']) . $products_options_array[$i]['text'];  
			echo "</li>";
		  
	
   if ($count % $maxPerList == 0 && $count != $total) {  //Check if remainder is 0 or if it is the last product
	echo "</ul><ul style='float:left;  padding-left: 10px;'>";   ///Close list and start a new one
   }
   $count++;  
  }
} // End of loop
echo "</ul>"; //Close any left open tag
}
}
	}} else {
	//do your regular thing
  


#5858 ONLINE   14steve14

14steve14
  • Members
  • 3,539 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 20 January 2012 - 17:38

I am struggling to install this module into a new install of oscommerce 2.3.1 with sppc added. The install goes fine until i try to mod the admin/categories file. I have tried 3 times so far and keep getting errors.

Does someone have a working copy of the admin/categories file i can have please.
REMEMBER BACKUP, BACKUP AND BACKUP

Don't take life too seriously. no one gets out alive anyway

#5859   apolyshow

apolyshow
  • Members
  • 244 posts
  • Real Name:Andreas
  • Gender:Male

Posted 23 January 2012 - 08:06

Does anyone has install the SPPC 4.4.2 in a 2.3.1 store that has also the HeaderTags_SEO_V_3.2.7 contribution? How did he solve the problems in product listing and in other files? Don't tell me about winmerge cause i have made it twice and i am getting a problem with the products. Everything seems to be ok in the first page, all the products are there , when you choosing a product from the first page ( Whats new...) all ok, but when i am choosing a product from the categgories then the product it doesn't exists.....I don't have a picture not anything so i am gessing that the problem is in the file of product_listing at least or in the categories. Does anyone has face that?
One amateur made the Arc, 5.000 pro made the Titanic...

#5860 ONLINE   14steve14

14steve14
  • Members
  • 3,539 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 23 January 2012 - 15:18

Someone must have added sppc and quantity price breaks together and have a copy of the admin/categories.php file i could have. This is driving me crazy.. I have spent another day on this and still it does not work correctly.

If no one has a file does someone have any tips on how to combine these to add ons.
REMEMBER BACKUP, BACKUP AND BACKUP

Don't take life too seriously. no one gets out alive anyway