JBS7 Posted April 17, 2008 Share Posted April 17, 2008 To sort the results of a query - you have to go into the script for the page you are working on and at the end of the query add ORDER BY and then whatever criteria you want to order that query by (needs to be something in the query). So lets say you are getting just the products attributes id - your query would look something like this: $attributes_query = "select products_attributes_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " ORDER BY products_attributes_id DESC;" You do want to have any of your "WHERE" statements in the query before the ORDER BY statement though. Hope that helps! Hello Tracy, Thanks very much for your help. I did not try your solution although I confident that it would work out. I went for Product Attributes Sort Order v1.0 because it allows the admin to sort attributes by ID by manually entering the sort order. Thanks for helping. :) I think (but I have never used it or looked at it) that there is a contribution for this. Product Attributes Sort Order v1.0 I think is the one I have seen mentioned more than a few times. Don't know if there are similar ones, or better ones. Hello Jan, Thanks for your reply and the contrib link. I installed Product Attributes Sort Order v1.0 and everything works fine with SPPC, SPPC Attributes and QPBSPPC. I had to merge files (product_attributes.php) and do things carefully since the readme.txt didn't come with any information regarding to product_attributes.php. My product_attributes.php was already modified with SPPC Attributes Mod. Many thanks for helping. :) JBS Quote Link to comment Share on other sites More sharing options...
CGhoST Posted April 17, 2008 Share Posted April 17, 2008 Hmm .. sorry i am not sure what you mean when you say "Perhaps you overlooked the change of directory (they also changed name)". What i did was copy everything from catalog directory in new installations folder to my server and ran the sppc_v421_install.sql in phpmyadmin. I am using your updated contribution. Have i missed something or just not seeing it? Sorry i got it now. but there is a change that should be done. It states to do this: echo tep_image_button('ic_up.gif' -> tep_image(DIR_WS_IMAGES . 'icon_up.gif' echo tep_image_button('ic_down.gif' -> tep_image(DIR_WS_IMAGES . 'icon_down.gif' But it should be stated to say this: echo tep_image_button('ic_up.gif' -> echo tep_image(DIR_WS_IMAGES . 'icon_up.gif' echo tep_image_button('ic_down.gif' -> echo tep_image(DIR_WS_IMAGES . 'icon_down.gif' For novices like me wanted to let anyone else know that might be having a problem or not seeing these sort arrows at all. Great contrib J.Z. Quote Link to comment Share on other sites More sharing options...
JBS7 Posted April 17, 2008 Share Posted April 17, 2008 Hello friends! I am back again. My SPPC works fine. I have been trying to figure out how to add a drop down menu on create_account.php page whereby a new customer can select whether he/she want to register as Retailer or Wholesaler. Depending on his/her selection, the system will automatically add the account to the specified Customers Group (Retailer or Wholesaler). No more need of sending an email to admin requesting to be added to a certain Customers Group. I think this way of doing things will be straight, more practical and it’s a good timesaving tip. Some Customers would rather prefer creating their account and buying right away than creating an account knowing that they have to wait for at least 24h or more for the admin to add them into the appropriate Group. I scanned the forum and I couldn’t find any topic related to this question. Is there such a mod? Or how can it do it on create_account.php page? Thanks very much in advance. JBS7 Quote Link to comment Share on other sites More sharing options...
insaini Posted April 17, 2008 Share Posted April 17, 2008 Hello friends! I am back again. My SPPC works fine. I have been trying to figure out how to add a drop down menu on create_account.php page whereby a new customer can select whether he/she want to register as Retailer or Wholesaler. Depending on his/her selection, the system will automatically add the account to the specified Customers Group (Retailer or Wholesaler). No more need of sending an email to admin requesting to be added to a certain Customers Group. I think this way of doing things will be straight, more practical and it’s a good timesaving tip. Some Customers would rather prefer creating their account and buying right away than creating an account knowing that they have to wait for at least 24h or more for the admin to add them into the appropriate Group. I scanned the forum and I couldn’t find any topic related to this question. Is there such a mod? Or how can it do it on create_account.php page? Thanks very much in advance. JBS7 Allowing a customer to choose their group is not more practical.. it is time saving however it is problematic.. wholesale purchasers generally are exempt from certain taxes.. i suppose it also depends on where you are.. it also allows regular customers to register as a certain group and see pricing of that particular group.. it is better that a company that wishes to purchase wholesale contact you directly and then you can set them up under a wholesale account.. they will get pricing and even if they have to wait a day its a better way of handling things.. although IMO.. you can setup your store as you like.. you will however have to create a drop down with the available groups you want allowed to be chosen.. and then when the customer is being added you have to add that information to the insert code.. Quote Link to comment Share on other sites More sharing options...
nikikelly Posted April 17, 2008 Share Posted April 17, 2008 I was hoping someone else had the same issue I'm having - thought I saw mention of it somewhere. I installed the SPPC 4.2.1a contribution and then installed the "Hide Products & Categories by Group for SPPC" contribution. Pricing on product and attributes is fine throughout the process until I get to the shopping cart, at which point the total is the sum of the retail price. Here is the code on the preceding page (product_info.php)....can anyone see why the group price is not being calculated the right way? <?php /* $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4.2 2007/06/23 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); // BOF Separate Pricing per Customer 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'; $customer_group_id = $HTTP_GET_VARS['gID']; } // EOF Separate Pricing per Customer ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { // 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 = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <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 $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php // 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) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $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 (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; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 17, 2008 Share Posted April 17, 2008 I was hoping someone else had the same issue I'm having - thought I saw mention of it somewhere. I installed the SPPC 4.2.1a contribution and then installed the "Hide Products & Categories by Group for SPPC" contribution. Pricing on product and attributes is fine throughout the process until I get to the shopping cart, at which point the total is the sum of the retail price. Here is the code on the preceding page (product_info.php)....can anyone see why the group price is not being calculated the right way? The page shopping_cart.php gets it's prices from /includes/classes/shopping_cart.php and it involves the functions get_products.php and attributes_prices. I hope you added "Hide Products & Categories by Group for SPPC" manually because it is a lot older than RC2a. It needs updating. So you can't use the pre-modified files. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 17, 2008 Share Posted April 17, 2008 I actually already did modify the create_account.php page to pass a hidden $customer_group_id based on the group the user is entering the store through. So, from these "group" entry points, I'll be linking to the index page and passing a group ID (gID). Here is the code I changed in index.php: // BOF Separate Pricing Per Customer global $sppc_customer_group_id; if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = $HTTP_GET_VARS['gID']; } else { $customer_group_id = $sppc_customer_group_id; } // EOF Separate Pricing Per Customer .... wondering if you could help me see why once I click on the category from the index page, I lose the $customer_group_id setting and it falls back to the default of 0. Well, that is obvious because only the first time gID is received on index.php and not passed on through a get variable or a session variable (the best option) for use on a next page this way. The webserver doesn't know about gID on the next page unless you store it in a session variable right away. Then on create_account.php you can transfer that to the database as customer group id and it will be kept on this visit and later visits. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 17, 2008 Share Posted April 17, 2008 Sorry i got it now. but there is a change that should be done. It states to do this: echo tep_image_button('ic_up.gif' -> tep_image(DIR_WS_IMAGES . 'icon_up.gif' echo tep_image_button('ic_down.gif' -> tep_image(DIR_WS_IMAGES . 'icon_down.gif' But it should be stated to say this: echo tep_image_button('ic_up.gif' -> echo tep_image(DIR_WS_IMAGES . 'icon_up.gif' echo tep_image_button('ic_down.gif' -> echo tep_image(DIR_WS_IMAGES . 'icon_down.gif' For novices like me wanted to let anyone else know that might be having a problem or not seeing these sort arrows at all. OK, got it now. I must have used an already partially changed file for the "replace this with that" because in the previous version it was e.g.: echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_ACCOUNT_CREATED . ' --> 3-2-1 From Top ') and I wrote in the replace part it was: echo tep_image(DIR_WS_IMAGES . 'ic_down.gif', ' Sort ' . TABLE_HEADING_CUSTOMERS_GROUPS . ' --> Z-X-Y From Top ') But that is already partially new code (in the new code: ic_down.gif -> icon_down.gif). Sorry :blush: Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 17, 2008 Share Posted April 17, 2008 Allowing a customer to choose their group is not more practical.. it is time saving however it is problematic.. wholesale purchasers generally are exempt from certain taxes.. i suppose it also depends on where you are.. it also allows regular customers to register as a certain group and see pricing of that particular group.. it is better that a company that wishes to purchase wholesale contact you directly and then you can set them up under a wholesale account.. they will get pricing and even if they have to wait a day its a better way of handling things.. although IMO.. you can setup your store as you like.. you will however have to create a drop down with the available groups you want allowed to be chosen.. and then when the customer is being added you have to add that information to the insert code.. Absolutely right. Actually, when the new customer puts in a tax_id number the RA flag is raised in the admin and you get an email alarming you that a new customer with a tax_id has registered. So this was already anticipated (by Marvin Miller to be honest). Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 17, 2008 Share Posted April 17, 2008 I've searched the forum but I guess I'm not understanding or there isn't a clear answer on how to fix this error:1109 - Unknown table 'pd' in where clause select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%bra%' or p.products_model like '%bra%' or m. manufacturers_name like '%bra%' or pd.products_description like '%bra%') ) [TEP STOP] You're obviously missing a piece in the from clause: from products p left join manufacturers m using(manufacturers_id) because there is no mention of a join or left join to products_description pd. That is what MySQL is complaining about. Quote Link to comment Share on other sites More sharing options...
nikikelly Posted April 17, 2008 Share Posted April 17, 2008 (edited) The page shopping_cart.php gets it's prices from /includes/classes/shopping_cart.php and it involves the functions get_products.php and attributes_prices.I hope you added "Hide Products & Categories by Group for SPPC" manually because it is a lot older than RC2a. It needs updating. So you can't use the pre-modified files. No - sadly, I didn't see the manual instructions and just installed RC2 then SPPC4.2.1a then Hide Products & Categories.....of course then I continued to customize my installation so now if I go back and do it the way you're suggesting, I'll lose a day's work. Which I guess is what I need to do but I don't even see the manual instructions on that contribution....any advice? Edited April 17, 2008 by nikikelly Quote Link to comment Share on other sites More sharing options...
bizcribz Posted April 18, 2008 Share Posted April 18, 2008 You're obviously missing a piece in the from clause: from products p left join manufacturers m using(manufacturers_id) because there is no mention of a join or left join to products_description pd. That is what MySQL is complaining about. How do I fix that? Quote Link to comment Share on other sites More sharing options...
bizcribz Posted April 18, 2008 Share Posted April 18, 2008 I have installed SPPC and whenever I choose a category or manufacturer from the left side I get one item listed more than once and each new page is one new item but with several buttons. Here's the link to see what I'm talking about: http://www.thebraspecialist.com/online_store. I'm not sure where to look for the error. Quote Link to comment Share on other sites More sharing options...
JBS7 Posted April 18, 2008 Share Posted April 18, 2008 Allowing a customer to choose their group is not more practical.. it is time saving however it is problematic.. wholesale purchasers generally are exempt from certain taxes.. i suppose it also depends on where you are.. it also allows regular customers to register as a certain group and see pricing of that particular group.. it is better that a company that wishes to purchase wholesale contact you directly and then you can set them up under a wholesale account.. they will get pricing and even if they have to wait a day its a better way of handling things.. although IMO.. you can setup your store as you like.. you will however have to create a drop down with the available groups you want allowed to be chosen.. and then when the customer is being added you have to add that information to the insert code.. Hello Insaini, Thx for your reply. I ended up concluding the same. Yep, you are right. I will just leave the site the way it is. :) Absolutely right. Actually, when the new customer puts in a tax_id number the RA flag is raised in the admin and you get an email alarming you that a new customer with a tax_id has registered. So this was already anticipated (by Marvin Miller to be honest). Hello Jan, Thx for the details on RA flag. JBS7 Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 18, 2008 Share Posted April 18, 2008 I have installed SPPC and whenever I choose a category or manufacturer from the left side I get one item listed more than once and each new page is one new item but with several buttons. Here's the link to see what I'm talking about: ..... I'm not sure where to look for the error. Your product listing module (include/modules/product_listing) is not the regular one. No problem, but the "old" one was built in the while loop of getting the results from the query but SPPC needs to get the product id's is so gets these first in that while loop. Then later a "for loop" is used so you need to change every instance of $listing['field'] to $listing[$x]['field']. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 18, 2008 Share Posted April 18, 2008 I don't even see the manual instructions on that contribution.... There should be a file called install_hide_prods_and_cats_for_cg_sppc.txt in the package. Quote Link to comment Share on other sites More sharing options...
nikikelly Posted April 18, 2008 Share Posted April 18, 2008 There should be a file called install_hide_prods_and_cats_for_cg_sppc.txt in the package. Oh boy! That's really not very pretty. Especially compared to your SPPC manual install instructions. I'm scared! Quote Link to comment Share on other sites More sharing options...
Dafko Posted April 18, 2008 Share Posted April 18, 2008 Hello again, finally I was able to install SPPC into my eshop. It's working like a charm. Just one (huge) hitch, after I create an another group (wholesale) of customers and I was trying to change customer from retail to wholesale after clicking submit button, nothing happen. The page just reloaded, few boxes were missing and that was all :-/ When I log in to the database and manually change customer from 0 to 1 it was working. Please anyone with similar problem? I doublechecked every SPPC installation file which replaces originals in admin section. Thank you, I appreciate your help. Dafko :blush: Quote Link to comment Share on other sites More sharing options...
bizcribz Posted April 18, 2008 Share Posted April 18, 2008 Your product listing module (include/modules/product_listing) is not the regular one. No problem, but the "old" one was built in the while loop of getting the results from the query but SPPC needs to get the product id's is so gets these first in that while loop. Then later a "for loop" is used so you need to change every instance of $listing['field'] to $listing[$x]['field']. I did this but then all i saw was a few blank boxes with no information, but showing $0. Any other suggestions? Quote Link to comment Share on other sites More sharing options...
Hajö Posted April 19, 2008 Share Posted April 19, 2008 Hallo, at first i want to say sorry for my bad english! I have a big problem. SPPC works great within all files (manually installation, but I am not able to add the changes to the files: product_info.php products_new.php specials.php My osCommerce custom templates, which have big changes to these files, i think. Is anibody able to make the changes to my files which are need to work? Hope you can help me!!! I put a zip-file with these files here: http://www.fiat-individual.de/files.zip So i hope it is possible to help me. Greets Hajö :) Quote Link to comment Share on other sites More sharing options...
Hajö Posted April 21, 2008 Share Posted April 21, 2008 Hallo, is nobody able to help me? If anybody will do this against payment, let us talk about that! I need it, and if i could get this help with some money, i will pay for it. Payment via PayPal will be the best way i think. It's necessary for my shop, so i hope i'll get help! Greets Hajö :) Quote Link to comment Share on other sites More sharing options...
nikikelly Posted April 21, 2008 Share Posted April 21, 2008 Oh boy! That's really not very pretty. Especially compared to your SPPC manual install instructions. I'm scared! I'd like to eat my words....this was not scary at all once I opened the text file in word....installation instructions were great! Thanks Jan! One thing I noticed with the "Hide Products" changes....should all instances of the following: if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } be replaced now with: 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'; } Thanks so much for all of your amazing contributions and the support that you continue to provide! Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 21, 2008 Share Posted April 21, 2008 One thing I noticed with the "Hide Products" changes....should all instances of the following: if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } be replaced now with: 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 it works, it works but using the $_SESSION variables is more fail-safe. That is why I changed it (eventually you will probably have to use $_SESSION one day so better now). Quote Link to comment Share on other sites More sharing options...
Hajö Posted April 21, 2008 Share Posted April 21, 2008 Hallo, is nobody able to help me? If anybody will do this against payment, let us talk about that! I need it, and if i could get this help with some money, i will pay for it. Payment via PayPal will be the best way i think. It's necessary for my shop, so i hope i'll get help! Greets Hajö :) No longer needed! Thank you. Quote Link to comment Share on other sites More sharing options...
nikikelly Posted April 21, 2008 Share Posted April 21, 2008 (edited) I'm hoping someone can help me see the error of my ways. Let's say that I want to use this contribution but I don't need it to be as locked down as it is. So, I'd like to be able to get to the index page and set the customer_group_id there as the entry to the store. So, I'd be passing the customer_group_id via the URL and setting the session variable on that page to be carried throughout. Isn't it as simple as adding a line to index.php $_SESSION['sppc_customer_group_id'] = $HTTP_GET_VARS['gID']; where the URL is http://www.storeURL.com/index.php?gID=1 for customer group 1 http://www.storeURL.com/index.php?gID=2 for customer group 2 Forgive me for my ignorance! Any help is MUCH appreciated! Edited April 21, 2008 by nikikelly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.