Jump to content

mommaroodles

♥Ambassador
  • Content count

    183
  • Joined

  • Last visited

  • Days Won

    2

Reputation Activity

  1. Thanks
    mommaroodles got a reaction from dr_lucas in Credit Class & Gift Vouchers for 2.3.4   
    I've just uploaded a working Credit Class, Gift Vouchers and Coupon Codes for osCommerce 2.3.3.4 - it can be found here Credit Class, Gift Vouchers & Discount Coupons osC2.3.3.4 Complete set ready to drop on top of a clean installation of osCommerce 2.3.3.4.
  2. Thanks
    mommaroodles got a reaction from dr_lucas in Credit Class & Gift Vouchers for 2.3.4   
    I've been using it for years for many clients, the problem is that here is too many of them that dont actually work - the one and only one that did ever work feel between the cracks and was overlooked by so many. Too many well meaning contributors have messed up the addon with little fixes to the extent that the original author simply gave up and hasnt been seen on this form since 2010.
     
    Things do work - you just got to use the right addon - I installed CCGV working on all sites since osC MS1 in less than 12 hours and it takes me less than a day to do CCGV, SPPC and Quantity Price Breaks
  3. Like
    mommaroodles reacted to Dr. Rolex in jQuery/Ajax Shopping Cart   
    This should work, assuming parameters can be put on the fifth position of the tep_image_cdn function.
    <?php /* * $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ 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_featured = '1' and p.products_id = pd.products_id and pd.language_id = '" . ( int ) $languages_id . "' order by RAND() 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_featured = '1' and p.products_id = pd.products_id and pd.language_id = '" . ( int ) $languages_id . "' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS ); } $num_new_products = tep_db_num_rows ( $new_products_query ); if ( $num_new_products > 0 ) { $counter = 0; $col = 0; $new_prods_content = '<div class="grid-100 grid-parent">'; while ( $new_products = tep_db_fetch_array ( $new_products_query ) ) { $counter ++; if ( $col === 0 ) { $new_prods_content .= '<div class="grid-33 mobile-grid-100 tablet-grid-33">'; } $new_prods_content .= '<div class="border grid-100 mobile-grid-100"> <div class="grid-100 mobile-grid-100" style="text-align:center"> <div class="product_name box mobile-grid-100"> <a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id'] ) . '">' . $new_products['products_name'] . '</a> </div> <div class="product_img box mobile-grid-100">' . // . tep_image_cdn(DIR_WS_IMAGES_CDN . $new_products ['products_image'], $new_products['products_name'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' tep_draw_form( 'cart_quantity-prodnew-' . $new_products['products_id'] . '', tep_href_link( FILENAME_SHOPPING_CART, 'products_id='.$new_products['products_id'] . '&action=add_product' ) ) . tep_draw_hidden_field( 'products_id', $new_products['products_id'] ) . '<h5 id="pi-product-info-'. (int)$new_products['products_id'].'" style="display:none"><a href="' . tep_href_link( FILENAME_DEFAULT, tep_get_all_get_params( array( 'action' ) ) . 'products_id=' . (int)$new_products['products_id'] ) . '" title="' . $new_products['products_name'] . '">' . $new_products['products_name'] . '</a></h5>' . tep_image_cdn( DIR_WS_IMAGES_CDN . $new_products ['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="draggable" rel="'.(int)$new_products['products_id'].'" id="cart-image-' . (int)$new_products['products_id'] . '" data-id="prodnew-"' ) . '</form> </div> </div> <div class="grid-100 mobile-grid-100 tablet-grid-100"> <div class="product_price box grid-50 mobile-grid-100 tablet-grid-50"> <div class="prodprice mobile-grid-100 tablet-grid-50"> ' . $currencies->display_price ( $new_products['products_price'], tep_get_tax_rate ( $new_products['products_tax_class_id'] ) ) . ' </div> </div> <div class="product_more_info box grid-50 mobile-grid-100 tablet-grid-50"> <div class="moreinfo mobile-grid-100 tablet-grid-50"> <a href="' . tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id'] ) . '">' . READ_MORE . '</a> </div> </div> </div> </div>'; $col ++; if ( ( $col > 0 ) || ( $counter == $num_new_products ) ) { $new_prods_content .= '</div>'; $col = 0; } } $new_prods_content .= '</div>'; ?> <div class="contentText"> <?php echo $new_prods_content; ?> </div> <?php }
  4. Like
    mommaroodles got a reaction from nikko50 in Credit Class & Gift Vouchers for 2.3.4   
    @@nikko50
     
    You've added a product with the model number GIFT25 and gave it a weight of 0.  This means that you now have a gift voucher to the value of $25 which you have made available for customers to buy.That gift voucher appears under your products in admin and under categories on the front end
     
    Now once a customer buys the gift voucher, one of two things can happen, he/she can use that against another purchase, they will be able to use the whole $25 or part there of - or they can email the gift voucher to a friend who then will have to come and register at the site and buy something in order to use it.
     
    Only once you have sold the gift voucher to a customer does it appear in the gift voucher queue in admin, you then physically have to make it available for the customer to use by clicking the release button. it was setup like this to prevent fraud -you release the gift voucher once you have received the payment for it.
     
    Once you have released the gift voucher it disappears from the queue and for the customer, when he logs in again - he will see 1) in the shopping cart box - a note to tell him he has a gift voucher of R25.00 to use or to email to a friend, 2) in his account area - customer is also notified.
  5. Like
    mommaroodles reacted to Spiceupyour in Credit Class & Gift Vouchers for 2.3.4   
    I will be testing this weekend, will keep you posted
  6. Like
    mommaroodles reacted to Dr. Rolex in jQuery/Ajax Advanced Order Handler for osCommerce 2.3.3   
    I knew these kind of problems would happen to a lot of people, that is problem with additional modules or at least it looks like problem due to modules.
     
    The only solution that I could up with was to try and set as many variables that modules might use as possible.
     
    @@NCPLUS
    If you get that message you probably have a fatal error in your PHP log, check that and reply what it says.
     
    One thing that might fix problems with loading some modules is to do the following modification to ajax_update.php, note that I haven't tried it myself.
     
    Replace this in ajax_update.php
    $cart = new shoppingCart(); With this:
    include_once DIR_WS_CLASSES . 'order.php'; $order = new order(); $cart = new shoppingCart(); If you can't find it, it's located right under this line.
    public function create_new_order( $GET, $POST ) { @@mommaroodles
     
     
    I don't think this function exists originally in oscommerce, so you'll probably added this yourself because of another module. Perhaps it was still there from the older order handler?
     
     
    Is this the module: http://addons.oscommerce.com/info/5710?
     
    I'll take a look at it when I have some time.
     
     
     
     
    I have fixed support for NON-mysqlnd servers, so now the order handler rev3 should work for those people as well. I'll upload this update later today (probably)..
  7. Like
    mommaroodles got a reaction from dr_lucas in AJAX Attribute Manager support   
    This is what seems to be working for me on osCommerce 2.3.3.2 - Apache 2.4.4, PHP 5.4.16 and MySQL 5.6.12
     
    IN admin/includes/application_top.php
     

    error_reporting(E_ALL & E_ERROR);
     
    IN admin/attributeManager/classes/amDB.php
     

    <?php /* ================================================================================================================== AJAX-AttributeManager-for-osc2.3.1-V2 ================================================================================================================== Addons installed in this file: - Osc Version Upgrade from v2.3.3.1 to v2.3.3.2 ================================================================================================================== $Id: DB.class.php,v 1.0 21/02/06 Sam West$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Released under the GNU General Public License Copyright © 2006 Kangaroo Partners http://kangaroopartners.com osc@[member='KangarooPartners'].com */ /** * OSC Database functions wrapper - just in case they decide to release ms3 the moment i release this - he he */ class amDB { /** * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @package $strQuery sting - sql query string * @[member='Return'] query reference */ public static function query($strQuery) { return tep_db_query($strQuery); } /** * Fetches the next array from a mysql query reference * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $ref - referece from a mysql query * @[member='Return'] array */ public static function fetchArray($ref) { return tep_db_fetch_array($ref); } /** * Gets the field count from a mysql query reference * @[member='author'] Tomasz Iwanow aka TomaszBG - microvision@gmail.com * @[member='param'] $ref - referece from a mysql query * @[member='Return'] int - number of fields in result */ public static function numFields($ref) { return mysqli_field_count($ref); } /*function numFields($ref) { return mysql_num_fields($ref); } /** * Gets the field name from a mysql query reference * @[member='author'] Tomasz Iwanow aka TomaszBG - microvision@gmail.com * @[member='param'] $ref - referece from a mysql query * @[member='param'] $offset - offset of a field * @[member='Return'] string - name of the field */ public static function fieldName($ref,$offset) { return mysqli_fetch_field_direct($ref,$offset); } /*function fieldName($ref,$offset) { return mysql_field_name($ref,$offset); } /** * Counts the number of results from a mysql query referece * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $ref - reference from a mysql query * @[member='Return'] int - number of rows in result */ public static function numRows($ref) { return tep_db_num_rows($ref); } /** * peforms inserts / updates * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $strTable string tablename * @[member='param'] $arrData array data to be inserted/ updated * @[member='param'] $strAction sting - update / insert * @[member='param'] $strParams string additonal where clauses * @[member='Return'] void */ public static function perform($strTable,$arrData,$strAction='insert',$strParams='') { return tep_db_perform($strTable,$arrData,$strAction,$strParams); } /** * Returns a singular result from a mysql query * @[member='param'] $strQuery string - mysql query * @[member='Return'] mixed - first record, first row */ public static function getOne($strQuery) { $res = amDB::query($strQuery); if ($res && amDB::numRows($res)) return tep_db_result($res,0,'next'); return false; } /* function getOne($strQuery) { $res = amDB::query($strQuery); if ($res && amDB::numRows($res)) return mysql_result($res,0,0); return false; } /** * Returns all results from a mysql query * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $strQuery string - mysql query * @[member='Return'] array - all results */ public static function getAll($strQuery) { $res = amDB::query($strQuery); $results = array(); while($row = amDB::fetchArray($res)) $results[] = $row; return $results; } /** * Prepares string for database input * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $str string * @[member='Return'] void */ public static function input($str) { return tep_db_prepare_input($str); } /** * Returns placebo autoincrement value * @[member='access'] public * @[member='param'] $strTable string table name * @[member='param'] $strField string field name * @[member='Return'] mixed */ public static function getNextAutoValue($strTable,$strField) { return (int)amDB::getOne("select max($strField) + 1 as next from $strTable limit 1"); } /** * Some contributions such as the Ultimate SEO URLs have there own * database functions. This can cause the internal, last insert id to be * wrong if the link id isn't included in the mysql_insert_id statement. * For this reason i have not used the default osc function for this one as for some * reason they haven't put the link in their wrapper function. * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $link sting - db link name * @[member='Return'] void */ public static function insertId($link = 'db_link' ) { global $$link; return tep_db_insert_id($$link); } /* function insertId($link = 'db_link' ) { global $$link; return mysql_insert_id($$link); }*/ } ////////////////////////////////////////////////////////////////////////////////////////////////// if ( !function_exists('mysqli_field_count') ) { function mysqli_field_count($result) { return mysql_num_fields($result); } } if ( !function_exists('mysqli_fetch_field_direct') ) { function mysqli_fetch_field_direct($result, $fieldnr) { return mysql_field_name($result, $fieldnr); } } ?>
     
    In admin/attributeManager/classes/stopDirectAccess.class.php
     

    <?php /* $Id: stopDirectAccess.class.php,v 1.0 21/02/06 Sam West$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Released under the GNU General Public License Copyright © 2006 Kangaroo Partners http://kangaroopartners.com osc@[member='KangarooPartners'].com */ require_once('attributeManager/includes/attributeManagerSessionFunctions.inc.php'); /** * Try and stop direct access to the script * As far as i know there is no way for a remote user to set a session var without high jacking the session, in which case it doesn't really matter what this script does anyway. * If there is i will have to rethink this */ class stopDirectAccess { /** * Sets the global session variable * @[member='static'] authorise() * @[member='access'] public * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $sessionVar string session variable name * @[member='Return'] void */ public static function authorise($sessionVar) { amSessionRegister($sessionVar); $GLOBALS[$sessionVar] = stopDirectAccess::makeSessionId(); } /** * deletes the global session variable * @[member='static'] deAuthorise() * @[member='access'] public * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $sessionVar string session variable name * @[member='Return'] void */ public static function deAuthorise($sessionVar) { amSessionUnregister($sessionVar); } /** * Checks the session var * @[member='static'] checkAuthorisation() * @[member='access'] public * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $sessionVar string session variable name * @[member='Return'] void */ public static function checkAuthorisation($sessionVar) { if(!amSessionIsRegistered($sessionVar)) exit("Session not registered - You cant access this page directly"); if($GLOBALS[$sessionVar] != stopDirectAccess::makeSessionId()) exit("Session ids don't match - You cant access this page directly"); } /** * makes encoded session var * @[member='static'] makeSessionId() * @[member='access'] public * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='Return'] void */ public static function makeSessionId() { return sha1(md5(AM_VALID_INCLUDE_PASSWORD)); } } ?>
     
    I've done quite a bit of testing and I havent received any further error messages.
×