Jump to content
Latest News: (loading..)

hostyork

Members
  • Content count

    23
  • Joined

  • Last visited

Profile Information

  • Real Name
    Andrew
  • Gender
    Male
  1. hostyork

    Featured Product Support v1.5.4

    I am trying to alter the box style too or go one even better and revert back to my original template monster front page template which originally showed new products in a formatting I liked. Featured Products v1.6.5_1 is a great mod but it's somewhat knocked my template out a bit. There are 2 files. /modules/featured.php /modules/new_products.php I'm wondering if it is possible for me to use the new_products.php formatting but call in featured products in it instead of new. It's full of code and I don't have a cat in hells chance of doing it. Could anyone help me? There is a reward. <?php /* $Id: featured.php,v 1.7 2008/08/22 22:30:20 aa0001 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Featured Products V1.1 Displays a list of featured products, selected from admin For use as an Infobox instead of the "New Products" Infobox */ ?> <!-- featured_products //--> <?php if( defined('FEATURED_PRODUCTS_DISPLAY') AND FEATURED_PRODUCTS_DISPLAY == 'true' ) { $featured_products_category_id = (isset($new_products_category_id))?$new_products_category_id:'0'; $cat_name_query = tep_db_query('SELECT `categories_name` FROM ' . TABLE_CATEGORIES_DESCRIPTION . " WHERE `categories_id` = '" . $featured_products_category_id . "' limit 1"); $cat_name_fetch = tep_db_fetch_array($cat_name_query); $cat_name = $cat_name_fetch['categories_name']; $info_box_contents = array(); list($usec, $sec) = explode(' ', microtime()); srand( (float) $sec + ((float) $usec * 100000) ); $mtm= rand(); if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); // Phocea Optimize featured query // Ben: Option to only show featured products on sale $query = 'SELECT p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name '; if ( defined('FEATURED_PRODUCTS_SPECIALS_ONLY') AND FEATURED_PRODUCTS_SPECIALS_ONLY == 'true' ) { $query .= 'FROM ' . TABLE_SPECIALS . ' s LEFT JOIN ' . TABLE_PRODUCTS . ' p ON s.products_id = p.products_id '; } else { $query .= 'FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id '; } $query .= 'LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' LEFT JOIN " . TABLE_FEATURED . " f ON p.products_id = f.products_id WHERE p.products_status = '1' AND f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS; $featured_products_query = tep_db_query( $query ); } else { $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name)); $subcategories_array = array(); tep_get_subcategories($subcategories_array, $featured_products_category_id); $featured_products_category_id_list = tep_array_values_to_string($subcategories_array); if ($featured_products_category_id_list == '') { $featured_products_category_id_list .= $featured_products_category_id; } else { $featured_products_category_id_list .= ',' . $featured_products_category_id; } if ( defined('FEATURED_PRODUCTS_SUB_CATEGORIES') AND FEATURED_PRODUCTS_SUB_CATEGORIES == 'true' ) { // current catID as starting value $cats[] = $new_products_category_id; // put cat-IDs of all cats nested in current branch into $cats array, // go through all subbranches for($i=0; $i<count($cats); $i++) { $categorie_query = tep_db_query('SELECT `categories_id` FROM ' . TABLE_CATEGORIES . " WHERE parent_id = '" . (int)$cats[$i] . "'"); while ($categorie = tep_db_fetch_array($categorie_query)) { $cats[] = $categorie['categories_id']; } // sort out doubles $cats = array_unique($cats); } $catIdSql = implode(', ', $cats); } else { $catIdSql = $featured_products_category_id_list; } // Phocea Optimize featured query $query = 'SELECT distinct p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name FROM ' . TABLE_PRODUCTS . ' p LEFT JOIN ' . TABLE_PRODUCTS_TO_CATEGORIES . ' p2c using(products_id) LEFT JOIN ' . TABLE_CATEGORIES . ' c USING (categories_id) LEFT JOIN ' . TABLE_FEATURED . ' f ON p.products_id = f.products_id LEFT JOIN ' . TABLE_SPECIALS . ' s ON p.products_id = s.products_id LEFT JOIN ' . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '" . $languages_id . "' where c.categories_id IN(" . $catIdSql . ") AND p.products_status = '1' AND f.status = '1' "; if ( defined('FEATURED_PRODUCTS_SPECIALS_ONLY') AND FEATURED_PRODUCTS_SPECIALS_ONLY == 'true' ) { $query .= " AND s.status = '1' "; } $query .= 'ORDER BY rand(' . $mtm . ') DESC LIMIT ' . MAX_DISPLAY_FEATURED_PRODUCTS; $featured_products_query = tep_db_query( $query ); } $row = 0; $col = 0; $num = 0; while ($featured_products = tep_db_fetch_array($featured_products_query)) { $num ++; if ($num == 1) { new contentBoxHeading($info_box_contents); } // If on special show regular and sale price if (tep_not_null($featured_products['specials_new_products_price'])) { $products_price = '<s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br>'; $products_price .= '<span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])); } $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $products_price); $col ++; if ($col > 1) { $col = 0; $row ++; } } if($num) { new contentBox($info_box_contents); } } else { // If it's disabled, then include the original New Products box // include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module } ?> <!-- featured_products_eof //--> What I'd like it in so it formats nice:-) <?php /* $Id: new_products.php 1806 2008-01-11 22:48:15Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ ?> <!-- new_products //--> <?php // $info_box_contents = array(); // $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))); // new contentBoxHeading($info_box_contents); if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, 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_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, 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_DESCRIPTION . " pd, " . 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 p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { // ---------- $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $p_id = $product['products_id']; $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; $p_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>'; $p_desc = ''.substr(strip_tags($product['products_description']), 0, MAX_DESCR_1).' ...'; $p_price = '<span class="productSpecialPrice">'.$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</span>'; $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details2.gif', '', ' class="btn1"').'</a>'; $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif', '', ' class="btn2"').'</a>'; $info_box_contents[$row][$col] = array('align' => 'left', 'params' => ' style="width:50%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"><tr><td class="new"> <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd">'.$p_name.'</td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td></tr> <tr><td>'.tep_draw_name_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="price2_padd"><b>'.PRICE.':</b>'.$p_price.'</td> <td>'.tep_image(DIR_WS_IMAGES.'part.gif').'</td> <td class="button2_padd button2_marg"> <table cellpadding="0" cellspacing="0" border="0"> <tr><td>'.$p_details.' '.$p_buy_now.'</td></tr> </table> </td> </tr> </table> '.tep_draw_name_bottom().'</td></tr> </table> </td></tr></table> '.tep_draw_prod2_bottom().''); $col ++; if ($col > 1) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- new_products_eof //--> Hope you are well. Andrew
  2. hostyork

    PayPal WPP Direct Payments & Express Checkout Support

    Hi, I'm running paypal_wpp_0.9 and trying to test with the sandbox. Im using the CC details included in the setup file VISA CC#: 4072497208897267 Exp: 12/09 CVS: 000 However it's giving me the error We apologize for the inconvenience, but PayPal only accepts Visa, Master Card, Discover, and American Express. Please use a different credit card. I have used the test visa card and slected this from the drop down list. Anyone experienced this? Do you know what could be wrong? Thanks Andrew www.hostyorkshire.com
  3. hostyork

    PayPal WPP Direct Payments & Express Checkout Support

    Hi, which API do I need to choose in the Paypal API setup? It gives me 2 options 1) Grant API permission 2) Request API credentials Thanks Andrew
  4. hostyork

    OsCommerce Download Feature

    Don't quite understand whay you mean. Downloads redirect is on flase and I still get the above error. Can anyone above get the code working right? I also have mail in payment as an option but it allows them to download before they have mailed in the payment. Kinda silly actually, but a fix like this would be spot on. Anyone? Andrew www.hostyorkshire.com
  5. whoops, just seen the fix a few pages back.. fixed :-)
  6. Hello. I too have installed the contribution. When I go to /admin/coupons.php I get this error 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 '-9, 9' at line 1 select * from discount_coupons cd order by cd.date_end, date_start limit -9, 9 [TEP STOP] Any ideas? I've not modified the file, just uploaded it.
  7. hostyork

    Secpay test status TEST:9999

    Yes, stick her in LIVE mode and you should be up an running.
  8. hostyork

    Products Attributes

    Does anyone know, or has used a contribution that will allow me to select the Products Attributes when adding a New Product? I'm finding it quite tedious having to go back to a newly entered Products Attributes 3 times to add small/medium and large. :-( Looked through the contributions but can't seem to find anything. Thanks
  9. hostyork

    PayPal Charging shipping

    Thanks Satish. I did check the paypal settings and you were right. I have now overridden them and it works :-)
  10. hostyork

    PayPal Charging shipping

    Hi, at the moment im using flat rate shipping and the default paypal module that comes with OS commerce. I've installed and uninstalled the paypal module and changed the shipping price but when the customer checks out and goes to paypal they always get a ?20 shipping charge. Anyone know how I can fix this? Do you know what table in the mySQL database the shipping charge is in? I can't seem to find it. Thanks :huh:
  11. hostyork

    Transaction Mode In Secpay

    Dohhhh... why didn't I see it? Sometimes you get that involved with a project that you can't see the errors yourself! Thanks Andrew www.hostyorkshire.com
  12. hostyork

    Transaction Mode In Secpay

    Hi Chaps! I'm all setup or at least I thought I was until someone made a transaction and it's still going through as test :-( I think from this thread it tells me I'm still in Always Successful mode. How do I change it to Production? Thanks
  13. hostyork

    Can't add another Zone

    Boink - Anyone?
  14. hostyork

    Can't add another Zone

    OK, I did this and changed the number to 8 and uploaded it again. Then I go to edit the zones there are still 7 and 3 blank boxes for me to input the required info but they are not labled. I guessed this would be fo the 8th so I've put the info in and submitted but no 8th zone has appeared. Am I still doing something wrong? Andrew
  15. hostyork

    Can't add another Zone

    Thanks very much! I've had a long day.
×