Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Nevermind, i fixed the problem, if anyone has a simmilar problem, here's the fix.

 

find

 

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="specialPrice" align="right">NOTICE: <a href="<?php echo tep_href_link( DIR_WS_LANGUAGES.$language.'/'.FILENAME_DISCOUNT_COUPONS_MANUAL ).'">'.HEADING_TITLE_VIEW_MANUAL; ?></a></td>

 

replace with

 

<table>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="specialPrice" align="right">NOTICE: <a href="<?php echo tep_href_link( DIR_WS_LANGUAGES.$language.'/'.FILENAME_DISCOUNT_COUPONS_MANUAL ).'">'.HEADING_TITLE_VIEW_MANUAL; ?></a></td>

Link to comment
Share on other sites

I had an error as below in checkout_confirmation.php

"1146 - Table 'dddddd_rrrrrrr.discount_coupons_to_customers' doesn't exist

 

SELECT dc2u.customers_id FROM discount_coupons_to_customers dc2u WHERE customers_id=3 AND coupons_id="0000000"

 

What should I do to fix this?

 

Thanks...

Link to comment
Share on other sites

Run the .sql file included in the install.

Go to phpadmin, choose 'sql' and import and execute the sql statements.

 

Wiljo

 

Thanks for reply. I tried to import installer.sql. I had an error as "#1050 - Table 'discount_coupons' already exists ".

Link to comment
Share on other sites

Thanks for reply. I tried to import installer.sql. I had an error as "#1050 - Table 'discount_coupons' already exists ".

This could well be as the error message was referring to another table (discount_coupons_to_customers).

Did you check if the table mentioned in the error message really exists in php admin?

If not, edit the .sql file so that only the part regarding discount_coupons_to_customers remains and then run it.

You could also remove all tables belonging to dcc and re-run the whole .sql.

 

Wiljo

Link to comment
Share on other sites

This could well be as the error message was referring to another table (discount_coupons_to_customers).

Did you check if the table mentioned in the error message really exists in php admin?

If not, edit the .sql file so that only the part regarding discount_coupons_to_customers remains and then run it.

You could also remove all tables belonging to dcc and re-run the whole .sql.

 

Wiljo

 

I tried to import discount_coupons_to_customers table but I had a message as below :

#1050 - Table 'discount_coupons_to_customers' already exists

But it doesn't seems in the database tables. :(

I had more than a hundred discount coupon. Some of them were used. :( So, I can't remove all tables. I have to find something else to do.

Link to comment
Share on other sites

I tried to import discount_coupons_to_customers table but I had a message as below :

#1050 - Table 'discount_coupons_to_customers' already exists

But it doesn't seems in the database tables. :(

I had more than a hundred discount coupon. Some of them were used. :( So, I can't remove all tables. I have to find something else to do.

Ok hard to judge from here.

It may have been created by running the .sql as you said you did in your post from 17.48. In that case the table will be empty (no records in it in phpmyadmin).

 

You mention now that you had coupons that were used. This implies that the table has existed before, otherwise the discount coupons must always have resulted in this error msg. What did you change then so that your got this msg in the first place?

 

I'm sorry to say but based on this info I'm not sure I can help you further.

 

regards,

 

Wiljo

Link to comment
Share on other sites

I just tried to install this to an oscommerce 2.2MS2. Everything in the install went through fine.

 

WHen I click on catalog>Discount Coupons I get the error:

 

Fatal error: Cannot redeclare tep_get_categories_name() (previously declared in /home/blackmar/public_html/cart/admin/includes/functions/general.php:52) in /home/blackmar/public_html/cart/admin/includes/functions/coupons.php on line 37

 

 

Ive checked and rechecked all the files etc are correct. I even tried installing 3.33 and I get the same problem.

 

Can anyone help? Ive spent all day trying to get this to work with no luck.

 

 

line 52 in general.php

function tep_get_categories_name($cID, $language = ''){

 

Line 37 in coupons.php

'".$coupons_id."',

Link to comment
Share on other sites

Hello,

 

For (dutch) people who are using this contribution (in OSC v2.2) and get the following error when paying with iDeal:

 

* hoeveelheid moet een geldig nummer zijn.

 

Add the following line to catalog/includes/classes/order.php:

$this->info['subtotal'] = round($this->info['subtotal'],2);

Right beneath:

if( is_object( $this->coupon ) ) {
       $applied_discount = 0;
       $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );
       if( $discount['applied_discount'] > 0 ) $valid_products_count++;
       $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );
       $this->info['subtotal'] += $shown_price['shown_price'];
       $shown_price = $shown_price['actual_shown_price'];
       //ADD HERE

Edited by HartmanMedia
Link to comment
Share on other sites

Great Contribution! It was exactly what I was looking for.

 

I'm having a couple of troubles with the coupons. The biggest issue is that after the installation my home page looks like that:

home page.jpg

 

As you can see the Advanced Search, the Shipping Information and the Cart shouldn't look that way, do you know how to change that without uninstalling the coupon contribution?

 

the other issue I have is that the coupons, once created, they are not applied. We use Paypal as checkout and teh "enter coupon code" appears on the payment info page, but once you click continue it redirects to PayPal and then the coupon is not applied on the total price. Do you know how to solution that?

 

Thank you a lot!

 

BERTA

Link to comment
Share on other sites

Great Contribution! It was exactly what I was looking for.

 

I'm having a couple of troubles with the coupons. The biggest issue is that after the installation my home page looks like that:

home page.jpg

 

As you can see the Advanced Search, the Shipping Information and the Cart shouldn't look that way, do you know how to change that without uninstalling the coupon contribution?

 

the other issue I have is that the coupons, once created, they are not applied. We use Paypal as checkout and teh "enter coupon code" appears on the payment info page, but once you click continue it redirects to PayPal and then the coupon is not applied on the total price. Do you know how to solution that?

 

Thank you a lot!

 

BERTA

Berta,

 

this is a language problem. The items you mention are apparently not 'defined' in your language files. Have you maybe replaced your language file instead of adding the dcc code to them?

Go back to your backup file and change this with the items in the installation instruction provided with the dcc module.

 

regards,

 

Wiljo

Link to comment
Share on other sites

Everything seems to work just fine, but the coupons created doesn't do anything. You put the code on the checkout and nothing happens. The price is still the same.

 

Do you know which can be the problem?

Link to comment
Share on other sites

Berta,

 

this is a language problem. The items you mention are apparently not 'defined' in your language files. Have you maybe replaced your language file instead of adding the dcc code to them?

Go back to your backup file and change this with the items in the installation instruction provided with the dcc module.

 

regards,

 

Wiljo

 

Thanks Wiljo!

 

The error is gone and it seems that everything is working now!

Link to comment
Share on other sites

Everything seems to work just fine, but the coupons created doesn't do anything. You put the code on the checkout and nothing happens. The price is still the same.

 

Do you know which can be the problem?

 

It's me again :) I was looking into the forums and I cannot find anyone with these problem. I've created all kind of coupons, changed dates, percentage, amounts, etc but the discounts doesn't apply on the checkout process. The Discount Options are at true and everything seems to work fine, even it advise you when the coupon is wrong; but it doesn't rest any money.

 

If you could help me please :) !

Link to comment
Share on other sites

MagnetiKmania,

 

Have you used the debug function? It will show you what DCC is calculating.

 

Wiljo

 

Hi Wiljo I've tried with the debug Function in False and the Debug in True and all the other variables, taxes, etc

I've tried differents coupons but it doesn't give an error it just don't applied the coupon!

 

Thanks for your help,

 

BERTA

Link to comment
Share on other sites

Open the installation html file that comes with the contribution with your browser and follow the directions.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hi

There is a problem with diacritics in error red line.

If it has to be shown message declared as ENTRY_DISCOUNT_COUPON_ERROR or ENTRY_DISCOUNT_COUPON_USE_ERROR - all diacritical marks [Polish in this case] disapearing. I couldn't find a solution in this topic.

ver. 3.34 for 2.2

Link to comment
Share on other sites

  • 2 weeks later...

I can not get this to work been at it for days now and did all the mods as directed and still nothing. I go through checkout enter the code and it send me to PayPal with no discount. It also does not show any coupons being used. I am willing to pay a programmer to get this working and one other issue I have with the template. The Template came from Monster Templates and absolutely NO SUPPORT, not a peep after 24 hours.I am using os ver. 2.3 and the latest Coupon mod.

 

Thanks

Edited by BarnstormingRC
Link to comment
Share on other sites

I can not get this to work been at it for days now and did all the mods as directed and still nothing. I go through checkout enter the code and it send me to PayPal with no discount. It also does not show any coupons being used. I am willing to pay a programmer to get this working and one other issue I have with the template. The Template came from Monster Templates and absolutely NO SUPPORT, not a peep after 24 hours.I am using os ver. 2.3 and the latest Coupon mod.

 

Thanks

 

Hi, I am not sure if this is what you are needing as it has been quite some time since I installed this module and my memory is not good, but it may help. Anyway, check in your paypal_ipn.php file or whatever paypal file you use (under includes/modules/payment) and see if the following code is in there:

 

//kgt - discount coupons

if( tep_session_is_registered( 'coupon' ) && $order->info['coupon'] != '' ) {

$sql_data_array = array( 'coupons_id' => $order->info['coupon'],

'orders_id' => $order_id );

tep_db_perform( TABLE_DISCOUNT_COUPONS_TO_ORDERS, $sql_data_array );

}

//end kgt - discount coupons

 

In my file that comes after this:

 

tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

 

Then further down in that file make sure you have the discount coupon code in this section as well:

 

// unregister session variables used during checkout

tep_session_unregister('sendto');

tep_session_unregister('billto');

tep_session_unregister('shipping');

tep_session_unregister('payment');

tep_session_unregister('comments');

//kgt - discount coupons

tep_session_unregister('coupon');

//end kgt - discount coupons

 

tep_session_unregister('cart_PayPal_IPN_ID');

 

I hope that is some help. I must get some sleep now as I am very tired and hope that made sense. If that doesn't work I would suggest doing a search for the type of PayPal addon you use and see if the info is in that discussion to configure it with discount coupons.

Link to comment
Share on other sites

Thank you so much for help, i tried it and no go. I scrapped the paypal and went with Authorize.net. now the module actually shows on the checkout page but doubles the ammount LOLOL.

Link to comment
Share on other sites

Think i found a bug, in discount_coupon.php, function total_valid_products, there tax is calculated when DISPLAY_PRICE_WITH_TAX = true but an unknown array $tax_address is used causing tax to be always 0. So while the whole shop may be displaying prices with tax, the coupon-codes modules is calculating discounts always based on prices without tax (and then optionally adding tax again for displaying). All very confusing ...

Paul

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