Jump to content
Sign in to follow this  
Ian

[Contribution] Credit Class & GV v4.2 (MS1)

Recommended Posts

About bloody time I here you say. :lol:

 

Changes from v4.1

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

 

Most importantly the code is now based on the osCommerce MS1 release.

I've tried to make sure that all text is now in language files, and not hardcoded. The same goes for

database table names. If I've missed anything let me know.

 

Thanks to gdfwilliams, I've done away with separate box to show the amount in a customers Gift Voucher Account.

This is now shown in the shopping cart box.

 

The code now uses the get_content_type function to skip shipping selection if the Gift Voucher is the only item

in the cart. (Thanks to Thomas Plankers)

 

The decision to queue purchases of Gift Vouchers is now set in admin rather than having to edit a DEFINE in

add_application_top.php

 

I've also included some diff files to make life easier as well.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

HiyaIan

 

Thanks for the update to Credit Class. Your hard work is very much appreciated by all.

 

I am running Loaded 5 , do I need to update to Credit Class 4.2?

Share this post


Link to post
Share on other sites

Ian,

 

Is it possible to have a single box that contains only the "Redeem Gift Voucher" link and the "Send Gift voucher" from categorie menu.

 

I think having the "redeem gift voucher" link in the information box doesn't stand out. I would like the gift voucher system to stand out as I want to encourage clients to use this feature.

 

 

regards

 

timp

Share this post


Link to post
Share on other sites

I also wanted to drop in and say I have added an image package to this contribution which can be used to make all the gift voucher images you want. There are some default usd amounts in there as well as 2 photoshop documents that you can edit.

 

linkified: gv_images.zip (220k)

 

Have fun with them (not too much fun mind you).

Share this post


Link to post
Share on other sites

I HAVE A PROBLEM, CANY ANYBODY HELP?

 

Hiya, whenever I confirm a "send GV to customer" from the admin, the GV send except displays a blank white page, I have to press Back to get back to the Admin...

 

How do I sort this?

 

Thanks,

Warren

Share this post


Link to post
Share on other sites

I think there are some files missing in this package. I have carefully installed the package and it is not working for me. the gv_ tables are not getting updated. I am currently working on looking at the loaded 5 & 4.1 vs. 4.2 to see if I can help confirm & fix some bugs.

 

I shall return!

Share this post


Link to post
Share on other sites

Same problem here, with complete fresh install, the gv_ tables are not being updated with the purchase of gift vouchers.

Share this post


Link to post
Share on other sites

^ Whoops nevermind, forgot to enable it in orders_total module in admin... :oops:

 

Great job Ian!

Share this post


Link to post
Share on other sites

Same here! I did notice a few things though,

 

send_gv & send_gv_process are now not needed.

 

Also not needed but included is the code to include the gift_voucher.php box in column_right.php.

 

In several of the language gv_FILENAME's are the defines for NAVBAR_TITLE_1 when the cooresponding gv_FILENAME in /catalog uses NAVBAR_TITLE (w/o the '_1') which means breadcrumbs are broken.

 

One thing I personally would LOVE is if you and osmosis (Pablo Pasqualino) could get together and formulate some way of working with PayPal to auto-que the use of the voucher with PayPal.. As it is right now.. if the customer checks the "Tick to use Gift Voucher account balance" and then uses PayPal . The voucher account gets deducted even if the user doesn't complete the purchase. Which basically is lost with no hope of return without sending a customer a new voucher.. but there isn't really an audit trail available for you to verifiy this! without some order history diging.

 

How exactly do the gift vouchers work if say the total is less than the amount in the voucher account?? I see that the voucher account just goes down by the total amount.. but does the selected payment method code still run??

Share this post


Link to post
Share on other sites

Hi all,

I'm having a little problem with the gv system v 4.2 with an otherwise vanilla ms1 installation. My state charges 6.25% sales tax. when a customer uses his voucher account to pay for a purchase, the full amount is deducted (incl tax) The customer is left with a voucher balance of say 5.9976.(according to the database) This displays to the customer as a balance of $6.00. If he then trys to send a voucher for 6.00 of course this fails. I'm sure there is just a round() call missing somewhere, but I need help finding it. What function(s) figure out and deduct purchases from the balance?

 

Thanks,

Mike

Share this post


Link to post
Share on other sites

Hey I just wanted to confirm this bug Mike has found. I have tested this and it is as stated. Perhaps if you only deal in USD, you could simply modify the gv_customer table 'amount' structure to a 2 decimal place integer. This should solve that problem! Of course then your customer with 5.9976 in their GV account now only has $5.99 instead of $6.00.

Share this post


Link to post
Share on other sites

Hi Guys,

 

I'm new to osCommerce, but have installed and have loaded Ian's GV 4.2

 

I'm not a programmer, but I followed the instructions and have installed perfectly......Don't seem to find any of the problems anyone else has mentioned....

 

Only minor bug was the reference to voucher.php in Right Column....

 

Even I was able to remove the relevant Code.....

 

Thanks for the programme and everyones contributions......

 

Cheers

Chris :D


The distance between a Person's Dreams and their Accomplishments can only be measured my their Desire.

Share this post


Link to post
Share on other sites

By the way, I also learnt how to spell measured and select and Avatar!!!

 

Mmm Donuts!!!


The distance between a Person's Dreams and their Accomplishments can only be measured my their Desire.

Share this post


Link to post
Share on other sites

I still have the problem of that when ever i send a gv - the page diverts to a blank one, but the voucher send ok!!

Share this post


Link to post
Share on other sites

I just installed the GV 4.2 and am testing it. I have no problems with it by sending a Voucher to an email, and then being able to come back and redeem it.

 

My only problem is that when I purchase a Voucher, it is not recognized as a voucher and gets processed as a regular product. I think maybe this is caused by the way I set up the voucher as a product.

 

As I said, I am just Testing. I have the PRODUCTS NAME = GIFT and the PRODUCTS MODEL = GIFT (I was unsure which one was supposed to have the GIFT code.) I have PRODUCTS QUANTITY = 100 and PRODUCTS PRICE = 25.00

 

Is this wrong? I don't understand why it's not being understood and processed as a Voucher when purchased.

 

Thanks,

Priest

Share this post


Link to post
Share on other sites

Right Ok - I have fixed my problem with the blank screen!

 

But noticed this:

 

When a customer buys a gift voucher - (I use the immediate setting) - shouldnt this then be placed somwhere in admin to see which code they were given, when they bought it etc?

Share this post


Link to post
Share on other sites

No,

 

Remember when someone buys a gift voucher, there is no code associated with it. The amount purchased is simply added to there GV account.

 

If a Gift Voucher is subsequently emailed out by that customer, then an entry is created in the GV tracking table.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

I've been messing with the tax problem I found earlier. It seems to be more of an OSC problem than a GV problem. Anyway here's my fix

 

in ot_gv.php:

 

    function process() {

     global $order, $currencies;

     if ($GLOBALS['c_' . $this->code]) {

       $order_total = $this->get_order_total();

       $od_amount = $this->calculate_credit($order_total);

       $this->deduction = $od_amount;

       if ($this->calculate_tax == "true") {

         $tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction);

         $od_amount = $this->calculate_credit($order_total - $tod_amount);

       }

       $order->info['total'] = $order->info['total'] - $od_amount;

       $this->output[] = array('title' => $this->title . ':',

                        'text' => '<b>' . $currencies->format($od_amount) . '</b>',

                        'value' => $od_amount);

       $this->deduction = tep_round($od_amount,TAX_DECIMAL_PLACES); //added by mfc to keep gv accounts 'clean'  This amount used by apply_credit later



     }  

   }

I added only the last line. I can't forsee any problems doing it this way, but I'm new at OSC. Anyone have any thoughts... Ian...

 

Regards,

Mike

Share this post


Link to post
Share on other sites

I read that the "The decision to queue purchases of Gift Vouchers is now set in admin rather than having to edit a DEFINE in

add_application_top.php" is the install file....Can someone point me to where in Admin I can find the setting for queue purchases? I just can't seem to find it. Thanks.

Share this post


Link to post
Share on other sites

In admin->modules->order_total->.

 

Click on the Gift Voucher Entry, then on edit in the right side box. You'll find the option newar the bottom of the box.

 

HTH


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Thanks Ian for your reply...Unfortunately, it's not there! I was running the loaded 5 version which I assume had the 4.1 version, so I put the 4.2 version on and it was working great...Just can't figure out why the Queue selection isn't showing up. I doublechecked the ot_gv.php file to make sure the Queue settings were present and they are...Any other ideas on what I can look for to figure out why this isn't appearing? Many thanks.

Share this post


Link to post
Share on other sites

If you ever replace a payment/shipping/order_total module always disable the module first then re-enable after replacing.

 

That's the safest way. You should be all right just diabling the Gift Voucher module then re-enabling. The new option(s) should then appear.

 

Remember to note your settings before disabling as these will be reset.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×