Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

hello and thank you for this great contribution.

 

today i use V1.00 and will upgrade to V1.60 but i have try to add an restriction without succes by changing function tep_display_point.

 

my restriction needed is: give points only on some categories ID.

 

it's possible to restrict use of points with some categories ID but NOT restrict points adding.

 

i have somes products with expensives prices (3000?) and products with lows prices (10?) so i want give points only on not expensives products.

 

thank's for your help. B)

Link to comment
Share on other sites

I noticed one problem. Looks like if you have it set to where customers do not get points earned for items on special/sale, if they order something on sale/special and also include an item not on sale but regular price, looks like they still earn the points because their points has shown up on the admin side of Points Pending. I believe they should earn points for only the item they purchased in their basket that was not on sale.

Link to comment
Share on other sites

I noticed one problem. Looks like if you have it set to where customers do not get points earned for items on special/sale, if they order something on sale/special and also include an item not on sale but regular price, looks like they still earn the points because their points has shown up on the admin side of Points Pending. I believe they should earn points for only the item they purchased in their basket that was not on sale.

this already been posted.

This module(same as CCGV) do not handle only one product. only the whole cart contains.

so if the cart contain mix products this is how it handle it.

1. cart contains only ristric item = no points in all cases

2. cart contain ristric/non ristric item = customer gets points for this order.

3. cart contain ristric/non ristric item (by model)= no points in all cases.

 

If you really don't want to give points for ristric items even if bouth together with a non ristric items, use the ajust option in admin before confirming points.

 

Any other way of doing it will require braking the code into pieces and having one code for each

products in cart.

Lots of work,wast of load time and not compatible with other contributions or future version of osCommerce.

Thank you for your understanding.

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

Hi Deep-Silver

 

I just tested out this paypal IPN thing from your latest download and the thing i notice is that orders are not being updated to admin/orders.php

 

when i use any other form of payment at checkout i am ok, but when i use the IPN, it doesn't update admin/orders.php

 

if points are used as part payment then the points total is minused the correct amount, that's good... but can you please give advice on what to look out for to update admin/orders.php

 

thanks

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hi.

Great job on this contrib....

 

I'm running V1.60

Problem with "Enable Product Restriction"

 

Doesn't seem to be fetching the restriction rules "by model", "or Product ID", "or Category ID".

 

Admin side looks fine, DB config records are being properly updated via the Point/Rewards config settings.

 

When viewing products in catalog all products display points and during check out all products award points, seemingly ignoring the restrictio rules. Tried every combination of the 3 restrictions, individually, and even tried identifying one product using all 3 restrictions. Still all products display and award points.

 

NO ERRORS are being reported and the checkout process seems to be working just fine. Just won't do the restriction.

 

Any ideas?

Link to comment
Share on other sites

Hi Deep-Silver

 

I just tested out this paypal IPN thing from your latest download and the thing i notice is that orders are not being updated to admin/orders.php

 

when i use any other form of payment at checkout i am ok, but when i use the IPN, it doesn't update admin/orders.php

 

if points are used as part payment then the points total is minused the correct amount, that's good... but can you please give advice on what to look out for to update admin/orders.php

 

thanks

try to test paypal without using points.

sound like your paypal doesn't update admin/orders.php at all.

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

try to test paypal without using points.

sound like your paypal doesn't update admin/orders.php at all.

paypal does work... even the IPN does, the only thing not updating is the admin pending points page

 

i need closer examination of this - maybe it will be the same in NOCHEX.

 

will update the forum in due course

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hi, First of all thanks for such a great contrib :) much appreciated.

 

Just a couple of questions.

 

Is it possible to restrict the 'earn points feature' to certain customers or does everybody have to enjoy it?

 

And secondly, is it possible to have some products that are worth more points per $1 spent?

ie, 2 products both $10 each, but one earns 10 points and the other 14points.

 

Thanks

Edited by Radeon2004
Link to comment
Share on other sites

I have a prob. All this mod is ok in my shop but there is a problem in the Order Confirmation Page. In this page the total (in cash) do not deduce the point value and looks like there was no points redeemed.

 

Can You give me a hint to solve this mistery?

 

Thank you.

Link to comment
Share on other sites

Hi.

Great job on this contrib....

 

I'm running V1.60

Problem with "Enable Product Restriction"

 

Doesn't seem to be fetching the restriction rules "by model", "or Product ID", "or Category ID".

 

Admin side looks fine, DB config records are being properly updated via the Point/Rewards config settings.

 

When viewing products in catalog all products display points and during check out all products award points, seemingly ignoring the restrictio rules. Tried every combination of the 3 restrictions, individually, and even tried identifying one product using all 3 restrictions. Still all products display and award points.

 

NO ERRORS are being reported and the checkout process seems to be working just fine. Just won't do the restriction.

 

Any ideas?

work fine on the demo site.

you should check your coding.

 

 

I have a prob. All this mod is ok in my shop but there is a problem in the Order Confirmation Page. In this page the total (in cash) do not deduce the point value and looks like there was no points redeemed.

 

Can You give me a hint to solve this mistery?

 

Thank you.

the same answer all the time.

admin->modules->order total->Reedemptions sort order,

has to be after sub total and before total.

Did you read the INSTALL.txt and other posts in this forum??????

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

Hello. I have a problem with the points of welcome. When a customer is registered, it does not have its points of welcome. I put in the admin 500 points of welcome.

all the remainder goes perfectly

 

An idea?

 

thank's for advance

make sure you did not miss this step in INSTALL.txt

CATALOG STEP = 6.   open catalog/create_account.php
This will add Welcome Points (and send email)defined by admin if enabled.

Find this.... (aprox. line no.245)

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;


... and REPLCE with.....

// Points/Rewards system V1.60 BOF
  if (NEW_SIGNUP_POINT_AMOUNT > 0) {
	tep_add_welcome_points($customer_id);

	$points_account .= '<a href="' . tep_href_link(FILENAME_MY_POINTS) . '"><b><u>' . EMAIL_POINTS_ACCOUNT . '</u></b></a>.';
	$points_faq .= '<a href="' . tep_href_link(FILENAME_MY_POINTS_HELP) . '"><b><u>' . EMAIL_POINTS_FAQ . '</u></b></a>.';
	$text_points = sprintf(EMAIL_WELCOME_POINTS , $points_account,number_format(NEW_SIGNUP_POINT_AMOUNT,2),$currencies->format(tep_calc_shopping_pvalue(NEW_SIGNUP_POINT_AMOUNT)),$points_faq) ."\n\n";
  }

//	$email_text .= EMAIL_WELCOME . EMAIL_TEXT .EMAIL_CONTACT . EMAIL_WARNING;
  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . $text_points .EMAIL_CONTACT . EMAIL_WARNING;

// Points/Rewards system V1.60 EOF

 

Hello

 

Can I upgrade straight from version 1.40 to 1.60, or must I first upgrade from 1.40 to 1.50 then to 1.60

 

Thanks

Urbach

NO.(sorry)(you can but its a bit tricky)

You have to do it the hard way first upgrade from 1.40 to 1.50 then to 1.60

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

Hi together. first of all: Great contribution.

But...(there is always a but... :-)

I think I found a bug..or is it a feature? I think it's a bug.

Situation:

You have restricted the products for which a customer can redeem point to model "REDEMPTION". (Admin-Interface: "If Restriction enabled set model Allowed" => REDEMPTION)

If a customer puts such a product in to his cart and proceeds to the checkout-pages everything is fine.

If he put such a product into his cart and AFTER that some other products (where he can't redeem points) everything works out as planned.

But If the customer puts some products into his cart and AFTER that one REDEMPTION-Product the system does not recognize this. So the customer does'nt get the input field in checkout_payment.php He can't redeem points. I think that's not the way it should be. I think a customer should be able to "mix" the products in his cart as he wants. I hope you understand where the problem is.

 

I also think I found the point of failure

its in the function get_redemption_rules($order);

 

  if (REDEMPTION_RESTRICTION == 'true') { 

		if (tep_not_null(RESTRICTION_MODEL))   
	  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
		 if (!(substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {

		   return false;
		 }
	  return true;
	}

 

The problem is that you theoretically check all the products in cart if there is a RESTRICTION_MODEL found but if the first product in cart is a "normal" product this code returns "false" and stops executing the rest of the for-loop because of "return".

I changed the code a little bit to make it work the way I want:

 

 if (REDEMPTION_RESTRICTION == 'true') { 

		if (tep_not_null(RESTRICTION_MODEL)){
	for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
		 if ((substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {
		   return true;
		 }
		}
	  return false;
	}

the difference is that now if a REDEMPTION-Product is found the function returns true and "exits". If no REDEMPTION-Product is found and the End of the products-in-cart-list is reached (edn of for-loop) the function returns false and exits.

 

I still have to check the PID or PATH restrictions regarding this problem. Because my english and php-skill are not that good I wanted to get your opinion on this "problem".

Link to comment
Share on other sites

Me again..

I encountered another "problem".

If the customer adds a REDEMPTION-Product to his cart and uses a quantity>1 for this product. He can only redeem the points for quantity=1. I really don't know if this is a problem for some people or if they want it that way. I think this should be configureable in the admin-section.

 

The function responsible for ignoring the product-quantity is:

 function get_max_points_redemption($order) {
	  $total_points_to_be_reedmed=0;
	if (REDEMPTION_RESTRICTION == 'true') {  
  $total_prize_to_be_redeemed=0;
  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
	if ((substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {
			$total_price_to_be_redeemed = $total_price_to_be_redeemed + tep_add_tax(($order->products[$i]['price'])*($order->products[$i]['qty']), $order->products[$i]['tax']);
			}				
  }
	  $total_points_to_be_reedmed= (int)($total_price_to_be_redeemed / REDEEM_POINT_VALUE);
	return $total_points_to_be_reedmed;
} 
}

 

This is already the changed version that includes the quantity in the calculation. Perhaps this usefull for some people. just wnated to let you know.

Link to comment
Share on other sites

Hi together. first of all: Great contribution.

But...(there is always a but... :-)

I think I found a bug..or is it a feature? I think it's a bug.

Situation:

You have restricted the products for which a customer can redeem point to model "REDEMPTION". (Admin-Interface: "If Restriction enabled set model Allowed" => REDEMPTION)

If a customer puts such a product in to his cart and proceeds to the checkout-pages everything is fine.

If he put such a product into his cart and AFTER that some other products (where he can't redeem points) everything works out as planned.

But If the customer puts some products into his cart and AFTER that one REDEMPTION-Product the system does not recognize this. So the customer does'nt get the input field in checkout_payment.php He can't redeem points. I think that's not the way it should be. I think a customer should be able to "mix" the products in his cart as he wants. I hope you understand where the problem is.

 

I still have to check the PID or PATH restrictions regarding this problem. Because my english and php-skill are not that good I wanted to get your opinion on this "problem".

using the ristrection by model is an option bild for shop that want to make sure its 100% ristrict

so in this case the customer can't mix this item iwth non ristric items alse he get NO points for the whole order.

 

Me again..

I encountered another "problem".

If the customer adds a REDEMPTION-Product to his cart and uses a quantity>1 for this product. He can only redeem the points for quantity=1. I really don't know if this is a problem for some people or if they want it that way. I think this should be configureable in the admin-section.

 

The function responsible for ignoring the product-quantity is:

 function get_max_points_redemption($order) {
	  $total_points_to_be_reedmed=0;
	if (REDEMPTION_RESTRICTION == 'true') {  
  $total_prize_to_be_redeemed=0;
  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
	if ((substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {
			$total_price_to_be_redeemed = $total_price_to_be_redeemed + tep_add_tax(($order->products[$i]['price'])*($order->products[$i]['qty']), $order->products[$i]['tax']);
			}				
  }
	  $total_points_to_be_reedmed= (int)($total_price_to_be_redeemed / REDEEM_POINT_VALUE);
	return $total_points_to_be_reedmed;
} 
}

 

This is already the changed version that includes the quantity in the calculation. Perhaps this usefull for some people. just wnated to let you know.

the points calculation take place at order total so the customer buy 1 item or 100 its not metter as its always

order subtotal - points used.

so i dont really understand what you trying to say here. i wish i could, could you please give more info.

BTW:

It work fine at the demo shop, maybe you should give it a try :thumbsup:

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

Dear Deep-silver,

The new contribution you posted Nov. 26, 2005 POINTS AND REWARDS MODULE V1.00 at http://www.oscommerce.com/community/contributions,3220 is excellent. Your instructions were easy to follow and everything is working great.

 

There is only one place I found the need for a change aside from regular customizations.

 

I got 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 'customers_id = 2' at line 1

 

update customers set customers_shopping_points = customers_shopping_points + 1where customers_id = 2

----

 

So I updated line 38 of catalog/admin/customers_points_pending.php and added a space between $customer_points['points_pending'] . ' and the word 'where' in the query.

 

That was it, the rest was just right.

 

Thanks for sharing all your hard work and for taking the time to write thorough helpful instructions.

Best wishes,

Emma

Link to comment
Share on other sites

I found two other places that need a space like above. Do a search in customer_points_pending.php, customer_points.php, and orders.php for

 

'where customers_id

 

and change it to

 

' where customers_id

 

with a space between the ' and the where. there are three in total. All else is still working smoothly.

Best wishes,

Emma

Link to comment
Share on other sites

I'm not sure the following:

 

When customer check out, he/she selects spend the points instead of paying cash or other payment method in the Checkout_payment. Does not need to select any payment method column?

 

If the customer not select any payment method only select the Shopping Points Redemptions section, the Javascript pop out tell the customer select the payment method.

 

Is it normal?

 

Or anything I do wrong?

Link to comment
Share on other sites

The Customers_points_pending.php does not show up the data.

 

It show up "Table_heading" and "displaying 1 to 9 (of 9 orders)"

I already resintall the whole thing. Still the same.

 

Please help! Thanks

Link to comment
Share on other sites

Hi,

 

I installed this great contrib however I have the following error, when I want to look to customer pending points;

 

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 '-6, 6' at line 1

 

select o.orders_id, o.orders_status, o.customers_name, o.customers_email_address, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cpp.points_pending as points_pending, cpp.comment as comment, cpp.status as status from orders o , orders_total ot , orders_status s , customers_points_pending cpp where ot.class = 'ot_total' and cpp.status = '1' and cpp.orders_id = o.orders_id and o.orders_id = ot.orders_id and o.orders_status = s.orders_status_id and s.language_id = '1' order by o.orders_id DESC limit -6, 6

 

How can I correct this?

 

Denice

Link to comment
Share on other sites

Hi,

 

I installed this great contrib however I have the following error, when I want to look to customer pending points;

How can I correct this?

 

Denice

are you using PHP5.0 ?

if you do , just look for the oscommerce forum for an update to slove problem with page listing

as the function split page (osCommerce default) is not working well on PHP 5.0

from some reason you got a negative result on your page so the script can't solve how many rows per page to display

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Link to comment
Share on other sites

i just installed the most recent version and i must say it works flawlessly. thank you for the admin/orders.php edit! it's a real time saver :D

 

 

do you know when or if the points balance will show on the printable invoice? (to show the customer on their invoice they have $xx.xx to spend)

Link to comment
Share on other sites

are you using PHP5.0 ?

if you do , just look for the oscommerce forum for an update to slove problem with page listing

as the function split page (osCommerce default) is not working well on PHP 5.0

from some reason you got a negative result on your page so the script can't solve how many rows per page to display

 

Hi deep-silver,

 

I'm using PHP Version: 4.4.1 (Zend: 1.3.0).

Link to comment
Share on other sites

Ok I've just installed POINTS AND REWARDS MODULE V1.60 Updated Nov. 26, 2005

 

Now I don't seem to have any errors thus far, but I must have missed something along the way as inmy admin section I don't have the module listed in the Orfer Total Modules.

 

In the Configuration area of the Admin section I do have a Points/rewardsV1.60 and when I click on it all I get is a blank area where the empty table "Title" "Value" and "Action" is displayed. I assume it is empty because of the earlier problem with it not being listed in the module area and thus its have not be "installed."

 

Can anyone point me in the right direction and help me find what step I missed, if any?? I'd appreciate the help!!

 

-Jen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...