Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Converting Points and Rewards system for osC BS


Tsimi

Recommended Posts

@Tsimi,

I'm a bit busy today. I'll have a deeper look on the entire issue in both pages when I find some time. Maybe there is a solution without core changes or at least with hooks.

Link to comment
Share on other sites

7 minutes ago, raiwa said:

@Tsimi, @LeeFoster,

I had a look and believe that the first snippet can be moved to the ht, it doesn't matter when "customer_shopping_points_spending" is registered in session, or am I wrong?

I integrated it to the ht, can you please check.

The second modification, can you explain for what is this needed? Maybe no payment module needed to be selected if order total is covered by points? Then it would need to be done in checkout_confirmation indeed.

 

I tried the new ht module and the bug is back. 

Link to comment
Share on other sites

@LeeFoster, OK, I'll recheck, you updated also checkout_confirmation.php?

Just now, LeeFoster said:

I tried the new ht module and the bug is back. 

 

Link to comment
Share on other sites

@Tsimi, @LeeFoster,

OK, you are right, this can't be moved to ht neither the second part to hook. I updated checkout_confirmation with the fixes, but joined together both changes. So ther eis only one mod to apply in the core file. It works for me. Can you please confirm.

Link to comment
Share on other sites

@LeeFoster

Regarding fix for Bug 6, I added your code change into the redemptions.php file and it does work and the points are showing now.
The only thing I found disturbing is that it says Expire date:  and next to it nothing since we haven't set any expire date. So I changed a bit of code inside the my_points.php to hide it if customers_points_expires is NULL.

Additional to your code change inside the redemptions.php edit the following inside the my_points.php file

FIND:

<?php echo '<strong>' . MY_POINTS_EXPIRE . '</strong> ' . tep_date_short($expires['customers_points_expires']); ?>

REPLACE WITH

<?php if (tep_not_null($expires['customers_points_expires'])) {
	echo '<strong>' . MY_POINTS_EXPIRE . '</strong> ' . tep_date_short($expires['customers_points_expires']); 
}
?>

Fix for Bug 4 works like a charm, thanks. :smile::thumbsup:

Edited by Tsimi
Link to comment
Share on other sites

Just now, Tsimi said:

@LeeFoster@LeeFoster

Regarding fix for Bug 6, I added your code change into the redemptions.php file and it does work and the points are showing now.
The only thing I found disturbing is that it says Expire date:  and next to it nothing since we haven't set any expire date. So I changed a bit of code inside the my_points.php to hide it if customers_points_expires is NULL.

Additional to your code change inside the redemptions.php edit the following inside the my_points.php file

FIND:


<?php echo '<strong>' . MY_POINTS_EXPIRE . '</strong> ' . tep_date_short($expires['customers_points_expires']); ?>

REPLACE WITH


<?php if (tep_not_null($expires['customers_points_expires'])) {
	echo '<strong>' . MY_POINTS_EXPIRE . '</strong> ' . tep_date_short($expires['customers_points_expires']); 
}
?>

 

Yeah I had the same issue, just hadn't gotten round to fixing it yet. 

Link to comment
Share on other sites

1 hour ago, Tsimi said:

If no one is assigned for it yet, I'll take the information box module.

@Tsimi, OK :thumbsup:

@Tsimi, @LeeFoster,

I was thinking about the modifications in checkout_payment.php and checkout_confirmation.php for bug fix 2.

My idea:

- create a real payment module called "points" (copy of "cod" module)

- show it only if available points value >= order total

- in that case, not show the tick box "redeem points" and change the info text to something like: "If you wish to pay the order with your points, select "Points" as a payment ...blablabla...

- session register 'customer_shopping_points_spending' in checkout_confirmation.php in ht module.

- remove bug2 fix modifications from checkout_confirmation.php

- leave "required aria-required=true" in the payment module coding in checkout_payment.php

- remove script in checkout_payment.php

- remove modification in payment class

- all other functionality for redeem points if less than order total as is.

 

Could this work?

Link to comment
Share on other sites

20 minutes ago, raiwa said:

@Tsimi, OK :thumbsup:

@Tsimi, @LeeFoster,

I was thinking about the modifications in checkout_payment.php and checkout_confirmation.php for bug fix 2.

My idea:

- create a real payment module called "points" (copy of "cod" module)

- show it only if available points value >= order total

- in that case, not show the tick box "redeem points" and change the info text to something like: "If you wish to pay the order with your points, select "Points" as a payment ...blablabla...

- session register 'customer_shopping_points_spending' in checkout_confirmation.php in ht module.

- remove bug2 fix modifications from checkout_confirmation.php

- leave "required aria-required=true" in the payment module coding in checkout_payment.php

- remove script in checkout_payment.php

- remove modification in payment class

- all other functionality for redeem points if less than order total as is.

 

Could this work?

This would be the preferred option, I considered doing it but I don't know enough about how to do it. 

Link to comment
Share on other sites

@raiwa

Sounds logical and could work with far less complications. Burt also used a custom payment module in his version and it worked pretty good.

That new points payment module should only show if the complete order can be covered by points else keep the current style with tick box for points available and regular payment method selection. Would something like that be possible without creating too complicate code? If yes then definitely go for it.

Edited by Tsimi
Link to comment
Share on other sites

@Tsimi, I believe it's not too complicate. Just add the condition "available points value >= cart total" to the enable check of the payment module.

(I didn't use real code, just conceptual)

Link to comment
Share on other sites

@Tsimi, @LeeFoster, shall I give the payment module and related updates a try?

 

Can you please have a look and check the modified my_points_help.php.

I believe the option " Enable Products Model Restriction " could be removed. "Enable Categories ID Restriction" should do it. Your thoughts?

Link to comment
Share on other sites

3 hours ago, raiwa said:

@Tsimi, @LeeFoster, shall I give the payment module and related updates a try?

Yes, please go ahead.

Why not keep the model number restriction? Maybe a shop owner wants to restrict the use of points on certain products and therefore use model number? With categories id you restrict the whole category and not only 1 product?

Link to comment
Share on other sites

42 minutes ago, Tsimi said:

Why not keep the model number restriction? Maybe a shop owner wants to restrict the use of points on certain products and therefore use model number? With categories id you restrict the whole category and not only 1 product?

I thought this too but couldn't work out how it worked.

Link to comment
Share on other sites

@Tsimi, @LeeFoster,

 

There are model (only one model possible) and product id (array list) to do the same. I mean only product id's (array) would do it.

Category id's are another subject.

Edited by raiwa
Link to comment
Share on other sites

44 minutes ago, Tsimi said:

Had a look at your new my_points_help files and at first it does look all good.
But if I change anything in the admin the Last updated: date doesn't change to todays date. Here we have 15.9.2017

@Tsimi, it seems this is a core bug. Not any module (config group 6) updates the last_modified entrance in the database when a setting is changed. Other configuration entries do update the last modified date.

I'll have a look if there is a possibility to trigger the update from the ht module.

Otherwise we could revert back and use the standard configuration entries like in your original ot module.

Edited by raiwa
Link to comment
Share on other sites

@Tsimi, @LeeFoster,

It seems there is no mechanism to update the modification dates in the modules config group 6.

I believe the easiest way without touching core, would be to revert the configuration entries to Tsimis version, standard config entries under admin -> configuration in the ot module, as it was already done and revert the configuration constants. I would only add the optional database delete setting.

Sorry wasn't aware of this, I never used last modification date in any contribution.

Any other ideas?

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