Jump to content

Recommended Posts

Hello Pierre @Peper,

 

I just checked and it works for me.

I checked with the latest version 4.2.1 BS and OsC 2.3.4 BS EDGE from Jnauary 2017.

I entered 2017_07_12 as expiry date and it validates. Then  i changed the expiry date to 2017_07_11 and it didn't validate.

Only difference I have it placed on checkout payment page like by default in that version..

Can you please check again and give us all your details.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

In the install instructions there's a note that says this:

-------------------------------------------------------------------------------
IMPORTANT: Make sure the following original code is present and not altered or uncommented in checkout_payment.php:
           The ht module uses this code as a reference to inject the discount code input field.
about line 241-245:

  <hr>

  <div class="contentText">
    <div class="form-group">
      <label for="inputComments" class="control-label col-sm-4"><?php echo TABLE_HEADING_COMMENTS; ?></label>
-------------------------------------------------------------------------------

 

My checkout_payment is rather well customized, and this code is not present. I browsed through this thread, but I didn't see any tweak in order to make things work.

 

Can I do something to make it work without that original code in place?

Share this post


Link to post
Share on other sites

Looks like I found the answer to my own question. In the discountcodesfolder\catalog\includes\modules\header_tags\ht_discount_code\ht_discount_code.php file, it references the markup section I pasted in my previous post.

It seems like I can simply update the bolded part of the following line (#s 18 to 24):

        $('div.contentContainer div.contentText .form-group').parent().before('<h2><?php echo TEXT_DISCOUNT_CODE; ?></h2><div class="col-xs-6 col-sm-3">\n\
                        <div class="form-group has-feedback">\n\
                                <input type="text" class="form-control" name="discount_code" value="<?php echo isset($sess_discount_code) ? $sess_discount_code : ''; ?>" id="discount_code" />\n\
                                <span class="form-control-feedback" id="discount_code_status" style="right:0;"></span>\n\
                        </div>\n\
                </div> \n\
        <div class="clearfix"></div><hr>');

to select on the same part of the code, but as it applies to my file rather than the default. Pretty straight forward.

Sorry to ask a dumb question here, but maybe this will help someone else!

Share this post


Link to post
Share on other sites

I have installed this addon and thought it was all working good.

When the discount is less then the purchase it works fine.

But when the discount is the same amount as the product or more then the product and shipping together than the total is in minus. Please see attached photo:

Discount.thumb.GIF.6c6fbc5e0a6ec41145982fff758e4e35.GIF

In Order Total i have following arrangement:

Discount Code 3
Shipping      2
Sub-Total     1
Tax           4
Total         5

Share this post


Link to post
Share on other sites

What version are you using? And can you provide more info on the discount code settings?

Edited by Tsimi

Share this post


Link to post
Share on other sites

The latest one dated 29th December 2016.

When creating the discount code all i did was put an amount and save. Default settings which is "applies to order subtotal"

Edit: I just installed this contribution on a clean install and the result is the same.

Edited by CGhoST

Share this post


Link to post
Share on other sites
28 minutes ago, CGhoST said:

The latest one dated 29th December 2016.

When creating the discount code all i did was put an amount and save. Default settings which is "applies to order subtotal"

Edit: I just installed this contribution on a clean install and the result is the same.

That is weird. Because I just installed this addon (latest version, Discount Codes 4.2.1 BS) into a new Edge store and setup the sort order same as you (Possibility B) and I get this.

discount_total.jpg.e88b471625565a6ab9a5cc21ed6edd0e.jpg

Edited by Tsimi

Share this post


Link to post
Share on other sites

What you have is without tax. How does it come with a tax component?

It is weird. Dont understand what i have wrong

Maybe its my Edge. Its updated until 26/11/2016. Do you think so?

Edited by CGhoST

Share this post


Link to post
Share on other sites
2 minutes ago, CGhoST said:

What you have is without tax. How does it come with a tax component?

Yep, added tax and now I get the same issue.

Another thing is the taxes won't show in the confirmation page if I use Possibility B
It does show however if I use the old setting like this

Discount Code 4
Shipping      2
Sub-Total     1
Tax           3
Total         5

Looks like something has gone wrong in the last update or even earlier. I gotta check quickly when this started.
@raiwa Rainer I know you are busy as it is but if you have this installed somewhere can you do a quick test and confirm?

Share this post


Link to post
Share on other sites

Originally i was using the order you have mentioned. But changed it to see maybe that will fix the problem.

Thank you for confirming there is a bug with tax. I was worried maybe i messed it up.

Share this post


Link to post
Share on other sites

@CGhoST

I am not sure anymore but I think raiwa and I had once this issue when testing and talked about it and we agreed that it would not make sense to use or give a discount code that has a higher amount then the product or subtotal since the customer would loose some of the discount value. And it is always recommended to use discount codes with % like 10%, 20% or anything that uses % which makes it impossible for such a case to happen.
Do not use 100% for a sub-total case, use 100% only for shipping to get free shipping.

I am not sure there is any fix for the issue you encountered at least not yet.
The tax not showing is most likely the result of that issue. Once you use a "normal" case discount it shows just fine.

Edited by Tsimi

Share this post


Link to post
Share on other sites

In my case the discount code is not higher .. its equal to the price of the galaxy tablet.

But the taxtion calculation is mucking it up.

Share this post


Link to post
Share on other sites
Just now, CGhoST said:

In my case the discount code is not higher .. its equal to the price of the galaxy tablet.

But the taxtion calculation is mucking it up.

Equal or higher won't work at the moment.
For the galaxy tablet you would need a $749 discount code to make it work. even 749.98 won't work.

I am looking at the code as I write this. But don't hold your breath.

Share this post


Link to post
Share on other sites

@CGhoST

I knew if I stare long enough at the code I might get an idea. The following needs a very good check though since I didn't test out all equations.
Just make sure you can revert the code if anything goes wrong.

open the ..modules/order_total/ot_discount.php file and look for the following code around line 163-167

if (!empty($order_tax)) {
$order->info['tax'] = $order_tax;
} else {
$order->info['total'] -= $discount;
}

REPLACE WITH

if (!empty($order_tax)) {
  $order->info['tax'] = $order_tax;
} else {
	if ($discount < $order->info['subtotal']) {						
	  $order->info['total'] -= $discount;
	}
}

And set the order total sort order to this

Discount Code 2
Shipping      3
Sub-Total     1
Tax           4
Total         5

Tell me if that works for you.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@CGhoST

Thanks for your feedback.
Please make sure you test this thoroughly and if anything should arise just post here again.

@raiwa

Once you find time in between all your projects and work can you take a quick look at my recommended code change above and tell me if that code change makes sense or if it is wrong to do it that way.
Not sure how much this affects the shipping sort order thing you added.

Share this post


Link to post
Share on other sites

Apologies for my bad English.

I have a problem. If I create a coupon with a % it is not applied correctly. If it is a fixed amount, there is no problem. From 1% the discount amount is wrong and the higher discount is worse.

I have two stores running for several years with many addons installed. To avoid conflicts I have installed a new store to which I have only installed this addon (version 4.2.1 BS) and the result is the same, the discount percentage is not applied correctly.

Any solution?

 

To the price of the product we add the shipping costs that give 304.99. We divide it by 1.40, which is the discount percentage that I want to apply and results in 217.85, not 184.99 of the screenshot.
40% are 87.14, not 120 of the screenshot.

checkout_confirmation 2.jpg

Share this post


Link to post
Share on other sites

What is wrong with that?  I don't think the intention was to also discount the shipping cost...just the product cost but @Tsimi will know better. 

Dan

Share this post


Link to post
Share on other sites

If the 40% are applied to the subtotal (excluding shipping) then the current result is correct.

10% of 300 is 30. Then multiply by 4 = 120. 

Or

299.99 x 0.60 - 299.99 = 119.996 which gets rounded up to 120.

So as Dan Cole mentioned it is correct.

Share this post


Link to post
Share on other sites

@reflex-ocasion,

As stated by @Tsimi and @Dan Cole, it's all correct. Discount is applied to Order Subtotal OR Shippping, not both.

Share this post


Link to post
Share on other sites

In theory it is correct, but... all operations must be verified that they are correct!

Regardless of whether the shipment is included or not included, to me the bills do not fit me. The calculators have the option of % and if I use it the result is a different one.

300 / 100 = 3 x 40 = 120

300 - 120 = 180 + 40% (or + 72) = 252 ??? They have disappeared 48!

180 / 100 = 1.80 x 40 = 72

 

300 / 1.40 = 214.2857... + 40% (or + 85.7142...) = 300

214.2857... / 100 = 2.142857... x 40 = 85.7142...

If I want to get 40% I have to divide between one point forty. If it were 20% then between one point twenty. If it were 33% then divided by one point thirty-three. And so on.

 

I am sorry for my bad english.

Share this post


Link to post
Share on other sites

The installation of this seems to have gone fine the Admin section all looks perfect but for some reason the Discount Codes are not showing up on checkout_payment.php. The original code is present and not altered or uncommented in checkout_payment.php, the HR shows but no Discount Code!

http://www.sosass.com

Any ideas?

Kind Regards

Kevin

Share this post


Link to post
Share on other sites
1 hour ago, reflex-ocasion said:

I am sorry for my bad english.

It's your maths that needs an apology not your English.

If you take off 40% from a big number, you get a result that's 60% of the big number eg 60 from 100

If you add 40% to 60 you should get 1.4 x 60 which is 84

40% of 60 is less than 40% of 100


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@kevindownie

You have to provide the generated code to the client so that he can enter it. The generated code is not displayed automatically.

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

×