Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

screenprintdude

Archived
  • Posts

    22
  • Joined

  • Last visited

Profile Information

screenprintdude's Achievements

  1. I've noticed that even if a customer from a discounted group logs in, the main product listing still shows the retail price until the customer clicks on an actual product where thier discount price is correct. How can I make the product listings level pricing the same as the individual product level pricing for the discounted group? For example, I have a product with a regular retail price of $5.75. Customer X logs in an their price is $4.50. The main category listing reflects $5.75 and then when you click on the product, the product listing shows $4.50. If a specific group price has been set for a custom, I want the catalog to ALWAYS display the correct price. IF a group price has net been set for that customer then I want the catalog to default to the retail. Can some one tell me what they need to look at or what I need to change? Thank you :huh:
  2. Hi, I've been reviewing the code for Hide Products and Groups for SPPC. How hard would it be to implement the EXACT same principle for the Extra Images Contribution http://addons.oscommerce.com/info/1032 I have several instance where it is more useful (and less work) to have a product photo that I can change based on the customers' log-in information than setting up entire new products and/or categories. My entire business works on selling products with the same model numbers but customized to the end buyer. I am trying to get this to work and while I understand the code (and want to reuse as much as possible) I don't know that I can. . . Any one want to take a gander and see if we can collaborate? Thanks
  3. Okay . . . With that, I have found a missing line in my code from your example. . . I have seen code done both ways like you said it should be okay. However, I encountered the same issue with the same schema on another contribution tonight while working. // BOF QPBPP for SPPC $products_query = tep_db_query("select cb.products_id, ptdc.discount_categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb left join (select products_id, discount_categories_id from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where customers_group_id = '" . $this->cg_id . "') as ptdc on cb.products_id = ptdc.products_id where customers_id = '" . (int)$customer_id . "'"); while ($products = tep_db_fetch_array($products_query)) { $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']); // EOF QPBPP for SPPC $temp_post_get_array[] = $_products['products_id']; $products[] = $_products; $no_of_products_in_basket += 1; } if ($no_of_products_in_basket > 0) { $hide_status_products = array(); $hide_status_products = tep_get_hide_status($hide_status_products, $this->cg_id, $temp_post_get_array); for ($i=0; $i < $no_of_products_in_basket; $i++) { foreach($hide_status_products as $key => $subarray) { if ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '0') { // not hidden for this customer, can be added to the object shoppingCart $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']); // attributes $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; } }elseif ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '1') { // product is hidden for the customer, don't add to object shoppingCart, delete from db next $products_to_delete_from_cb[] = $products[$i]['products_id']; } // end if/elseif }// end foreach ($hide_status_products as $key => $subarray) } // end for ($i=0; $i < $no_of_products_in_basket; $i++) I did notice that I am missing the following line >>> $no_of_products_in_basket = 0; Will that cause a problem? Should I put it in even since I am not getting the error now? Also, since I am consistintly running into this with the opening/closing of the SQL statements, do you think it could have something to do with the way GoDaddy has set up thier hosting?
  4. Just in case this comes up >>> I had a small typo. Be sure to pay close attention to your opening and closing parenthisi - I found it almost immediatly following my post when I cut and Pasted the lines into the BBS - Be sure to step back and use another editor or change the font to give yor eyes something to look at - - From p.products_id in (" . $list_of_products_ids . ")"); To p.products_id in ('" . $list_of_products_ids . "')"); :rolleyes:
  5. Can some one take a look at this and identifiy the problem? Here is what happens / Customer is not logged in but has a saved cart from a previous session. This customer is part of an SPPC group. The customer has Product Options and Products Hidden from them as well as certain products that are only shown to them. When they log in, the following error get generated:::: Warning: implode(): Bad arguments. in /home/content/j/e/t/jetcousa/html/includes/functions/general.php on line 1450 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 [b](I've marked the line nembers below as they appear in my editor)[/b] select p.products_id, find_in_set('1', products_hide_from_groups) as hide_or_not, find_in_set('1', categories_hide_from_groups) as in_hidden_category from products p left join products_to_categories p2c using(products_id) left join categories c using(categories_id) where p.products_id in () [TEP STOP] Here is the section that this error references from my Functions General::: function tep_get_hide_status($hide_status_products, $customer_group_id, $temp_post_get_array) { foreach ($temp_post_get_array as $key => $value) { $int_products_id = tep_get_prid($value); // the November 13 updated MS2.2 function tep_get_prid // can return false with an invalid products_id if ($int_products_id != false ) { $int_products_id_array[] = $int_products_id; } $list_of_products_ids = implode(',', $int_products_id_array); // <<<<<This is Line 1450 } // end foreach ($temp_post_get_array as $key => $value) $hide_query = tep_db_query("select p.products_id, find_in_set('".$customer_group_id."', products_hide_from_groups) as hide_or_not, find_in_set('".$customer_group_id."', categories_hide_from_groups) as in_hidden_category from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id in (" . $list_of_products_ids . ")"); // <<<<< This is the offending query. // since a product can be in more than one category (linked products) we have to check for the // possibility of more than one row returned for each products_id where "hide_or_not" // is the same for every row, but "in_hidden_category" can be different I think I already have figured out that [[[ where p.products_id in () ]]] is the offending portion of my syntax error, but for the life of me I cannot figure out what I have ommitted. As long as the shopping cart is empty when the customer logs in, no error gets generated. Can some one help me out?? Thank you. . .
  6. Please Disregard. . . I found and answered my own question in the SPPC contribution. :rolleyes:
  7. <!-- BOF Separate Pricing Per Customer - QPBPP for SPPC - in tabbed menu --> <tr> <td colspan="2"> <div id="qpbpp" class="cgtabs"> <ul class="tabnav"> <?php foreach ($_hide_customers_group as $key => $cust_groups) { echo ' <li><a href="#pricebreak-' . $cust_groups['customers_group_id'] . '">' . $cust_groups['customers_group_name'] . '</a></li>' ."\n"; } ?> </ul> <?php foreach ($_hide_customers_group as $key => $cust_groups) { $CustGroupID = $cust_groups['customers_group_id']; ?> <div id="pricebreak-<?php echo $languages[$i]['id']; ?>" class="tabdiv"> <table border="0" width="100%"> <tr bgcolor="#ebebff"> <td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_NAME ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $cust_groups['customers_group_name']; ?></td> </tr> <tr bgcolor="#fffff"> <td class="main" colspan="2"><small><i><?php if ($CustGroupID != 0) echo TEXT_CUSTOMERS_GROUPS_NOTE; ?></i></small></td> </tr> <tr bgcolor="#fffff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET ?></td> <td class="main"><?php if ($CustGroupID != 0) { if (isset($pInfo->sppcoption)) { echo tep_draw_checkbox_field('sppcoption[' . $CustGroupID . ']', 'sppcoption[' . $CustGroupID . ']', (isset($pInfo->sppcoption[$CustGroupID])) ? 1: 0); } else { echo tep_draw_checkbox_field('sppcoption[' . $CustGroupID . ']', 'sppcoption[' . $CustGroupID . ']', true); } if (isset($pInfo->sppcprice[$CustGroupID])) { $sppc_cg_price = $pInfo->sppcprice[$CustGroupID]; } else { // nothing in the db, nothing in the post variables $sppc_cg_price = ''; } echo ' ' . tep_draw_input_field('sppcprice[' . $CustGroupID . ']', $sppc_cg_price ); } else { echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_retail_net', $pInfo->products_price, 'readonly'); } // end if/else ($CustGroupID != 0) ?> </td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_DISCOUNT_CATEGORY ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('discount_categories_id[' . $CustGroupID . ']', $discount_categories_array, $pInfo->discount_categories_id[$CustGroupID]) . tep_draw_hidden_field('current_discount_cat_id[' . $CustGroupID . ']', (isset($pInfo->current_discount_cat_id[$CustGroupID]) ? (int)$pInfo->current_discount_cat_id[$CustGroupID] : $pInfo->discount_categories_id[$CustGroupID])); ?></td> </tr> <tr bgcolor="#ffffff"> <td class="main"><?php echo TEXT_PRODUCTS_QTY_BLOCKS; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_qty_blocks[' . $CustGroupID . ']', $pInfo->products_qty_blocks[$CustGroupID], 'size="10"') . " " . TEXT_PRODUCTS_QTY_BLOCKS_HELP; ?></td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_MIN_ORDER_QTY; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_min_order_qty[' . $CustGroupID . ']', $pInfo->products_min_order_qty[$CustGroupID], 'size="10"') . " " . TEXT_PRODUCTS_MIN_ORDER_QTY_HELP; ?></td> </tr> <?php $i = 0; // for alternate coloring of rows (zebra striping) for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) { $bgcolor = ($i++ & 1) ? '#ebebff' : '#ffffff'; // for zebra striping ?> <tr bgcolor="<?php echo $bgcolor; ?>"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE . " " . ($count + 1); ?></td> <td class="main" align="left"> <?php if(is_array($pInfo->products_price_break[$CustGroupID]) && array_key_exists($count, $pInfo->products_price_break[$CustGroupID])) { echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_break[' . $CustGroupID .'][' . $count . ']', $pInfo->products_price_break[$CustGroupID][$count], 'size="10"'); echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY; echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty[' . $CustGroupID .'][' . $count . ']', $pInfo->products_qty[$CustGroupID][$count], 'size="10"'); echo tep_draw_hidden_field('products_price_break_id[' . $CustGroupID .'][' . $count . ']', $pInfo->products_price_break_id[$CustGroupID][$count]); // only show a delete box for a price break that has been set (needed for when the // back button is used after a preview if (isset($pInfo->products_price_break_id[$CustGroupID][$count]) && tep_not_null($pInfo->products_price_break_id[$CustGroupID][$count])) { echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete[' . $CustGroupID .'][' . $count . ']', 'y', (isset($pInfo->products_delete[$CustGroupID][$count]) ? 1 : 0)) . TEXT_PRODUCTS_DELETE; } } else { echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_break[' . $CustGroupID .'][' . $count . ']', '', 'size="10"'); echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY; echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty[' . $CustGroupID .'][' . $count . ']', '', 'size="10"'); } ?> </td> </tr> <?php } // end for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) ?> </table> </div> <?php } // end foreach ($_hide_customers_group as $key => $cust_groups) ?> </div> </td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <!-- EOF Separate Pricing Per Customer - QPBPP for SPPC - in tabbed menu --> ================================================================================ ===== How can I take the idea of the Tabs and use them for my Product Description Language Fields <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td> <td><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> <!-- <td class="main"><?php // echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td> --> <td class="main"><?php echo tep_draw_fckeditor('products_description[' . $languages[$i]['id'] . ']','600','300',(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> <?php } ?> This would save so much space on the page and make life easier for the end user. I understand how the code works, but I'm not having any luck on making it work for me on the product descriptions. . . Please note that I have FCK editor installed. . .
  8. I recently installed the contribution as listed above located at http://www.oscommerce.com/community/contributions,3059 When all was said and done, I had a few errors that got corrected, but my layout is not quite right. Some things are backwards and the placement is off. . . PLEASE can someone help? I've included links to the code and page view below. . . so you can see all the code for the admin/categories.php file and the results. Thanks Dan Page View MHT file, right click and save as, then open in IExplorer. Will not view in Firefox PHPT file is the full PHP code in the admin/categories.php location causing the funny results. http://www.jetcousa.com/oscommercehelp/ Please feel free to edit and email the results or tell me what to do. . . I just can't figure it out. Thanks
×
×
  • Create New...