Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

thank you deep-silver!

would it be difficult to eliminate the decimal from showing? i only want them to see the dollar amount they have

 

if it's much work, it's perfect the way it is :)

Link to comment
Share on other sites

thank you deep-silver!

would it be difficult to eliminate the decimal from showing? i only want them to see the dollar amount they have

 

if it's much work, it's perfect the way it is :)

replace this...(checkout_payment.php)

<td class="main" ><?php printf(TEXT_REDEEM_SYSTEM_SPENDING_ALL, number_format($max_points,2)); ?></td>

with this....

<td class="main" ><?php printf(TEXT_REDEEM_SYSTEM_SPENDING_ALL, $currencies->format($max_points*REDEEM_POINT_VALUE)); ?></td>

 

Now go to your language file and add it again to fit your needs(get rid of the points after the $dollar amount).

Done!

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

Link to comment
Share on other sites

oh sorry, i didn't mean remove the decimal from the system... just on the pages the user can see :)

 

so instead of seeing: You have 555.00 points, which is $2.00 (something like that)

 

they see:

You have a credit balance of $2.00, would you like to use it to pay for this order?

<small>Please note: If your total balance is greater than your credit amount, you will also need to choose a payment method.</small>

 

 

 

sorry, i should have made myself clearer :)

Link to comment
Share on other sites

oh sorry, i didn't mean remove the decimal from the system... just on the pages the user can see :)

 

so instead of seeing: You have 555.00 points, which is $2.00 (something like that)

 

they see:

You have a credit balance of $2.00, would you like to use it to pay for this order?

<small>Please note: If your total balance is greater than your credit amount, you will also need to choose a payment method.</small>

sorry, i should have made myself clearer :)

find this...

			   <td class="main" width="100%" colspan="3"><?php echo TEXT_REDEEM_SYSTEM_START . number_format($customer_shopping_points,2) . TEXT_REDEEM_SYSTEM_MIDDLE . $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points)) . '.'; ?></td>

and replace with....

			   <td class="main" width="100%" colspan="3"><?php echo  TEXT_REDEEM_SYSTEM_MIDDLE . $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points)) . '.'; ?></td>

fix your language file.

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

Link to comment
Share on other sites

the tax shown is not an income tax its the tax for the products..

in order to do what you want, you will have to mess up with the code and find a way to deduct the used points amount to the subtotal and not the total or use the store setting to display the tax only on checkout confirmation page.

 

Dear Deep Silver,

 

Can you please help me "mess up the code" that the point are deduct from subtotal?

 

I would be very very grateful :D

Link to comment
Share on other sites

Hi,

 

Just to say THANK YOU!!!

 

I would like to know how to limit the products that give points (Normal products as Well as Specials). Its that possible?

 

Deep Silver i have send you a pm, if you could, HELP ME!!!

 

Thanks in advance!! :D :thumbsup:

Link to comment
Share on other sites

Hi

First this contribution is great.

 

I'd like to translate it into spanish, but I'm not exactly a programmer, so, WHich files have to be changed? or where does the english text should be replaced.

 

Thanks, and I'll post the translation as soon as it is made.

 

Regards!

Link to comment
Share on other sites

mmmmmmm :(

.

You should also post here your server invairoment info.

the demo shop work on.

Linux, apache

PHP Version 4.4.1

 

Hello Deep Silver,

 

I feel it is more safe to E Mail the server INfo

which I have done yesterday. Did you get it

and have a chance to take a look.

Is there any setting which cause the issue ?

 

Cheers

Shred

Link to comment
Share on other sites

hello !!! :P

 

I am not a pro in php.

 

I installed OSC and I added this contribution for tested. :blush:

 

A great cheer with the originators of OSC and Such a great cheer with the originators of ### POINTS AND REWARDS MODULATES ### :thumbsup: :thumbsup:

 

A little long A instaler but very easy!!!! same for French who has difficulty with English and the php.

 

I have when same 2 small problem :-"

 

I have to make an error in one of the modification of the step by step. :blink:

 

Normally a new order total will appear called, " Points Redeemptions " in module/order total !!!

 

I have this error in the place :

 

Warning: main(): Unable to access /var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

 

Warning: main(/var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php): failed to open stream: No such file or directory in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

 

Warning: main(): Failed opening '/var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php' for inclusion (include_path='/var/www/free.fr/c/f/1500euros/include:.') in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

 

 

What do I have to modify?

 

-------------------------------------------------------------------

 

The other questions is : - how to correct this error ?

 

Caution: It is possible to write in the file of configuration: /var/www/sdc/8/c/www.rotabann/catalog/includes/configure.php. It is a fault of potential safety - want to correctly define the permissions of user for this file.

 

My hebergor of site is FREE.FR and the chmod is impossible on this FAI !

 

how then I to make?

 

 

thank you for your assistance

 

:thumbsup: :thumbsup:

Link to comment
Share on other sites

Hi,

 

Just to say THANK YOU!!!

 

I would like to know how to limit the products that give points (Normal products as Well as Specials). Its that possible?

 

Deep Silver i have send you a pm, if you could, HELP ME!!!

 

Thanks in advance!! :D :thumbsup:

You can't limit to 1 product, its have to be a group(category) or a group of products that has the same model.

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

Link to comment
Share on other sites

Hi

First this contribution is great.

 

I'd like to translate it into spanish, but I'm not exactly a programmer, so, WHich files have to be changed? or where does the english text should be replaced.

 

Thanks, and I'll post the translation as soon as it is made.

 

Regards!

there is a spanish translation on version v1.50, use that and just add one or two missing lines

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

Link to comment
Share on other sites

hello !!! :P

 

I am not a pro in php.

 

I installed OSC and I added this contribution for tested. :blush:

 

A great cheer with the originators of OSC and Such a great cheer with the originators of ### POINTS AND REWARDS MODULATES ### :thumbsup: :thumbsup:

 

A little long A instaler but very easy!!!! same for French who has difficulty with English and the php.

 

I have when same 2 small problem :-"

 

I have to make an error in one of the modification of the step by step. :blink:

 

Normally a new order total will appear called, " Points Redeemptions " in module/order total !!!

 

I have this error in the place :

 

Warning: main(): Unable to access /var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

 

Warning: main(/var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php): failed to open stream: No such file or directory in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

 

Warning: main(): Failed opening '/var/www/free.fr/c/f/1500euros/catalog/includes/languages/french/modules/order_total/ot_redemptions.php' for inclusion (include_path='/var/www/free.fr/c/f/1500euros/include:.') in /var/www/free.fr/c/f/1500euros/catalog/admin/modules.php on line 128

What do I have to modify?

 

-------------------------------------------------------------------

 

The other questions is : - how to correct this error ?

 

Caution: It is possible to write in the file of configuration: /var/www/sdc/8/c/www.rotabann/catalog/includes/configure.php. It is a fault of potential safety - want to correctly define the permissions of user for this file.

 

My hebergor of site is FREE.FR and the chmod is impossible on this FAI !

 

how then I to make?

thank you for your assistance

 

:thumbsup: :thumbsup:

1.INSTALL.txt steps 15 to 20, you have to repeat those steps for each language you have at your shop.

2. you have to add the new files to your other languages folder.

catalog/includes/languages/english/my_points.php

catalog/includes/languages/english/my_points_help.php

catalog/includes/languages/english/modules/order_total/ot_redemptions.php

3.

Caution: It is possible to write in the file of configuration:

you have to change the permission for catalog/includes/configure.php

to 644

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

Link to comment
Share on other sites

thanks!

 

now how can i get rid of the amount after TEXT_REDEEM_SYSTEM_START?

i can't find it in the lang file?

 

thank you so much for your help!!!

find this... in catalog/checkout_payment.php

				<td class="main" width="100%" colspan="3"><?php echo TEXT_REDEEM_SYSTEM_START . number_format($customer_shopping_points,2) . TEXT_REDEEM_SYSTEM_MIDDLE . $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points)) . '.'; ?></td>

and replace it with this.....

			   <td class="main" width="100%" colspan="3"><?php printf(TEXT_REDEEM_SYSTEM_START, $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points))); ?></td>

now in your catalog/includes/languages/english/checkout_payment.php

find this...

define('TEXT_REDEEM_SYSTEM_START', 'You have ');

and replace it with.....

define('TEXT_REDEEM_SYSTEM_START', 'You have a credit balance of %s ,would you like to use it to pay for this order?<br><small>Please note: If your total balance is greater than your credit amount, you will also need to choose a payment method.</small>');

now find and remove this line(same file)

define('TEXT_REDEEM_SYSTEM_MIDDLE', ' Shopping points with total worth ');

Thats it.

Edited by deep-silver

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

Link to comment
Share on other sites

Dear Deep Silver,

 

Can you please help me "mess up the code" that the point are deduct from subtotal?

 

I would be very very grateful :D

i really don't understand you.

There is no problem with the points and tax, as the tax shown is the correct tax in both cases.

because the tax is added to the product and to the shipping fee(in your case).

so when or store is set to display price include tax, the total items in cart are tax included prices

and the shipping fee is also include tax.

so if you add the amount of points(in euro)the the total you will get the same total as without the points.

the total shown is the amount the customers have to pay you after tax.

If you think that osCommerce shop calculete the Tax from the total,then you wrong.

its only look like that at the checkout_confirmation page.

the tax is calculeted when items added to cart so when a customers reach checkout_confirmation page.

the subtotal is include tax and your shipping is tax included also.

so the total is....

subtotal

+shipping

-points spend

= TOTAL

 

the tax display is the sum of the tax that added to the products and to the shipping fees.

and NOT the sum of the Total.

if you don't understand how its work then i really can't help you with this.

-------------------------------------------------------------------------------------------------------

 

anyway just to close this topics , I've made a few change to osCommerce core files just to fit your need.

What will it do.

It will deduct the points amount from the total in cart before tax calculation take place.

in result when a customers using points to pay for is order, the value of the points used is deducted directly from the products price.

Its involved with you additing

1.catalog/checkout_confirmation.php

2.catalog/includes/modules/order_total/ot_redemptions.php

3.catalog/includes/classes/order.php

 

you should back up those tree files before.

Be carefull when editing those file...

you can download the modified files from here

and last use it at your own risk.

as no responsibilty or future support for this.

good luck

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

Link to comment
Share on other sites

You can't limit to 1 product, its have to be a group(category) or a group of products that has the same model.

 

I cant figure out how to do that....

 

help me all products in my store give points

and i want to limit to one single category...

Link to comment
Share on other sites

1.INSTALL.txt steps 15 to 20, you have to repeat those steps for each language you have at your shop.

2. you have to add the new files to your other languages folder.

catalog/includes/languages/english/my_points.php

catalog/includes/languages/english/my_points_help.php

catalog/includes/languages/english/modules/order_total/ot_redemptions.php

3.

you have to change the permission for catalog/includes/configure.php

to 644

 

 

 

thank you deep-silver for your help :rolleyes:

 

I started again all the stages but the problem is always there.

 

In space administrateur/module total order , i have this :

 

screen_module_ordertotal.gif

 

or here

 

screen erreur module order total

 

and the members cannot buy products while paying with their points !!!

 

if I the module starts, the visitors obtain an error while arriving at the stage of the payment. Same if I place it between sub-total and the total...

 

Sorry to disturb you, but that would be very useful for me to make go this system.

 

---------------------------------------------------------------------------------

 

or the problem permission of the file catalog/includes/configure.php !!!

 

on my waiter (FREE.FR) it is not possible to change the permission of the file.

 

I must find another solution for securiser this page. :(

 

I have already delete the files "htaccess" for enter on the site and has the installation of OSC.

 

 

still thank you for your assistance :thumbsup:

Link to comment
Share on other sites

I have the some problem as "Lemos".

 

I only want 1 category of product to GIVE points and not all products.

 

At this point I can limit the product were to USE the Points form redemptions.

 

Am I doing something wrong ??? Or is what I want to do impossible with this contribution?

Link to comment
Share on other sites

i really don't understand you.

There is no problem with the points and tax, as the tax shown is the correct tax in both cases.

because the tax is added to the product and to the shipping fee(in your case).

so when or store is set to display price include tax, the total items in cart are tax included prices

and the shipping fee is also include tax.

so if you add the amount of points(in euro)the the total you will get the same total as without the points.

the total shown is the amount the customers have to pay you after tax.

If you think that osCommerce shop calculete the Tax from the total,then you wrong.

its only look like that at the checkout_confirmation page.

the tax is calculeted when items added to cart so when a customers reach checkout_confirmation page.

the subtotal is include tax and your shipping is tax included also.

so the total is....

subtotal

+shipping

-points spend

= TOTAL

 

Thank s :thumbsup:

 

Now we are getting somewhere

I modified the files that you told me

The result was like this:

modules5.jpg

 

It was almost what I want it so I change the code from order.php

$subindex++;
	  }
	}

##### Points/Rewards Module V1.60 BOF #######
  if(USE_REDEEM_SYSTEM == 'true') {
	$points_discount = (float)tep_calc_shopping_pvalue($customer_shopping_points_spending);
	$this->products[$index]['final_price'] = $this->products[$index]['final_price'] - $points_discount;
  }
##### Points/Rewards Module V1.60 EOF #######
	$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
	$this->info['subtotal'] += $shown_price;

	$products_tax = $this->products[$index]['tax'];

 

to this:

 

$subindex++;
	  }
	}
##### Points/Rewards Module V1.60 BOF #######
if(USE_REDEEM_SYSTEM == 'false') {
	$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
	$this->info['subtotal'] += $shown_price;
	}
	if(USE_REDEEM_SYSTEM == 'true') {
	$points_discount = (float)tep_calc_shopping_pvalue($customer_shopping_points_spending);
	$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'] - $points_discount;
	$this->info['subtotal'] += $shown_price;
  }
##### Points/Rewards Module V1.60 EOF #######
	$products_tax = $this->products[$index]['tax'];

 

The result was what I want it to be. I don t know did I modified the code correctly, but it seems to work.

modules7.jpg

 

There are two problem whit this modified version.

- The used points are not deduct from customer account

- The order is incorrect in admin side and the customer side. The deduct points do not show in the invoice

 

The radeemed point does not show

modules6.jpg

 

I hope that you can help me :blush:

Link to comment
Share on other sites

thank you deep-silver for your help :rolleyes:

 

I started again all the stages but the problem is always there.

 

and the members cannot buy products while paying with their points !!!

 

if I the module starts, the visitors obtain an error while arriving at the stage of the payment. Same if I place it between sub-total and the total...

 

Sorry to disturb you, but that would be very useful for me to make go this system.

 

---------------------------------------------------------------------------------

 

or the problem permission of the file catalog/includes/configure.php !!!

 

on my waiter (FREE.FR) it is not possible to change the permission of the file.

 

I must find another solution for securiser this page. :(

 

I have already delete the files "htaccess" for enter on the site and has the installation of OSC.

still thank you for your assistance :thumbsup:

AGAIN.

YOU SHOULD COPY THE NEW LANGUAGE FILES TO YOUR FRENCH FOLDER.

Do this.

download the module again.

open the zip file, there you will find a folder named New_files_only

drill inside this folder into

New_files_only\catalog\includes\languages\english\modules\order_total.php

and copy this file into your.......

catalog\includes\languages\french\modules\order_total

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

Link to comment
Share on other sites

I have the some problem as "Lemos".

 

I only want 1 category of product to GIVE points and not all products.

 

At this point I can limit the product were to USE the Points form redemptions.

 

Am I doing something wrong ??? Or is what I want to do impossible with this contribution?

To you and "Lemos". and all other who don't understand how to restric redeemption to a group.

Access your admin screen via your browser.

under configuration you will find a new group called Points/RewardsV1.60

here you can setup all sort of things (just read it please).

Find the setting that say this.....

Enable the products Restriction(row no.10),

select it and click the edit button, now set it to true. and click the update button.

now one row down (row no. 11 to 13) thoes rows give you the ability to choose what group of products give

points.

the first row say....

Restriction Products by model = only products that belong to the group that has the model(your model) are allowed.

this is the best setting as its 100% restiction even incase of mix cart.

Row no.12 say....

Or set Product ID Allowed. = Restriction Products by Product ID.

If Restriction enabled set a comma separated list of Products ID Allowed.

leave blank if restriction set to model.

so the script will check to see that the product_id in cart is allowed.

Row no.13 say....

Or set Category ID Allowed. = Restriction Products by Category ID.

If Restriction enabled set a comma separated list of Cpaths Allowed.

leave blank if restriction set to model.

the script check to see that the product in cart belong to the category ID allowed.

-----------------------------------------------------------------------------------------------------------------

now at the moment as i said , restriction by products id and catagory id not work on mix cart,

thats mean that if the customer has 2 products in cart and one of them is resticted products...

Restriction by model will not show the redeemtion box.

Restriction by products id or catagory id will show the box.(will not show if all products in cart are restricted).

 

So that mean, if you use the Restriction by products id or catagory id , the only way that the customers can

use the points to pay for it is one he buys the restricted product together with a none resticted products.

(a way to force customer to by another products).

-----------------------------------------------------------------------------------------------------------------------

AS far as restriction to points given.

You guys have to understand how this module is working.

the points earned for the money the customers spend in our store not the products.

so if he spend less he gets less.

So unless you use one of the above restriction full points will be given to the amount the customers pay.

1.Award points for shipping = Enable customers to earn points for shipping fees.

2.Award points for Tax = Enable customers to earn points for Tax.

3.Award points for Specials = Enable customers to earn points for items already discounted.

4.Award points for order with redeemed points = When order made with Redeemed Points. Enable customers to earn points for the amount spend other then points?

When set to false, customers will NOT awarded even if only part of the payment made by points.

---------------------------------------------------------------------------------------------------------------------------

now one more last thing to you and all other using this module.

The script design to auto update information shown at points and reward F&Q page.

so when first installing this module, you have to go true all the setting and click the update button.

unless the points and reward F&Q page will show an empty fiels in last updated.

this is very importent for the customers as well as for search engines robot to know when to refresh the stored information in refer to your site.

----------------------------------------------------------------------------------

Thats it, hope you all understand and happely use this module knowing its not 100% bullets proof.

and need more improvmend, but its a good start for commerce shops that want to popup sales.

one thing is for sure ,trust me on that as the customers LOVE IT

 

:thumbsup:

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

Link to comment
Share on other sites

Great Contribution Deep-Silver !

 

easy step-by-step documentation, incredible install.php , well working with coupons and gift voucher

 

it works !

 

Any possibility to reedeem the points and choose from products from a special category instead to have

points converted to money ? p.e. for 100 points you choose between product X and products Y, etc

f?r 200 points choose between product Z and product W.

 

Thank you again

 

Sincerely

 

Roberto

Link to comment
Share on other sites

AGAIN.

YOU SHOULD COPY THE NEW LANGUAGE FILES TO YOUR FRENCH FOLDER.

Do this.

download the module again.

open the zip file, there you will find a folder named New_files_only

drill inside this folder into

New_files_only\catalog\includes\languages\english\modules\order_total.php

and copy this file into your.......

catalog\includes\languages\french\modules\order_total

 

 

 

ok ok you say: ( open the zip file, there you will find a folder named New_files_only

drill inside this folder into

New_files_only\catalog\includes\languages\english\modules\order_total.php)

 

 

(order_total.php or ot_redemption.php) order_total.php does not exist in this file!!! is this normal ??? this file (New_files_only\catalog\includes\languages\english\modules\ this file is vaccum .... is this normality ????)

 

 

I added the file catalog\includes\languages\english\modules\order_total\ ot_redemption.php

 

in /catalog/includes/languages/french/modules/order_total/

 

and the admin page is posted correctly.

 

see

 

screen_module_ordertotal_%20fonction_ok.gif

 

 

but on the pages of purchase, there is no possibility for the member of paying with these points.

 

it would seem that I miss modifications, but which???

 

thank you for your help :rolleyes:

Link to comment
Share on other sites

i really don't understand you.

There is no problem with the points and tax, as the tax shown is the correct tax in both cases.

because the tax is added to the product and to the shipping fee(in your case).

so when or store is set to display price include tax, the total items in cart are tax included prices

and the shipping fee is also include tax.

so if you add the amount of points(in euro)the the total you will get the same total as without the points.

the total shown is the amount the customers have to pay you after tax.

If you think that osCommerce shop calculete the Tax from the total,then you wrong.

its only look like that at the checkout_confirmation page.

the tax is calculeted when items added to cart so when a customers reach checkout_confirmation page.

the subtotal is include tax and your shipping is tax included also.

so the total is....

subtotal

+shipping

-points spend

= TOTAL

 

Dear Deep Silver,

 

Thank you for your help :lol:

 

This is BEST Contributions and support is fantastic :thumbsup: :thumbsup:

 

The error that the point was not showing, was my careless. One code was missing in my installation.

 

payment.php

// Points/Rewards Module V1.60 BOF
		 //'  if (error == 1) {' . "\n" .
		   '  if (error == 1 && submitter != 1) {' . "\n" .
// Points/Rewards Module V1.60 EOF

Link to comment
Share on other sites

ok ok you say: ( open the zip file, there you will find a folder named New_files_only

drill inside this folder into

New_files_only\catalog\includes\languages\english\modules\order_total.php)

(order_total.php or ot_redemption.php) order_total.php does not exist in this file!!! is this normal ??? this file (New_files_only\catalog\includes\languages\english\modules\ this file is vaccum .... is this normality ????)

I added the file catalog\includes\languages\english\modules\order_total\ ot_redemption.php

 

in /catalog/includes/languages/french/modules/order_total/

 

and the admin page is posted correctly.

 

see

 

 

it would seem that I miss modifications, but which???

 

thank you for your help :rolleyes:

check your coding in refer to catalog/checkout_payment.php

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

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...