Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

I checked my email and the paypal express debug email says this:

 

$HTTP_POST_VARS:

 

ppecomments=

 

$HTTP_GET_VARS:

 

Dont know if this helps.....

 

Thanks...

 

Steven

Share this post


Link to post
Share on other sites

Hi,

 

Is it possible that the Shipping Date Chooser at some point was installed in your shop this would add a table delivery_date, to orders table in your database

 

http://addons.oscommerce.com/info/6178

 

You would need to either remove the code completely or fully install the addon

 

Regards

Joli

 

delivery_date


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

thanks for responding Joli...no, i have never added that to my shop.....i dont know what it could be..

Well it is looking for a table that seemingly does not exist you could download that contribution and compare the files that it changes with your own and remove the extra code. Guess the discount addon must have had an extra code in it.

 

Not 100% sure but installed the delivery_date myself a few months ago and that is the exact field he added in the database.!!!

Regards

Joli

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

@@tinker74 as @@joli1811 it looks like there is code for the delivery_date addon in your store. The error you posted above shows this...

 

As for the paypal issue - I have not had success making this discount coupon addon work with PayPal Express. I use PayPal Standard.

Share this post


Link to post
Share on other sites

@@tinker74 as @@joli1811 it looks like there is code for the delivery_date addon in your store. The error you posted above shows this....

 

Thanks greasemonkey.....but I have never used the delivery_date addon. The only addons I have installed are SEO urls, modular front page, social bookmarks......could any of these be messing with this?

 

I have paypal advanced but I can't seems to get it to work......

Share this post


Link to post
Share on other sites

@@tinker74 for the paypal standard module; in your admin go to modules, then payment, then in the top right corner of the page click the button for "install modules". PayPal Standard is included as standard with 2.3.x.x... You should see it listed as PayPal Website Payments Standard. Install it there and set it up...

 

Sorry, not sure about the delivery_date thing... Keep in mind, I'm not a coder... and there are MANY more here with MUCH more experience than I have - in fact some, like @@joli1811, have forgotten more about OsC than I've learned in the past 5 years running my own store... :)

 

If I were to guess; you have brought some code in your checkout_progress.php that was left over from the addon mentioned above while copy and pasting...

 

Good luck.

 

Share this post


Link to post
Share on other sites

Hi - I've just installed one of the versions of kgt discount codes (there appears to be at least two varieties available) and I can confirm that one of the downloads has code based on an install that has had the delivery date add-on previously installed.I think the manual install instructions were OK but if you ran a file comp between the add-on package and a vanilla osC then the delivery date stuff is apparent.I've attached a zip of a 2.3.3.4 install files with the kgt stuff copied in but minus the delivery date code - if you unzip it then run a file comp with your files then it should flag up the extra code so you can comment out or remove the extra code

Edited by Bob Terveuren

Share this post


Link to post
Share on other sites

Hi,

I use win merge to compare and notepad++ for editing it has a great search and find tool when looking for code lightweight and quick

 

Just installing the contribution now.

 

noticed first small bug with the datepicker in admin/coupons.php ( at least in the version I am using)

 

lines: 129 should be

 

<tr>

<td class="main" align="right" valign="top"><?php echo TEXT_DISCOUNT_COUPONS_DATE_START; ?> </td>

<td class="main"><?php echo tep_draw_input_field('coupons_date_start', ( !empty($cInfo->coupons_date_start) ? tep_date_short( $cInfo->coupons_date_start ) : '' ), 'id="coupons_date_start" size="10" maxlength="10"') . ' <small>(YYYY-MM-DD)</small>' ; ?></a></td>

</tr>

<tr>

 

will update as I go along

Regards

Joli

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

I found the easiest solution to this problem is add a field name "delivery_date" at the table "orders" in the oscommerce database

 

Works fine now.

Edited by tinker74

Share this post


Link to post
Share on other sites

I found the easiest solution to this problem is add a field name "delivery_date" at the table "orders" in the oscommerce database

 

Works fine now.

 

That'd work and a lot simpler than stripping out the old stuff - elegant!

 

I use Beyond Compare from Scooter Software - had it for years

Share this post


Link to post
Share on other sites

You will need to check out using a test account and see if the delivery date appears on checkout_shipping.php.

 

just in case the code is there it normally appears just above the comment box maybe you will need to comment out the code in this file so as not to confuse the customer!

 

Regards

Joli


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

@@greasemonkey

 

contribution greasemonkey 14 Dec 2013

 

http://addons.oscommerce.com/info/7644

 

Well thanks Scott for the contribution just to confirm working great on 2.3.3.4

 

Just the x 1 small typo ( as mentioned above) on admin/coupons.php which prevented on my setup the jquery date calender working

 

'id="coupons_date_start" size="10" maxlength="10"'

 

working on paypal_standard and paypal express although paypal express does not show the discount details just the total amount minus discount (which is correct)

 

Thanks again

Joli

 

PS: working also in combination with the better checkout (without account) contribution so happy days :thumbsup:


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

@@joli1811 thank you for finding the typo. I'm tied up doing my physical inventory for a couple days.

 

I'll update the addon over the weekend. Let me know if you have any success, or need any help, with PP Express. I'd love to get this working with Express.

Share this post


Link to post
Share on other sites

@@joli1811 is this correct? I've added to both the start date and end date... See below...

 

I've also striped all the code for delivery_date from the included files and updated the files to 2.3.3.4. I'll upload the package once confirmed...

 

         <tr>
           <td class="main" align="right" valign="top"><?php echo TEXT_DISCOUNT_COUPONS_DATE_START; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('coupons_date_start', ( !empty($cInfo->coupons_date_start) ? tep_date_short( $cInfo->coupons_date_start ) : '' ), 'id="coupons_date_start" size="10" maxlength="10"') ; ?></a></td>
         </tr>
         <tr>
           <td class="main" align="right" valign="top"><?php echo TEXT_DISCOUNT_COUPONS_DATE_END; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('coupons_date_end', ( !empty($cInfo->coupons_date_end) ? tep_date_short( $cInfo->coupons_date_end ) : '' ), 'id="coupons_date_end" size="10" maxlength="10"') ; ?></a></td>
         </tr>

Edited by greasemonkey

Share this post


Link to post
Share on other sites

Hi Scott,

 

Mine is slightly different (2.3.3.4.) best you compare I have uploaded the file.

 

I will also search out that paypal express module I have, he gives the discount and it appears on paypal but it is still missing the product description not the end of the world sure it could be tweaked a bit

 

 

 

 

<td class="main" align="right" valign="top"><?php echo TEXT_DISCOUNT_COUPONS_DATE_START; ?> </td>

<td class="main"><?php echo tep_draw_input_field('coupons_date_start', ( !empty($cInfo->coupons_date_start) ? tep_date_short( $cInfo->coupons_date_start ) : '' ), 'id="coupons_date_start" size="10" maxlength="10"') . ' <small>(YYYY-MM-DD)</small>' ; ?></a></td>

</tr>

<tr>

<td class="main" align="right" valign="top"><?php echo TEXT_DISCOUNT_COUPONS_DATE_END; ?> </td>

<td class="main"><?php echo tep_draw_input_field('coupons_date_end', ( !empty($cInfo->coupons_date_end) ? tep_date_short( $cInfo->coupons_date_end ) : '' ), 'id="coupons_date_end" size="10" maxlength="10"') . ' <small>(YYYY-MM-DD)</small>' ; ?></a></td>

</tr>

 

Regards

John

coupons.php

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

This addon has been updated here; http://addons.oscommerce.com/info/7644

 

Please let me know if you find any errors.

 

Bug Fixes and updates...

 

Updated drop on top files to 2.3.3.4 and removed left over code from delivery_date addon

 

Bug fix for datepicker in admin/coupons.php

 

Confirmed to work with 2.3.3.x PayPal Standard.

 

Works with PayPal Express ONLY from checkout_payment.php. Currently is not working when "checking out with PayPal" from shopping_cart.php.

 

@@joli1811 is helping to get this addon working with PayPal Express

 

Full package.

Share this post


Link to post
Share on other sites

When order delete from admin , the Tabel 'discount_coupons_to_order' haven't clear . so stats discount coupons have error and not correct.

How ca i fix this issue. any ideas??

 

general.php

 

fuction tep_remove_order()

Edited by tefa

Share this post


Link to post
Share on other sites

function tep_remove_order()

 

add some code below

 

if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true') {

$coupons_order_check_query = tep_db_query("select count(*) as total from " . TABLE_DISCOUNT_COUPONS_TO_ORDERS . " where orders_id='" . $order_id ."'");

$coupons_order_check = tep_db_fetch_array($coupons_order_check_query);

if ($coupons_order_check['total'] > 0) {

tep_db_query("delete from " . TABLE_DISCOUNT_COUPONS_TO_ORDERS . " where orders_id = '" . $order_id . "'");

}

}

Share this post


Link to post
Share on other sites

I'm having a problem with foreign currency.

I installed the contribution PayPal Website Payments Standard Discount + show the orders details - Fixed and total money is not the same in oscommerce and paypal for some reason.

For example if the order for 3 items is $80.00 in oscommerce, when I go to paypal its $80.01. But the amount of the discount and the postage will remain the same.

For EU is one cent less.

Probably the higher the amount will become the bigger the difference

 

Any ideas what is causing this and how to fix this?

Share this post


Link to post
Share on other sites

Is anyone using the latest versions of this module with OSC 2.2 RC2? Is there any support for that release still?

 

Thanks,

Share this post


Link to post
Share on other sites

I have found the problem for the rounding errors that happen because of the currency conversion.

The order total on the oscommerce screen is based on more than 2 decimal places. That's why you will notice that the totals don't add up sometimes.

 

For example this is a transaction from my website:

Products (Edit) 19 x

WIDGETS (product price 19.89) $377.94

Discount Coupon 10LIKE applied:-$37.79

Sub-Total:$340.14

Recorded UK Delivery ():$36.50

Total:$376.64

 

If you notice 377.94-37.79 = 340.15 and NOT 340.14. That means calculations are made with hidden decimals.

The same with the calculations for the product . 19 x 19.89 = 377.91 and NOT 377.94

 

In paypal the calculations are made with only 2 decimals thats why they appear as expected

 

So, a simple fix would be to make all calculations on 2 decimals.

Edited by karoloydi

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

×