Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mark27uk3

Archived
  • Posts

    1,481
  • Joined

  • Last visited

Everything posted by mark27uk3

  1. Hi Jan, I hope you can help me get my head around this because it is making my head spin. At the moment I am running the PWA contrib which at the moment runs with all groups retail, trade and dropship. What I need is that only retail customers use the Purchase without account and trade and dropship clients have order history which will show up in account.php Also I am planning to create a different create_account page for clients who want to sign up for trade/dropship. Any ideas or advice would be grateful. Also (sorry about this) I use the more_categories contribution and need to exclude certain category boxes from certain groups. I wont post the code now but if you want to have a look at it (again modded to hell) I will post it. Your thoughts would be greatly appreciated as I feel I am making some headway with all of this now. Thanks Mark :thumbsup:
  2. Hi Jan, Thanks, they were two really obvious things (must get my eyes tested) Mark
  3. Hi Jan, Thanks that did the trick! I am now going to try and apply the same to the featured products contribution. I have just noticed that my buy now button does not work correctly when logged in as a group id 1 customer, it is the code from the qty price breaks for sppc. It wont add to cart single or multiple qty's. } elseif ($_SESSION['sppc_customer_group_id'] == '0' || !isset($_SESSION['sppc_customer_group_id'])) { ?> <form name="cart_quantity" method="post" action="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL'); ?>"> <td align="left" class="main"><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submita('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <?php } elseif ($_SESSION['sppc_customer_group_id'] == '1' || !isset($_SESSION['sppc_customer_group_id'])) { ?> <td class="main" align="left"> <table border="0" align="left"> <tr><td align="center" class="main"> <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="3"'); ?> </td></tr> <tr><td align="center"> <?php echo tep_draw_hidden_field('products_id', $product_info_values['products_id']) . tep_image_submita('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </td></tr> </table> </td> <!-- EOF price-break-1.11.3 --> <?php } ?> </tr> And also I use the contrib that allows me to select free shipping on individual products and what I need is theis code modding so that it only shows for retail (group 0) customers. <?php if ($product_info_values['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "true") { echo ('<tr><td align="left" class="smallText"><b>'.FREE_SHIPPING_FOR_THIS_PRODUCT.'</b></td></tr>'); } if ($product_info_values['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "false") { echo ('<tr><td align="left" class="smallText"><b>'.FREE_SHIPPING_FOR_THIS_PRODUCT_FOR_SHOP_COUNTRY.'</b></td></tr>'); } ?> I know I keep monopolising your time but my store is so heavily modded its unbelievable. Any ideas? Thanks Mark
  4. Hi Jan, Sorry to be a PITA! There are no errors now but the product name does not show and also it is displaying products that have been disabled (red dot) as well as enabled (green dot). Thanks Mark
  5. Hi Jan, Thankyou for having a go at it. I had to add this back in front of the query if (isset($current_category_id) && ($current_category_id > 0)) { Is this correct? Also it throws up this error: Any ideas? $default_specials_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' and s.customers_group_id = '" . $customer_group_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); } else { $default_specials_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.customers_group_id = '" . $customer_group_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 order by s.specials_date_added DESC limit ". MAX_DISPLAY_SPECIAL_PRODUCTS); } Thanks Mark
  6. Sorry I missed a couple of bits out of the query. It should read $default_specials_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); } else { $default_specials_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 order by s.specials_date_added DESC limit ". MAX_DISPLAY_SPECIAL_PRODUCTS); } All the rest is unchanged and still shows trade special price in the retail group. Mark
  7. Hi Jan, I eventually got the price breaks to work correctly :D I did away with showing the price breaks in the product listing and put them in the product info instead. Thanks I am now on with changing the default_specials contrib to work with sppc and I am using the new_products module as a guide. The module works fine and throws no errors, it just does not seem to recognise the groups and it displays the trade special price for the retail group. Any chance of double checking the code for me please? if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // BOF Separate Pricing per Customer $default_specials_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); } else { $default_specials_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by s.specials_date_added DESC limit ". MAX_DISPLAY_SPECIAL_PRODUCTS); } // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } if (($no_of_new_products = tep_db_num_rows($default_specials_query)) > 0) { while ($_new_products = tep_db_fetch_array($default_specials_query)) { $default_specials[] = $_new_products; $list_of_prdct_ids[] = $_new_products['products_id']; } } $select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' "; if ($no_of_new_products > 1) { for ($n = 1; $n < count($list_of_prdct_ids); $n++) { $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' "; } } // get all customers_group_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 (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'"); while ($pg_array = tep_db_fetch_array($pg_query)) { $default_specials[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => ''); } for ($x = 0; $x < $no_of_new_products; $x++) { // replace products prices with those from customers_group table if(!empty($default_specials)) { for ($i = 0; $i < count($default_specials); $i++) { if( $default_specials[$x]['products_id'] == $default_specials[$i]['products_id'] ) { $default_specials[$x]['products_price'] = $default_specials[$i]['products_price']; } } } // end if(!empty($default_specials) } // end for ($x = 0; $x < $no_of_products_new; $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 specials where (".$select_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'], 'specials_new_products_price' => $specials_array['specials_new_products_price']); } // replace products_price with the correct specials_new_products_price if(!empty($new_s_prices)) { for ($x = 0; $x < $no_of_new_products; $x++) { for ($i = 0; $i < count($new_s_prices); $i++) { if( $default_specials[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) { $default_specials[$x]['products_price'] = $new_s_prices[$i]['specials_new_products_price']; } } } } // // end if(!empty($new_s_prices) // $info_box_contents = array(); $row = 0; $nextrow = 1; $nextnextrow = 2; $col = 0; $num = 0; // while ($default_specials = tep_db_fetch_array($default_specials_query)) { for ($x = 0; $x < $no_of_new_products; $x++) { $default_specials[$x]['products_name'] = tep_get_products_name($default_specials[$x]['products_id']); $num ++; if ($num == 1) { new contentBoxStoreHeaderM($info_box_contents); } Thanks Again Mark
  8. Hmm I seem to be doing ok on the product listing, everything seems to work as it should. My only problem now is wot the heck do I do with this little beauty case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; /* removed for price break modification if (tep_not_null($listing[$x]['specials_new_products_price'])) { $lc_text = ' <s>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' '; } end removed for price break modification, see next two lines for replacement code */ $pf->parse($listing[$x]); $lc_text = $pf->getPriceStringShort(); break; because I dont use the standard column thing and again my product_listing.php is hacked to hell. This is my code switch ($column_list[$col]) { case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<br><b>' . $listing[$x]['products_name'] . '</b><br>'; } else { $lc_text = '<br><b>' . $listing[$x]['products_name'] . '</b><br>'; } if (tep_not_null($listing[$x]['specials_new_products_price'])) { $lc_text .= '<br><span class="stockStatus">Regular Price ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '<br><font color="#ff0000"><b>Special Offer Price <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> </b></font> <br>'; } else { $lc_text .= '<br><span class="stockStatus">Our Price ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' </b></span> <br>'; } if ($product_info_values['products_quantity'] > '0') { $lc_text .= '<span class="stockStatus">' . $text_stock_header . ' </span><span class="markProductOutOfStock">' . $text_stock . '</span><br>'; } else { $lc_text .= '<span class="stockStatus">' . $text_stock_header . ' </span><span class="markProductOutOfStock">' . $text_stock . '</span><br>'; } //free shipping if ($listing[$x]['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "true") { $lc_text .= '<br><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT . '</b><br>'; } elseif ($listing[$x]['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "false") { $lc_text .= '<br><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT_FOR_SHOP_COUNTRY . '</b><br> '; } if( isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing[$x]['products_description'], '<br><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_buttonb('read_more.gif', IMAGE_BUTTON_READ_MORE) . '</a> <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_buttonb('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>') . '</td></tr></table>'; } else { $lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing[$x]['products_description'], '<br><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image_buttona('read_more.gif', IMAGE_BUTTON_READ_MORE) . '</a> <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_buttonb('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>') . '</td></tr></table>'; } break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<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>'; } else { $lc_text = ' <script language="javascript"><!-- document.write(\'<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing[$x]['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], addslashes($listing[$x]['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>\'); //--></script> <noscript> <a href="' . tep_href_link(DIR_WS_IMAGES . $listing[$x]['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a> </noscript>'; } break; Mark
  9. Does anyone have an example of the way the price breaks for sppc should look in the product_listing as I am finding it a bit hard to integrate without knowing what the outcome should be. Thanks Mark
  10. Hi Nate, Thanks for looking but it was nothing to do with that code, after I went through it again for the umpteenth time I noticed that part of the query was missing from just above the actual input fields DOH! I told you my file was really heavy lol Mark
  11. Hi, ** Quick Note for JanZ ** - Thank you the whats_new file you sorted for me works sweetly! And now onto the main feature! I have added most of the quantity price breaks contrib which is so far outstanding. I am am testing every little change along the way and the first issue I have come across is that when I go to edit a product the retail price breaks are retrieved from the dbase and inserted for editing but the other two groups I have do not get filled with the blocks or prices... I have checked the dbase and the fields are getting filled when inserting but for some reason they do not get pulled out. I have checked my code (which is a seriously heavily modded file) and all seems ok (to me that is). Can anyone just point in the right direction as to which line(s) in the install text retrieve the prices for my wholesale group. Thanks Mark
  12. Hi Jan, Thanks for replying. Unfortunately that code completely wipes out the right colum for the retail customers. Any other thoughts on what could be causing the problem. Thanks Mark
  13. Hi Guys, After beating myself about the head for a while, I finally decided to ask for help (again, I here you say!) I am trying to get my right column to only display certain boxes to certain customer groups. Now the way I have my groups is Retail id = 0 Trade id = 1 So surely this code below should work (in my flawed theory anyway lol) if ($customers_group_id = '0') { include(DIR_WS_BOXES . 'best_sellers.php'); require(DIR_WS_BOXES . 'whats_new.php'); include(DIR_WS_BOXES . 'specials.php'); }else if ($customers_group_id = '1') { include(DIR_WS_BOXES . 'specials.php'); } Any ideas? Thanks Mark
  14. Hi Jack, Ok will wait in anticipation! Thanks Mark
  15. Hi Jack, I was just wondering if you ever managed to get around to doing an update for this contrib. I remember a while ago there were issues with hotbot (which there still are). Also as a word of warning to others, do not use the bug fix from 13 Oct 2005 it is seriously flawed! It returns hugely different results everytime you do a link popularity check. Thanks Mark
  16. Hi Jan, Thanks for the reply! Well what you said has got me completely stumped because I dont understand what actually goes on in the sppc new_products code :blush: I am presuming that this is the only part of my code that I need to alter $random_product = ''; $random_row = tep_rand(0, ($num_rows - 1)); tep_db_data_seek($new_products_query, $random_row); $random_product = tep_db_fetch_array($new_products_query); // see if found already, if not use else skip $found = 0; for ($ii=0; $ii < $pCount; $ii++) { if ($found_products[$ii] == $random_product['products_id']) { $found = 1; break; } } if ($found == 0) { // keep track of found id's $found_products[$pCount] += $random_product['products_id']; $pCount ++; // add to display array $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); because the rest of the code above deals with the amount of products to display. Am I correct in thinking that or am I way off the mark? Mark
  17. Hi Kevin, All contributions are available from the contributions site, if you place your mouse pointer over the 'Community' tab at the top of the page and click contributions you will then be able to do a search for any contribution that you require. This is the direct link to the SPPC contribution page here Mark
  18. Hi, JanZ, Thank you for your thoughts a few posts back, It has really given me something to think about. I have taken the plunge finally and installed the SPPC contrib and I must say it was easier than I thought. My store is heavily modified and I honestly thought I was going to have a nightmare. I have started to run into a couple of problems that I am not sure how to resolve and was wondering if you could take a look at some code for me. I am trying to change the whats_new box of mine which is completely different to the stock one. The different prices will just not show, I know it has something to do with the way I have my queries setup. This is the code <!-- new_products //--> <tr> <td> <TABLE WIDTH=162 BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD COLSPAN=3> <IMG SRC="images/boxes/table_value.gif" WIDTH=162 HEIGHT=18></TD> </TR> <TR> <td> <?php $info_box_contents = array(); if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // start random new products $new_products_query = tep_db_query("select substring(pd.products_description, 1, 300) as products_description, p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and pd.products_description != '' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW); // end random new products } // start random new products // To configure: // // Under Admin - Configuration - Maximum Values // Set the following: // 'Selection of Random New Products' // (MAX_RANDOM_SELECT_NEW) - Sets how many of the most recent new product entries are queried // 'New Products Module' // (MAX_DISPLAY_NEW_PRODUCTS) - Sets how many random new products are displayed on screen // $row = 0; $col = 0; $pCount = 0; $info_box_contents = array(); $found_products = array(); $num_rows = tep_db_num_rows($new_products_query); if (MAX_DISPLAY_NEW_PRODUCTS > MAX_RANDOM_SELECT_NEW) { // don't allow more new products than will be queried $max_new_products = MAX_RANDOM_SELECT_NEW; } else { $max_new_products = 2; } if ($num_rows < $max_new_products) { $max_new_products = $num_rows; } // echo "num_rows: " . $num_rows . " max_new_products " . $max_new_products . "<br>"; if ($num_rows > 0) { while ($pCount < $max_new_products) { // choose a random row $random_product = ''; $random_row = tep_rand(0, ($num_rows - 1)); tep_db_data_seek($new_products_query, $random_row); $random_product = tep_db_fetch_array($new_products_query); // see if found already, if not use else skip $found = 0; for ($ii=0; $ii < $pCount; $ii++) { if ($found_products[$ii] == $random_product['products_id']) { $found = 1; break; } } if ($found == 0) { // keep track of found id's $found_products[$pCount] += $random_product['products_id']; $pCount ++; // add to display array $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); // BOF Separate Pricing Per Customer // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } if ($customer_group_id !='0') { $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $random_product['products_id'] . "' and customers_group_id = '" . $customer_group_id . "'"); if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) { $random_product['products_price'] = $customer_group_price['customers_group_price']; } } // EOF Separate Pricing Per Customer $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</b></a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], WHATSNEW_IMAGE_WIDTH, WHATSNEW_IMAGE_HEIGHT) . '</a><br><span class="whats_new" width="100%">' . tep_flatten_product_description($random_product['products_description'], '</span><br><br><font color="#ff3333">' . TEXT_OUR_PRICE . ' ' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '<br><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $random_product['products_id']) . '">' . tep_image_buttona('read_more.gif', IMAGE_BUTTON_READ_MORE) . '</a> <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $random_product['products_id']) . '">' . tep_image_buttonb('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>') . '<br><br>'); $col ++; if ($col > 0) { $col = 0; $row ++; } } // found } // while pCount } // num_rows // end random new products new contentBoxa($info_box_contents); ?> </TD> </TR> </TABLE> </td> </tr> <!-- new_products_eof //--> If someone would mind helping out then that would be great. Thanks Mark
  19. Hi JanZ, I am finally about to embark on this contrib and I wonder if you would possibly clarify a few things for me before I start. The store I am currently working on uses the Multi-Stores contrib and the way I would like to try and get SPPC to work is probably completely different to the ways other people use it. 1. I would like to be able to use the PWA contribution for retail customers. 2. I would like trade clients to use the default create account system. 3. I would like to be able to add a group for dropshippers where they create an account the same way that the trade clients do with the exception that they will be able to place an order and enter their customers delivery details. Do you think that the SPPC is adaptable enough to be able to do this? Any pointers or advice you could offer me before I start this mammoth task would be greatly appreciated. Also if anyone else has done the same sort of thing I would love to hear from you as well. Thanks Mark
  20. Hi Jared, I managed to get my last post sorted out and the more catagories is now working well with the multistores contrib. I am trying to expand on the idea talked about earlier in the thread about having different color backgrounds for each infobox header. Now I have already done with images on one site but this time I after doing it with the stylesheet. This is what I have so far: if ($i == 0) { $info_box_contents = array(); $info_box_contents[] = array('text' => $infoBox['name']); new infoBoxHeading_red($info_box_contents, true, false); The different background colors showing fine, the problem lies in the infobox name, the code above displays the more categories box number ie 0, 1, 2 etc. What is the correct code for pulling in the box name because I have tried all sorts of things and nothing I do works :blink: Any help you can give would be greatly appreciated. Thanks Mark
  21. Hi Jared, I am trying to add the more categories to a store that uses the multi stores contrib and to be quite honest I am stuck at the first hurdle - the dreaded query This is the query from the multi stores categories box $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES_TO_STORES . " c2s where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and c.categories_id = c2s.categories_id and c2s.stores_id = '" . STORES_ID . "' and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); And this is the query from the more categories file $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id in (".implode(',',$infoBox['categories']).") and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); Every time I try to combine the multi stores part of the query with the more categories query I end up with all sorts of MYSQL errors. Any chance you could help resolve this for me because I find the more categories and invaluable addition to any store with lots a categories. Thanks Mark
  22. Instead of reverting back to original code you only need to remove two bits from the query so this is wot it should look like tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); //rmh M-S_multi-stores edited next line tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_date_of_last_logon, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_account_last_modified, customers_info_stores_id) values ('" . (int)$customer_id . "', now(), '1', now(), now(), '" . STORES_ID . "')"); Mark
  23. Hi Guys, I am trying to implement the categories on main page contrib with the multi stores, the basic install of categories on main page grabs all categories from the dbase and obviously not just the ones that are assigned to the specific store through multi stores. I could really do with a little help as I am quite stuck in figuring this out. I hate posting long pieces of code in a post but I dont see any other way this time. If anyone has any ideas on what I need to do to this code to make it multi stores complient I would really appreciate it. Categories on Main Page code: // error checking on parameters if($item_column_number < 1) { $item_column_number = 1; } if($item_column_number > 9) { $item_column_number = 9; } if($item_title_on_newline) { $item_separator = '<br>'; } else { $item_separator = ' '; } // Preorder tree traversal function preorder($cid, $level, $foo, $cpath) { global $categories_string, $HTTP_GET_VARS; // Display link if ($cid != 0) { for ($i=0; $i<$level; $i++) $categories_string .= ' '; $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath =' . $cpath . $cid) . '">'; // 1.6 Are we on the "path" to selected category? $bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid; // 1.6 If yes, use <b> if ($bold) $categories_string .= '<b>'; $categories_string .= $foo[$cid]['name']; if ($bold) $categories_string .= '</b>'; $categories_string .= '</a>'; // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false if (SHOW_COUNTS == 'false') { $products_in_category = tep_count_products_in_category($cid); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '<br>'; } // Traverse category tree if (is_array($foo)) { foreach ($foo as $key => $value) { if ($foo[$key]['parent'] == $cid) { preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : '')); } } } } ?> <!-- main_categories //--> <tr> <td> <?php ////////// // Display box heading ////////// $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES); //new infoBoxHeading($info_box_contents, false, false); ////////// // Get categories list ////////// // 1.2 Test for presence of status field for compatibility with older versions $status = tep_db_num_rows(tep_db_query('describe categories status')); $query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id"; // 1.3 Can't have 'where' in an if statement! if ($status >0) $query.= " and c.status = '1'"; $query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"; $categories_query = tep_db_query($query); // Initiate tree traverse $categories_string = ''; preorder(0, 0, $foo, ''); ////////// // Display box contents ////////// $info_box_contents = array(); $row = 0; $col = 0; while ($categories = tep_db_fetch_array($categories_query)) { if ($categories['parent_id'] == 0) { $cPath_new = tep_get_path($categories['categories_id']); /*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" $text_subcategories = ''; $subcategories_query = tep_db_query($query); while ($subcategories = tep_db_fetch_array($subcategories_query))*/ { if ($subcategories['parent_id'] == $categories['categories_id']) { $cPath_new_sub = "cPath=" . $categories['categories_id']/*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" . "_" . $subcategories['categories_id']*/; $text_subcategories .= '? <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">'; $text_subcategories .= $subcategories['categories_name'] . '</a>' . " "; } // if ($subcategories['parent_id'] == $categories['categories_id']) } // while ($subcategories = tep_db_fetch_array($subcategories_query)) if ($hover == 'on') { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'class="smallText" style="border:' . $borderwidth . 'px solid ' . $regborder . '" onMouseOver="window.status=\'' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '\'; this.style.backgroundColor=\'' . $hovercolor . '\'; this.style.cursor=\'hand\'; this.style.border=\'' . $borderwidth . 'px solid ' . $hoverborder . '\';" onMouseOut="window.status=\'\'; this.style.backgroundColor=\'' . $regcolor . '\'; this.style.border=\'' . $borderwidth . 'px solid ' . $regborder . '\';" onclick="location.href=\'' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '\'" width="'.intval(100/$item_column_number).'%" valign="' . $valign . '"', 'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>' . $item_separator . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $categories['categories_name'] . '</a><DIV ' . $item_subcategories_options . '>' . $text_subcategories . $spacing . '</DIV></DIV>'); } else { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'class="smallText" width="'.intval(100/$item_column_number).'%" valign="' . $valign . '"', 'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>' . $item_separator . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $categories['categories_name'] . '</a><DIV ' . $item_subcategories_options . '>' . $text_subcategories . '</DIV></DIV>'); } // determine the column position to see if we need to go to a new row $col ++; if ($col > ($item_column_number - 1)) { :blink: $col = 0; $row ++; } //if ($col > ($number_of_columns - 1)) } //if ($categories['parent_id'] == 0) } // while ($categories = tep_db_fetch_array($categories_query)) //output the contents new contentBox($info_box_contents); Thanks Mark
  24. Ok, I got it. Find function html_content() { //create HTML string containing links & pics define('COLS', 1); $width = intval(0/COLS); and change it to function html_content() { //create HTML string containing links & pics define('COLS', 1); $width = intval(0/COLS); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); This will sort out the undefined function error. Mark
  25. Hi Scott, Sorry to be such a pain the butt with such a relatively simple thing but I still get Fatal error: Call to a member function on a non-object when adding what you said above. Mark
×
×
  • Create New...