Jump to content

stonez

Members
  • Content count

    49
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Stonez Chen
  1. stonez

    [Contribution] STS v4

    Dear All, I have turned on "Use tempalte for infoboxes" to true in the admin. However, it won't use my infobox templates under /test/boxes/infobox_header.php.html...etc. If you encountered same problem like I did, here is the solution for you. So, I tracked down the code and discovered this variable is not set any where in sts class $sts->infobox_enabled So I added a variable in /includes/classes/sts.php In class sts { Add this variable var $infobox_enabled; In sts class, in function sts() Add this: if(MODULE_STS_INFOBOX_STATUS=='true'){ $this->infobox_enabled = true; } And it worked!! :D
  2. stonez

    [Contribution] STS v4

    PLEASE IGNORE THIS POST. IT WAS MY FAULT, NOT THE CONTRIBUTION! SUPERB CONTRIBUTION!! THANKS!
  3. stonez

    [Contribution] STS v4

    Product with attribute options won't work? I have STS+ 4.0.7 installed and everhting worked perfectly. Recnetly, I found out a problem appeared if I have STS+ module turned on. Let's say I have a product with two attributes. Fashion Jacket - Attribute Size L Fashon Jacket - Attribute Size M If I put the Size L in the cart, it worked OK, However, if I clicked the same product again and select Size M, only one Fation Jacket with Attribute Size L will be in the cart, and quanitity increased from 1 to 2. If I turn STS+ module off, the above-mentioned problem will not appear. My cart will have: Fashion Jacket - Attribute Size L Fashon Jacket - Attribute Size M What could be the problem? Is this a bug in STS+ 4.0.7? Would upgrade to 4.1 helping solving this problem? Thanks! Stonez
  4. stonez

    NewsDesk v1.48 Support

    For those of you who upgrade Mysql to 5.0x and encountered left join problems, Please see the answer here: Solve Left Join problem for Mysql 5.0x or add () after FROM and before LEFT JOIN to solve the problem
  5. stonez

    ### POINTS AND REWARDS MODULE V1.00 ###

    Correct error above, Step 2 should be like this : //--BOF--Point auto reward after n days function points_auto_on_after_days(){ $today = date('Y-m-d h:m:s'); $total_points_awarded = 0; if (USE_POINTS_SYSTEM && POINTS_AUTO_ON){ //Get customers pending points from table $sql = "SELECT unique_id, orders_id, points_pending, date_added, status from ".TABLE_CUSTOMERS_POINTS_PENDING." where customer_id = ".$customer_id." AND status = 1"; $customer_pending_points_query = tep_db_query($sql); while($cpp = tep_db_fetch_array($customer_pending_points_query)){ //Check if the date is more than preset day, if yes, update status from 1 to 2 if( (( strtotime($today) - strtotime($cpp['date_added'])) / (60 * 60 * 24)) >= POINTS_AUTO_ON_AFTER_DAYS) { tep_db_query('update '. TABLE_CUSTOMERS_POINTS_PENDING . ' set status = 2 where unique_id = '. (int)$cpp['unique_id']); tep_db_query('update '. TABLE_CUSTOMERS . ' set customers_shopping_points = customers_shopping_points + '. (int)$cpp['points_pending'] . ' where customers_id = '. $cpp['customer_id']); $total_points_awarded += (int)$cpp['points_pending']; } } return $total_points_awarded; }else{ return 0; } } //--BOF--Point auto reward after n days
  6. stonez

    ### POINTS AND REWARDS MODULE V1.00 ###

    Hi! I tried very hard to get this work on my shop. **BACKUP FIRST*** 1. Add SQL statement to you DB INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ( '', 'Hold reward points for n days?', 'POINTS_AUTO_ON_AFTER_DAYS', '7', 'Auto reward points to customer must set to true for this to work!', '77', '5', NULL , '0000-00-00 00:00:00', NULL , NULL ); 2. add following in admin\index.php, so as Admin login, the reward points function will be called. You can put this in the index.php page, as it would not be called frequently called and save some query time. Just put the code below where you want it to show. <!-- //--BOF--Point auto reward after n days --> <tr bgcolor="#E8E3E3"> <td colspan="2" class="text" height="30" align="center"> <?php $points_auto_on_after_days = points_auto_on_after_days(); echo "Awarded points: <font color='red'>".number_format($points_auto_on_after_days,0).'</font>points'; ?> </td> </tr> <!-- //--EOF--Point auto reward after n days --> 3. Add this function in the end of admin\includes\functions\general.php //--BOF--Point auto reward after n days function points_auto_on_after_days($customer_id){ $today = date('Y-m-d h:m:s'); $total_points_awarded = 0; if (USE_POINTS_SYSTEM && POINTS_AUTO_ON){ //Get customers pending points from table $sql = "SELECT unique_id, orders_id, points_pending, date_added, status from ".TABLE_CUSTOMERS_POINTS_PENDING." where customer_id = ".$customer_id." AND status = 1"; $customer_pending_points_query = tep_db_query($sql); while($cpp = tep_db_fetch_array($customer_pending_points_query)){ //Check if the date is more than preset day, if yes, update status from 1 to 2 if( (( strtotime($today) - strtotime($cpp['date_added'])) / (60 * 60 * 24)) >= POINTS_AUTO_ON_AFTER_DAYS) { tep_db_query('update '. TABLE_CUSTOMERS_POINTS_PENDING . ' set status = 2 where unique_id = '. (int)$cpp['unique_id']); tep_db_query('update '. TABLE_CUSTOMERS . ' set customers_shopping_points = customers_shopping_points + '. (int)$cpp['points_pending'] . ' where customers_id = '. $customer_id); $total_points_awarded += (int)$cpp['points_pending']; } } return $total_points_awarded; }else{ return 0; } } //--BOF--Point auto reward after n days However, you have login to backend for the auto-reward to work! Enjoy it! :D
  7. stonez

    ### POINTS AND REWARDS MODULE V1.00 ###

    The Auto giving reward points function works well. However, Is there a way to set a day period, say 7 days, in the backend then the reward points will actually added to customers account? The reason for doing this is that customers are not getting those points until the purchasing grace period expired. (Say, customers are allowing to return the goods within 7 days) We don't want to a customer buy a lot of items and get points right away and then return purchased goods later. Then, the customer's reward points are still in his account! Is this a good function to add to this contribution? ;) Stonez
  8. stonez

    Wolfen Featured Sets SUPPORT

    When I use the Admin->categories->specials or product expected I will get Special 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 '-12, 12' at line 1 select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -12, 12 [TEP STOP] Does this has anything to do with this contribute? I traced the code into split_page_results.php and in there the limit was formed there -12, 12 (which should be 0, 12) I can't figure out why... Thanks for help!
  9. stonez

    Wolfen Featured Sets SUPPORT

    Added this module afternoon and it worked right away!! Very nice module to have!! The store owner now has the ability to set what are "featured products"! And more! Thanks Steve!! Stonez
  10. stonez

    B2BSuite - solution for Payment don't allowed

    After looking into the code again today, I found out where could be the problem. in /catalog/includes/functions/general.php find function tep_get_payment_unallowed($pay_check) in that function, find $payments = tep_db_query("select group_payment_unallowed from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" . $customer_id . "'"); in above statement, the last $customer_id should be $customer_group_id, not $customer_id!! Step 1: Add this function to your /catalog/includes/functions/general.php function tep_get_customer_group_id($customer_id){ //Get group id $g = tep_db_query("select customers_group_id from ".TABLE_CUSTOMERS." where customers_id = '".$customer_id."'"); $g1 = tep_db_fetch_array($g); return $g1['customers_group_id']; } Step 2: Add one line above the $payments=tep_db_query.... and Change the the $customer_id to $gid in that statement. $gid = tep_get_customer_group_id($customer_id); $payments = tep_db_query("select group_payment_unallowed from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" . $gid . "'"); This should be better than previous solution. However, I didn't test it yet! Use it at your own risk!
  11. B) If you need this temporary solution for the payment dont allowed function for B2BSuite, please follow the steps here. Edit /catalog/checkout_payment.php find this line $selection = $payment_modules->selection(); Right after the line add this: #Added by Stonez to filter out those DON'T ALLOW Payments!! $gid = tep_get_customer_group_id($customer_id); $check_query = tep_db_query("select group_payment_unallowed from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" . $gid . "'"); $check = tep_db_fetch_array($check_query); $group_payment_unallowed = split(',',$check['group_payment_unallowed']); for($i=0, $n=sizeof($selection);$i<$n; $i++){ foreach($group_payment_unallowed as $p){ if(trim(strtoupper($p))==trim(strtoupper($selection[$i][id]))){ unset($selection[$i]);#Remove the unallowed payment method } } } sort($selection); in your catalog/includes/functions/general.php add this function: function tep_get_customer_group_id($customer_id){ //Get group id $g = tep_db_query("select customers_group_id from ".TABLE_CUSTOMERS." where customers_id = '".$customer_id."'"); $g1 = tep_db_fetch_array($g); return $g1['customers_group_id']; } Now you can test it! It should work right now. Use this at your own risk!
  12. stonez

    Free UPS ground

    Hi, I am also looking for a solution to this. Hope someone would help me out here! Stonez
  13. Dear All, I have currently using the UPS XML Rate and Service module and it wored really well. Thanks! However, I am trying to shift the price down a level and make the ground shipping $0, because I would like to let our customers enjoy the free ground shipping with options to upgrade. For instance: United Parcel Service (XML) (1 pkg, 7 lbs total) UPS Ground (1 Business Days) $4.20 UPS 3 Day Select (3 Business Days) $7.17 UPS 2nd Day Air A.M. (2 Business Days) $12.20 UPS 2nd Day Air (2 Business Days) $10.91 UPS Next Day Air Saver (1 Business Days) $18.99 UPS Next Day Air Early A.M. (1 Business Days) $52.70 UPS Next Day Air (1 Business Days) $22.20 --------------------------------------------------------------- And This is the result I wanted. --------------------------------------------------------------- United Parcel Service (XML) (1 pkg, 7 lbs total) UPS Ground (1 Business Days) $0 UPS 3 Day Select (3 Business Days) $4.20 UPS 2nd Day Air A.M. (2 Business Days) $7.17 UPS 2nd Day Air (2 Business Days) $12.20 UPS Next Day Air Saver (1 Business Days) $10.91 UPS Next Day Air Early A.M. (1 Business Days) $18.99 UPS Next Day Air (1 Business Days) $52.70 Here is code I have in the /catalog/include/classes/shipping: It worked on the page of 'checkout_shipping.php'. It displayed correctly as I expected, but not in the 'checkout_confirmation.php' page. Where the price will turn back to the original USPS. In my case, the ground shipping became $4.20 instead of $0. I can' not find the coding where changed the value back to $4.20. Can anyone give me a hand here!! Many thanks!! shipping.php class - function quote() ? ?function quote($method = '', $module = '') { ? ? ?global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes; ? ? ?$quotes_array = array(); ? ? ?if (is_array($this->modules)) { ? ? ? ?$shipping_quoted = ''; ? ? ? ?$shipping_num_boxes = 1; ? ? ? ?$shipping_weight = $total_weight; ? ? ? ?if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) { ? ? ? ? ?$shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT; ? ? ? ?} else { ? ? ? ? ?$shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100); ? ? ? ?} ? ? ? ?if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes ? ? ? ? ?$shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT); ? ? ? ? ?$shipping_weight = $shipping_weight/$shipping_num_boxes; ? ? ? ?} ? ? ? ?$include_quotes = array(); ? ? ? ?reset($this->modules); ? ? ? ?while (list(, $value) = each($this->modules)) { ? ? ? ? ?$class = substr($value, 0, strrpos($value, '.')); ? ? ? ? ?if (tep_not_null($module)) { ? ? ? ? ? ?if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) { ? ? ? ? ? ? ?$include_quotes[] = $class; ? ? ? ? ? ?} ? ? ? ? ?} elseif ($GLOBALS[$class]->enabled) { ? ? ? ? ? ?$include_quotes[] = $class; ? ? ? ? ?} ? ? ? ?} ? ? ? ?$size = sizeof($include_quotes); ? ? ? ?for ($i=0; $i<$size; $i++) { ? ? ? ? ?$quotes = $GLOBALS[$include_quotes[$i]]->quote($method); ? ? ? ? ?if (is_array($quotes)) $quotes_array[] = $quotes; ? ? ? ?} ? ? ?} My code inserted here: //---- Modified for UPS free ground shipping with option to upgrade ? for($i=0;$i<=sizeof($quotes_array); $i++){ ? ? ? if($quotes_array[$i]['id']=='upsxml'){ #Check if this is upsxml ? ? ? ?$sizeofmethod = sizeof($quotes_array[$i]['methods']); ? ? ? ?for($j=0;$j<=$sizeofmethod-1;$j++){ #Loop all shipping method returned ? ? ? ? if($j==0 && ereg('UPS GROUND',strtoupper($quotes_array[$i]['methods'][$j]['title']))){ #Make sure first item is UPS Ground ? ? ? ? ? ?$last_method_cost = $quotes_array[$i]['methods'][$j]['cost']; ? ? ? ? ? ? ? ? ? $quotes_array[$i]['methods'][$j]['cost'] = 0; ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ?if($j>=1){ ? ? ? ? ? ? ? ? ? $prev_method_cost = $quotes_array[$i]['methods'][$j]['cost']; ? ? ? ? ? ? ? ? ? $quotes_array[$i]['methods'][$j]['cost'] = $last_method_cost; ? ? ? ? ? ? ? ? ? $last_method_cost = $prev_method_cost; ? ? ? ? ? ? ? ?} ? ? ? ?} ? ? ? } ? ? ?} //----END of Modified for UPS free ground shipping with option to upgrade ? ? ?return $quotes_array; ? ?}
  14. stonez

    Lost Credit Card Info

    When I test my installation, all cc information is not written to the database. This is weird! When I use print_r($order), I don't see any value in the $order->info[cc_xx]. I'm using MS2 version. Can any one help?
  15. Hi! This is a great contribution! However, is it popssible to only use the Coupon portion? Is there any one extract this part already? I have B2BSuite installed already and I am afraid that if I install this would damage my OSCMS2+B2BSuite installation. Or...Has any one installed OSCMS2+B2BSuite +Credit Class & Gift Voucher Coupon without any problem? if so, I would like to install this too! :D
×