maz Posted June 14, 2006 Share Posted June 14, 2006 (edited) URGENTLY NEED HELP to get my modification of this module working... I need to give some selected products unique points values. So product A has 2points, product B has 3 points, etc. These points are SET BY ME in admin for these 'selected' products. ALL OTHER PRODUCTS WILL CONTINUE TO GET AUTO CALCULATED POINT VALUES calculated by the standard product price x POINTS_PER_AMOUNT_PURCHASE which already exists within the points rewards contribution. Method I am using: I created a new cloumn in the products table called 'products_setpoints' . I added a new entry box on the product description page in admin, so that for each new product I can give a SET POINTS VALUE. Now every product can have whatever points value i want. The DEFAULT value for the 'products_setpoints' is 0 in the database. I think that the points values are calculated in the catalog/includes/functions/redemptions.php file. The 2 functions I am looking at are // calculate the shopping points value for the customer function tep_calc_shopping_pvalue($points) { return((float)$points * (float)REDEEM_POINT_VALUE); } function tep_display_points($products_price, $products_tax, $quantity = 1) { if ((DISPLAY_PRICE_WITH_TAX == 'true') && (USE_POINTS_FOR_TAX == 'true')) { $products_price_points_query = tep_add_tax($products_price, $products_tax) * $quantity; } else { $products_price_points_query = $products_price * $quantity; } return $products_price_points_query; } // calculate the shopping points for any products price function tep_calc_products_price_points($products_price_points_query) { $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; return $products_points_total; } What i need to do is change these functions so that IF i have added a 'products_setpoints' value for a product then this value should be used in the first instance, and if the value is 0 then the normal points calcualtions are applied. I just need to change the function to say: Do an additional query to find values in 'products_setpoints' field of the products table and IF $products_setpoints > 0 (i.e. products have a set points value) THEN DO this $products_points_total = $products_price_points_query * $products_setpoints ; ELSE DO this $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; THEN obviously return the value return($products_points_value); But I am not sure how to write this query. PLEASE CAN ANYONE HELP. I am sure this mod would help everyone. It gives the best of both worlds. Automatically calculated points AND individually set points. If I can get it working I will post the complete files for everyone else. Edited June 14, 2006 by maz Quote Link to comment Share on other sites More sharing options...
Guest Posted June 14, 2006 Share Posted June 14, 2006 Hi I have the problem, that this error appears, when i click on "My Profile": 1146 - Table 'usr_web269_6.TABLE_CUSTOMERS_POINTS_PENDING' doesn't exist select count(*) as count from TABLE_CUSTOMERS_POINTS_PENDING where customer_id = '2' [TEP STOP] Who can help me? Thanks! L?o (Sorry for my bad english, I'm swiss... :blush: ) you didn't run the sql query to install the database tables Quote Link to comment Share on other sites More sharing options...
leopittoni Posted June 14, 2006 Share Posted June 14, 2006 you didn't run the sql query to install the database tables I did it, and the database "TABLE_CUSTOMERS_POINTS_PENDING" also exixts... Who can help me? Thanks! L?o Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted June 14, 2006 Share Posted June 14, 2006 You need to add this define to your: OPEN: catalog/admin/includes/database_tables.php ADD: define('TABLE_CUSTOMERS_POINTS_PENDING', 'customers_points_pending'); Quote Link to comment Share on other sites More sharing options...
deep-silver Posted June 15, 2006 Author Share Posted June 15, 2006 Hi I have the problem, that this error appears, when i click on "My Profile": 1146 - Table 'usr_web269_6.TABLE_CUSTOMERS_POINTS_PENDING' doesn't exist select count(*) as count from TABLE_CUSTOMERS_POINTS_PENDING where customer_id = '2' [TEP STOP] Who can help me? Thanks! L?o (Sorry for my bad english, I'm swiss... :blush: ) did you miss this step? ------------------------------------------------------------------------------------------ CATALOG STEP = 11. open catalog/includes/database_tables.php This will define the table used for shopping points. Find... (aprox. line 29) define('TABLE_CUSTOMERS_INFO', 'customers_info'); ... and add after..... define('TABLE_CUSTOMERS_POINTS_PENDING', 'customers_points_pending');//Points/Rewards Module V1.60 ------------------------------------------------------------------------------------------ Quote Remember - - - "STRESSED" spelled backwards "DESSERTS" Link to comment Share on other sites More sharing options...
maz Posted June 15, 2006 Share Posted June 15, 2006 I need some help please. URGENTLY NEED HELP to get my modification of this module working... I need to give some selected products unique points values. So product A has 2points, product B has 3 points, etc. These points are SET BY ME in admin for these 'selected' products. ALL OTHER PRODUCTS WILL CONTINUE TO GET AUTO CALCULATED POINT VALUES calculated by the standard product price x POINTS_PER_AMOUNT_PURCHASE which already exists within the points rewards contribution. Method I am using: I created a new cloumn in the products table called 'products_setpoints' . I added a new entry box on the product description page in admin, so that for each new product I can give a SET POINTS VALUE. Now every product can have whatever points value i want. The DEFAULT value for the 'products_setpoints' is 0 in the database. I think that the points values are calculated in the catalog/includes/functions/redemptions.php file. The 2 functions I am looking at are // calculate the shopping points value for the customer function tep_calc_shopping_pvalue($points) { return((float)$points * (float)REDEEM_POINT_VALUE); } function tep_display_points($products_price, $products_tax, $quantity = 1) { if ((DISPLAY_PRICE_WITH_TAX == 'true') && (USE_POINTS_FOR_TAX == 'true')) { $products_price_points_query = tep_add_tax($products_price, $products_tax) * $quantity; } else { $products_price_points_query = $products_price * $quantity; } return $products_price_points_query; } // calculate the shopping points for any products price function tep_calc_products_price_points($products_price_points_query) { $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; return $products_points_total; } What i need to do is change these functions so that IF i have added a 'products_setpoints' value for a product then this value should be used in the first instance, and if the value is 0 then the normal points calcualtions are applied. I just need to change the function to say: Do an additional query to find values in 'products_setpoints' field of the products table and IF $products_setpoints > 0 (i.e. products have a set points value) THEN DO this $products_points_total = $products_price_points_query * $products_setpoints ; ELSE DO this $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; THEN obviously return the value return($products_points_value); But I am not sure how to write this query. PLEASE CAN ANYONE HELP. I am sure this mod would help everyone. It gives the best of both worlds. Automatically calculated points AND individually set points. If I can get it working I will post the complete files for everyone else. Quote Link to comment Share on other sites More sharing options...
leopittoni Posted June 15, 2006 Share Posted June 15, 2006 Ok, thanks! Thas was it! But now I have another error at the "checkout", also when a customer wants to pay the itams; this errors appears: Warning: printf(): Too few arguments in /home/www/web269/html/minis/shop/catalog/checkout_payment.php on line 393 Can someone help me? Thanks! L?o Quote Link to comment Share on other sites More sharing options...
leopittoni Posted June 15, 2006 Share Posted June 15, 2006 Ok, I have risove that problem, but I have another question: How can I delete the "Value=", in the notification-mail when i add points to a client? In the Mail now it's written: Your points: 50.00 Points Value = 50EUR Thanks! L?o Quote Link to comment Share on other sites More sharing options...
leopittoni Posted June 15, 2006 Share Posted June 15, 2006 One more thing: I would like that the customer can't enter how much points he want's to spend, but automaticaly all products are paid with points. I have done this so: <td class="main" ><?php echo TEXT_REDEEM_SYSTEM_SPENDING . ' ' .tep_draw_input_field('customer_shopping_points_spending', ($order->info['total']), 'onBlur="validate(this)" maxlength="7" style="width:70px"'); ?></td> But now I would like to do this input-field invisibel. How can I do that? Thanks! L?o Quote Link to comment Share on other sites More sharing options...
hrhstephen Posted June 16, 2006 Share Posted June 16, 2006 Hello Deep-Silver, I have found tax is always charged according to the total before the discount/points, Is this because tax is calculated whenever you buy something and is included in the price (if using display prices with tax), so it is not calculated at the final checkout pages. How do I fix this so that tax is charged after the discount please? Quote Link to comment Share on other sites More sharing options...
maz Posted June 16, 2006 Share Posted June 16, 2006 In redemptions.php the $points_toadd are calculated on the total order amount . Does any body know if the 'totals' in the function below are taken from orders.php file in classes folder ? else $points_toadd = $order->info['total']; Quote Link to comment Share on other sites More sharing options...
Guest Posted June 16, 2006 Share Posted June 16, 2006 i'm not positive but i'm pretty sure you could deduct tax, shipping, etc from the total using points if you re-ordered the listings on: admin -> Modules -> Order Total edit the "Sort Order" and number everything you want deducted BEFORE Points Redemptions Quote Link to comment Share on other sites More sharing options...
hrhstephen Posted June 16, 2006 Share Posted June 16, 2006 i'm not positive but i'm pretty sure you could deduct tax, shipping, etc from the total using points if you re-ordered the listings on:admin -> Modules -> Order Total edit the "Sort Order" and number everything you want deducted BEFORE Points Redemptions Changing the order makes no difference, the tax is still calculated on the total before any points or discounts come into effect.... Quote Link to comment Share on other sites More sharing options...
Guest Posted June 16, 2006 Share Posted June 16, 2006 can't help ya then B) Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 17, 2006 Share Posted June 17, 2006 I've a question here.How do i put a warning that the current product customer view is not awarded points if he/she purchase. For better understanding:--Please see below Points Credit : No points awarded for discounted products. (this one if the item is discounted) Let me explain.Let say i've 3 categories and 2 of them are awarded points.The other is not,therefore the points credit notice is still there meanwhile the category is not awarded.How do I make a notice that this category is not awarded points if he/she purchase it? ____Let say the customer did not read FAQ____ Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 18, 2006 Share Posted June 18, 2006 (edited) BUMP Please see above post Edited June 18, 2006 by Rezolles_Net Quote Link to comment Share on other sites More sharing options...
leopittoni Posted June 18, 2006 Share Posted June 18, 2006 One more thing: I would like that the customer can't enter how much points he want's to spend, but automaticaly all products are paid with points. I have done this so: <td class="main" ><?php echo TEXT_REDEEM_SYSTEM_SPENDING . ' ' .tep_draw_input_field('customer_shopping_points_spending', ($order->info['total']), 'onBlur="validate(this)" maxlength="7" style="width:70px"'); ?></td> But now I would like to do this input-field invisibel. How can I do that? Thanks! L?o Nobody can helb me? L?o Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 19, 2006 Share Posted June 19, 2006 How do i restrict some of my items is not giving points if they purchase it. Please...URGENT Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 20, 2006 Share Posted June 20, 2006 Please anyone?? Can i set items above 500 is not eligible to receive points?? Quote Link to comment Share on other sites More sharing options...
deep-silver Posted June 21, 2006 Author Share Posted June 21, 2006 How do i restrict some of my items is not giving points if they purchase it. Please...URGENT At the moment you can only restrict points given for items witch thier prices are other then the full frice. Quote Remember - - - "STRESSED" spelled backwards "DESSERTS" Link to comment Share on other sites More sharing options...
leopittoni Posted June 21, 2006 Share Posted June 21, 2006 And noone can help me? L?o Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 22, 2006 Share Posted June 22, 2006 At the moment you can only restrict points given for items witch thier prices are other then the full frice. hurrm...can you build a system that can restrict if any items over 500 will not receive point.....I think this is usefull. Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted June 24, 2006 Share Posted June 24, 2006 B U M P Quote Link to comment Share on other sites More sharing options...
ploki Posted June 26, 2006 Share Posted June 26, 2006 Hi there! I have used this contributions several times but This time I'm using it in a template oscommerce site purchased in a store site. I found a problem and I don't know how to solve. When a customer links at "View my Points Balance and Points received" and "Reward Point Program FAQ" in the My Account menu the problem appears. This message appears: "Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/XXXXXXX/public_html/shop/includes/header.php:195) in /home/XXXXXXX/public_html/shop/includes/boxes/categories.php on line 13". Anyone can help me? Quote Link to comment Share on other sites More sharing options...
Rezolles_Net Posted July 2, 2006 Share Posted July 2, 2006 bump Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.