Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

paul: very good glad you were able to get it working from the install html file in the contrib.

 

Don't you find it interesting that in this topic, sort orders comes up about every 10 posts, and even 3 posts after Ron has said he read the entire thread, I really haven't figured out how any one could read this entire thread yet, can't seem to grasp that the sort order needs to be adhered to as described in this thread about 100 times now and in the install doc. I am not even going to put it down here now I have said it so many times. It just amazes me it is so hard to grasp and understand

(my knowledge is so small you would think that an ant was a genius in comparison)

Link to comment
Share on other sites

Strider:

 

Well I know, this sort-order-thing seems to be a major problem and I can very good understand that you get tired of telling the same thing over and over again.

 

I followed the instructions in the manual and I set the dort-order the way it was described.

 

What else can I do following the instructions?

 

Has someone else any hints, how to solve my problem?

 

Thanks to everyone in here.

 

Ron

Link to comment
Share on other sites

SORT ORDER! SORT ORDER! SORT ORDER!

 

:lol:

 

 

Anywho - I have my own problem. I explained it before, never got an answer other than "your code must be wrong." Well duh.

 

The problem is this:

 

Customer Voucher Balance isn't being deducted once a certain (any) amount is being used for a purchase. It still shows the same initial amount given from the start.

 

Any suggestions?

Link to comment
Share on other sites

Ron: the example sort order you gave is not the sort order in the manual. At least not in the current 5.10b manual. please refer to pauls example it is correct.

 

cdi-buy: Do you have a tick box on the checkout payment page? if not then it sounds like your sort orders are wrong and when the person checks the tick box then the system knows to use the gift voucher amount

(my knowledge is so small you would think that an ant was a genius in comparison)

Link to comment
Share on other sites

Everything works fine except for the part of deducting it from the amount available. I have the tick box and everything else works smoothly.

 

Edit:

 

Well I USED to have the tick box....it disappeared now. WTF?!?

Edited by cdi-buy.com
Link to comment
Share on other sites

Strider:

 

Paul says:

 

subtotal - 1

shipping - 2

tax - 3

gift vouchers - 9

discount coupons - 740

total - 900

 

 

The manual says:

 

If you have recalculate tax set to true then you should place the sort order as the following

 

 

Sub-total - Sort order = 1

Shipping - Sort order = 2

Gift Voucher - Sort order = 9

Discount Coupons - Sort Order =740

Tax - Sort order = 800

Total - Sort Order = 900

 

 

Which one is the right one, when I have to use the coupon as a credit note.

 

It seems like we can not figure this out here.

 

Can you give me a hint, where in the code all these values are being calculated. Then I will try to figure it out, what's going wrong.

 

Thanks, Ron

Link to comment
Share on other sites

I just noticed that my coupons aren't tracking. I've found one or two posts in the forums where others have had this problem, but they weren't much help as to how they resolved it. Anyone encounter this problem with your install of the mod?

 

When going through the code, I noticed that the only place it really checks the coupon_redeem_track table based on the customer is in ot_coupon.php. Should the apply_credit() function in ot_coupon.php also be where my insert should be happening? I'm not sure where in the checkout process that the insert into the coupon_redeem_track table should take place and what file is included that does the insert.

 

I am testing using the COD payment option so that I don't have to refund my cc every time I test (the site is live) and I am able to use the coupon over and over even though I have it set to 1 use per customer.

 

Any thoughts?? Thanks!!

Edited by krookeddave
Link to comment
Share on other sites

Hey everybody,

 

I found a solution for the problem of showing the wrong order-total.

 

THERE IS A HUGE BUG IN THE CODE !!!!!

Well at least in my version (which is the 510b)

 

Here it is:

 

File /catalog/includes/modules/order_total/ot_coupon.php

 

In Line 346:

 

        $order->info['total'] -= $tod_amount; //OLD

 

Someone figured already out that this is wrong and marked it as //old

but forgot to really remark it in front of the line.

 

It has to look like this:

 

//        $order->info['total'] -= $tod_amount; //OLD

 

And there is another bug:

 

Line 311:

 

// $ratio1 = $od_amount/$amount;  // this produces the wrong ratipo on fixed amounts

reset($order->info['tax_groups']);

while (list($key, $value) = each($order->info['tax_groups'])) {

$ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug

...

 

Someone changed that ratio1 calculation, but - assuming of the "//debug"-reminder - he wasn't sure about that change.

 

That change is wrong, because it calculates the ratio-factor of the coupon-incl-tax to the order-amount-excluding-tax. IT HAS TO BE EITHER OR with or without tax.

 

Here is the right code:

 

// $ratio1 = $od_amount/$amount;  // this produces the wrong ratipo on fixed amounts

reset($order->info['tax_groups']);

while (list($key, $value) = each($order->info['tax_groups'])) {

    $ratio1 = $od_amount/$amount;

...

 

I hope this is helpful for all who encountered the same problems.

 

Ron

Link to comment
Share on other sites

I have a few problems that I hope everyone can help me with :D

My site is: http://www.iPodXtras.com

1) When ever I have a popup window, the customer testimonial box seems to open in that window... What is wrong with my popup scripts? (any box not just a select few)

 

2)When I redeem a gift voucher or a coupon, no popup displays, and also, in the shopping cart box, it doesnt show what coupon you have redeemed... There is just this text...

Coupon : more info

the link for more info doesn't work either!

 

Also, I can't delete coupons that arent active... (And I can't change them to active either (with dates and stuff) ) When i go to all coupons, then click on the coupon, then click delete it takes me to the active coupon screen where it has the [ ] and should have the coupon number that it wants to delete but it doesnt have anything jsut the [ ] so i cant delete any coupons!

 

Thanks guys and gals (can't forget the gals)

Edited by mijman2
Link to comment
Share on other sites

Ron, My ot_coupon.php is different. The line numbers are different. Line 346 looks like this...

$order->info['total'] -= $tod_amount; // have to modify total also

 

But I have the mentioned line at line 324. Since this stuff is greek to me I don't want to start hacking stuff I don't understand. Perhaps somebody has a "fixed" ot_coupon.php thay are willing to share.

 

Nerd

Link to comment
Share on other sites

Hi,

 

I am really hoping that someone can help me out, as I have spent ages trying to fix this one. Sorry if it has already been answered before, but I just can't see anything.

 

The problem is that I want to enable the SSL part of osCommerce but if I install MS2 of it with CCGV 5.10b installed the site does not work properly.

 

I have installed just the 'out of the box' version of MS2 osCommerce and when you click on the My Account link or create an account the SSL connection works and I get all the IE dialogs and the padlock in the bottom.

 

If I take the standard MS2 and copy over all the files from CCGV 5.10b, adding the defines to the language and application_top files, the SSL connection does not work.

 

I get all the standard IE dialogs and the address in the bar says HTTPS://, but the padlock does not appear at the bottom of the browser window.

 

From right clicking on all the images on the pages, it would appear that the images are all being loaded from HTTP:// which means the page is only partly secure - hence no padlock.

 

I have also noticed that the SSL certificate also shows as the domain name not matching, even though it works with the standard build.

 

Does anyone know why this might happen? Is there a problem is the CCGV 5.10b code that makes all the images HTTP instead of HTTPS?

 

If any one can help if would be appreciated.

 

Thanks,

 

Anthony

Link to comment
Share on other sites

Please help.

I'm getting this error on my pages after I installed this:

 

Shopping Cart

1146 - Table 'animepun_catalog_ct.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

 

[TEP STOP]

 

I've put in the sql script and i checked that the table was there. what is the probleM?

 

any help will do. thanks in advanced.

 

mindy

Link to comment
Share on other sites

can someone please help me - i am trying to make a gift voucher site and i am having a couple of problems - i want to have my categories with sub categories of shops and then want to be able to click on one of those shops and from there select a gift voucher amount - then i want the user to see a gift voucher and be able to fill in an form like thing looking like a gift voucher with fields like to: from: message: ect - then to be able to either send to self or send to recipient, print, email to own email, or send it to me so i can physically mail it to the destination of their choice - will this Credit Class & Gift Voucher allow me to this and if not does anyone know of a system that will allow me to do it.

 

something to to likings of www[dot]giftvouchers[dot]com

 

thanx

Edited by sv452
Link to comment
Share on other sites

I know there may be an answer here but I can't search it out. So, need to ask repeated question. Sorry.

 

How do I change the word in the gift voucher email sent to customer?

 

I have tried edit the gv_send.php in english dir. And still getting the email with nothing changed. Please let me know what should I do in order to change word in gift voucher email. Thanks

Link to comment
Share on other sites

I am just starting to install this contribution and I ran across an extra line in checkout_process.php that wasn't marked with the //ICW.

 

The red line is not marked, but is not found in the default osC installation. Do I include it as part of this contribution? or just ignore it? It is at the bottom oc checkout_process.php.

 

  tep_session_unregister('comments');

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');

  $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM

 

  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 

  require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

Link to comment
Share on other sites

Am I missing something but are the installations instructions repeating the same steps. I am installing this Contribution step by step and I end up editing files that I have already changed. Has anyone else noticed this or am I missing something?

 

Joey

Link to comment
Share on other sites

I just read as much as I can here and didnt find one thing that I just realized is a problem.

 

When you restrict a coupon to a product or category...but then decide on a minimum...It actually only seems to check the total of the valid products to reach the minimum of the coupon. This shouldn't be.

 

Lets say I have X item valid and its a $10 item but I want the coupon to have a $30 minimum to reach that deal...well it only sees the $10 total and wont allow the coupon to work even if I have $50 worth in my cart. If I wanted to make only the valid product or category a $10 minimum than I would set that.

 

I been looking at the code for a couple hours and cant seem to get it right.

 

 

 ? // OK thats fine for global coupons but what about restricted coupons 
? ?// where you can only redeem against certain products/categories.
? ?// and I though this was going to be easy !!!
? $coupon_query=tep_db_query("select coupon_code ?from " . TABLE_COUPONS . " where coupon_id='".$cc_id."'");
? if (tep_db_num_rows($coupon_query) !=0) {
? ? $coupon_result=tep_db_fetch_array($coupon_query);
? ? $coupon_get=tep_db_query("select coupon_amount, coupon_minimum_order,restrict_to_products,restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code='".$coupon_result['coupon_code']."'");
? ? $get_result=tep_db_fetch_array($coupon_get);
? ? $in_cat = true;
? ? if ($get_result['restrict_to_categories']) {
? ? ? $cat_ids = split("[,]", $get_result['restrict_to_categories']);
? ? ? $in_cat=false;
? ? ? for ($i = 0; $i < count($cat_ids); $i++) {
? ? ? ? if (is_array($this->contents)) {
? ? ? ? ? reset($this->contents);
? ? ? ? ? while (list($products_id, ) = each($this->contents)) {
? ? ? ? ? ?$cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'");
? ? ? ? ? ? if (tep_db_num_rows($cat_query) !=0 ) {
? ? ? ? ? ? ? $in_cat = true;
? ? ? ? ? ? ? $total_price += $this->get_product_price($products_id);
? ? ? ? ? ? }
? ? ? ? ? }
? ? ? ? } ? ? ?
? ? ? } ? ? ? ? ?
? ? }
? ? $in_cart = true;
? ? if ($get_result['restrict_to_products']) {

? ? ? $pr_ids = split("[,]", $get_result['restrict_to_products']);

? ? ? $in_cart=false;
? ? ? $products_array = $cart->get_products();

? ? ? for ($i = 0; $i < sizeof($pr_ids); $i++) {
? ? ? ? for ($ii = 1; $ii<=sizeof($products_array); $ii++) {
? ? ? ? ? if (tep_get_prid($products_array[$ii-1]['id']) == $pr_ids[$i]) {
? ? ? ? ? ? $in_cart=true;
? ? ? ? ? ? $total_price += $this->get_product_price($products_array[$ii-1]['id']);
? ? ? ? ? }
? ? ? ? } 
? ? ? }
? ? ? $order_total = $total_price; ? ? ? ? 
? ? }
? }
? return $order_total;
?} ?

 

It is most likely here but I havent found out yet how to correct this.

 

Please Please Please help me out.

Edited by defender39
Link to comment
Share on other sites

Ok I think I have it.

 

 ? ? if ($get_result['restrict_to_products']) {

? ? ? $pr_ids = split("[,]", $get_result['restrict_to_products']);

? ? ? $in_cart=false;
? ? ? $products_array = $cart->get_products();

// ? ? ? for ($i = 0; $i < sizeof($pr_ids); $i++) {
// ? ? ? ? for ($ii = 1; $ii<=sizeof($products_array); $ii++) {
// ? ? ? ? ? if (tep_get_prid($products_array[$ii-1]['id']) == $pr_ids[$i]) {
// ? ? ? ? ? ? $in_cart=true;
? ? ? ? ? ? ? $total_price += $order_total;
// ? ? ? ? ? }
// ? ? ? ? } 
// ? ? ? }
? ? ? $order_total = $total_price; ? ? ? ? 
? ? }
? }
? return $order_total;
?} ?

 

I commented out the lines that add up the products. Then I changed

 

 ? ? ? ? ? ? $total_price += $this->get_product_price($products_array[$ii-1]['id']);

 

to:

 

               $total_price += $order_total;

 

I guess that's about as clean as I can make it. It seems to work as I want and I tested against a few things and it seems ok.

Edited by defender39
Link to comment
Share on other sites

Strider:

 

Paul says:

 

subtotal - 1

shipping - 2

tax - 3

gift vouchers - 9

discount coupons - 740

total - 900

 

 

The manual says:

 

If you have recalculate tax set to true then you should place the sort order as the following

 

 

Sub-total - Sort order = 1

Shipping - Sort order = 2

Gift Voucher - Sort order = 9

Discount Coupons - Sort Order =740

Tax - Sort order = 800

Total - Sort Order = 900

 

 

Which one is the right one, when I have to use the coupon as a credit note.

 

It seems like we can not figure this out here.

 

Can you give me a hint, where in the code all these values are being calculated. Then I will try to figure it out, what's going wrong.

 

Thanks, Ron

Hi Ron,

Just look at this link where Strider has answered the question to Priest about correct sort order

 

http://www.oscommerce.com/forums/index.php?sho...ic=52161&st=790

 

In that he says that sort order for Gift Voucher -> 740 and for Discount Coupon-> 9

 

I have put this sort order and i get the checkbox to tick to use gift voucher amount during shopping.

 

But in the manual it says that sort order for Gift Voucher ->9 and for Discount Coupon ->740

 

I tried this too but i did not get the checkbox to tick to use gift voucher amount during shopping even though i had gift voucher amount balance.

 

So I think that maybe there might be some mistake in specifying the sort order in the manual

 

Maybe strider would like to comment on this

Link to comment
Share on other sites

Hi, hoping for some help - had this contribution singing along and love it - I am just about to add all my products in as I now have all the contributions I want loaded and working - except.

 

Since adding members discount/gift wrap or Customer Loyalty Scheme - not sure which one - I now get the following problems with my GV Contribution -

 

1. Even though I have Welcome discount coupon to new customers - set to send a 20% dicount to new customers that sign up - this is not happening now - it has worked in the past.

 

2. I have 'enable downloads' - true in my store config setup and Gift voucher weight set to 'o' but I am being charged shipping for my Gift Vouchers - it has also wored in the past.

 

I just need some direction as to where to look as I have tried to use 'Beyond Compare to look at the files from the CCGV install and my current install and nothing seems to be different so It must be some other settings some where.

 

I really want to get all of these working together so if anyone can give me any clues it would be greatly appreciated.

 

thanks in advance.

 

Maria

 

you can test it at http://www.scrapboxx.com

 

cheers!

Link to comment
Share on other sites

Hello,

 

me again - in reference to point 1. in my previous post

1. Even though I have Welcome discount coupon to new customers - set to send a 20% dicount to new customers that sign up - this is not happening now - it has worked in the past.

 

Sorry this is working I just had a glitch in my new account setups!

 

but still have problem number 2.

2. I have 'enable downloads' - true in my store config setup and Gift voucher weight set to 'o' but I am being charged shipping for my Gift Vouchers - it has also worked in the past.

 

so any help would be appreciated.

 

thanks

 

Maria

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