Jump to content

Recommended Posts

@@Tsimi Thank you

this was fix it on chrome not on Firefox

 

@@Omar_one

 

Open your user.css and add this

#discount_code_status {
top:10px;
}

 

Omar


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Did you clear the cache? (Ctrl+F5)

There is no reason why that css should be working on one browser but not the other.

Before I wrote that code I tested it on Firefox (v53) since that is my default browser and it worked just fine.

Share this post


Link to post
Share on other sites

@@Tsimi  I have been clear the cache.  and tested by pc and mobile same thing

 

Omar


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Can once remove that css code from the user.css and open the ht_discount_code.php file which is inside the ht_discount_code folder.

Look for this line

<span class="form-control-feedback" id="discount_code_status" style="right:0;"></span>\n\

and add an inline css like this

<span class="form-control-feedback" id="discount_code_status" style="right:0;top:0;"></span>\n\

Share this post


Link to post
Share on other sites

@@Tsimi,

 

Maybe I'm missing something, but isn't "position: relative;" also required.

Share this post


Link to post
Share on other sites

On my setup it worked by just adding top:0;

But a quick google search revealed that others with similar issues added position:relative; to get it working with Firefox

Share this post


Link to post
Share on other sites

Did you add position:relative; like raiwa mentioned?

Edited by Tsimi

Share this post


Link to post
Share on other sites

In my second code sample i showed you there is a mistake. It should say top 10px and not top 0.

 

<span class="form-control-feedback" id="discount_code_status" style="right:0;top:10px;"></span>\n\

Share this post


Link to post
Share on other sites

@Tsimi @raiwa

Is there a compatibility between "Discount Codes" and" Order Editor" addon ?


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

@@Omar_one
 

:wacko:  still not working .. 
thank you @@Tsimi for your time

 
Did you try:

#discount_code_status {
position: relative;
top:10px;
}

or:

<span class="form-control-feedback" id="discount_code_status" style="position: relative; right:0; top:10;"></span>\n\
Edited by raiwa

Share this post


Link to post
Share on other sites

@@milerwan,
 

@Tsimi @raiwa

Is there a compatibility between "Discount Codes" and" Order Editor" addon ?

In the sense that you can apply a discount code in the order editor, no, this is not supported. But why would you need to do this??

You can just add an additional line in totals with negative discount amount and type as a concept "discount".

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Could someone please tell me once i have created a discount code is there option to email the customer with the code?

 

Is it possible to send discount code with new registration customers email?

 

I am sorry if i have missed the but i couldnt find them.

Share this post


Link to post
Share on other sites

I was just testing and is this correct that if a customer enters an incorrect code and you press continue it will goto checkout confirmation without warning the customer they have entered an incorrect code?

 

Normally customers would just copy and paste so the check does not work unless they click somewhere on page. Most likely after pasting they would press continue.

Share this post


Link to post
Share on other sites

@@CGhoST,

 

 

Could someone please tell me once i have created a discount code is there option to email the customer with the code?

 

Is it possible to send discount code with new registration customers email?

 

I am sorry if i have missed the but i couldnt find them.

 

If it's a specific discount code for a customer, you have to mail it manually.

If it's always the same welcome discount code, you can add it to the text definitions of the create account confirmation mail.

 

Of course, all is possible to automatisize, but you have to code it. It is not included in the discount add-on.

Edited by raiwa

Share this post


Link to post
Share on other sites

I was just testing and is this correct that if a customer enters an incorrect code and you press continue it will goto checkout confirmation without warning the customer they have entered an incorrect code?

 

Normally customers would just copy and paste so the check does not work unless they click somewhere on page. Most likely after pasting they would press continue.

 

It's how it works.

Share this post


Link to post
Share on other sites
I was just testing and is this correct that if a customer enters an incorrect code and you press continue it will goto checkout confirmation without warning the customer they have entered an incorrect code?

 

I use a different coupon code addon but there should be an error message displayed at the top of the page via the message stack.   At least mine works that way.  If you don't see a message there...there likely isn't one.

 

Dan

Share this post


Link to post
Share on other sites

I use a different coupon code addon but there should be an error message displayed at the top of the page via the message stack.   At least mine works that way.  If you don't see a message there...there likely isn't one.

 

Dan

 

Raiwa has confirmed its how it works.

 

Which one do you use Dan?

Share this post


Link to post
Share on other sites
Which one do you use Dan?

 

I use Discount Coupon (I think that is the name) but I wouldn't switch just to see a message like that....maybe if you ask nicely @@raiwa  Rainer or @@Tsimi Lambros will add an error message rountine to a future update.  The discount coupon addon has other draw backs ie. it might not work with PayPal Express.

 

Dan

Share this post


Link to post
Share on other sites

hehe .. Thanks

 

I was just curious  :)

 

Upon further testing i have found a problem

 

Background:

 

Have Modular Shopping Cart Installed

Have Estimated Shipping Cost Installed

 

If the account is unregistered and "Show discount input to guests" is true the discount shows in Estimated Shipping Cost in Shopping Cart but does not apply to the total. If registered this works.

Share this post


Link to post
Share on other sites

And if someone could kindly code a check to display to customers would be very nice. At the moment the customer will think the code has been applied when it hasn't. Doesnt look professional.

 

It would be much appreciated.

Share this post


Link to post
Share on other sites

And if someone could kindly code a check to display to customers would be very nice. At the moment the customer will think the code has been applied when it hasn't. Doesnt look professional.

 

It would be much appreciated.

 

You could just add a 'check code' button (that doesn't do anything) next to the coupon field. If they click it, the script on the field checks the code. If they don't click it, they can't complain!


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

@@CGhoST

 

Not sure what a message stack alert would achieve. Do you want to prevent the customer from continuing their checkout process if the code is wrong?

There are already icons in place that show if the code is valid or not. But if you want to have something more fool proof then as @@BrockleyJohn mentioned an empty button could be placed and the customer clicks on it after entering the code to validate it. Additional to that a small message could be displayed instead of the icons.

 

Open your ../ht_discount_code/ht_discount_code.php file and replace all with this

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2017 osCommerce

  Released under the GNU General Public License

  Discount Code 4.2 BS
*/
?>
<script type="text/javascript">
    $(document).ready(function () {

        $('div.contentContainer div.contentText .form-group').parent().before('<h2><?php echo TEXT_DISCOUNT_CODE; ?></h2><div class="col-xs-12 col-sm-5">\n\
                    <span id="discount_code_status"></span>\n\
                        <div class="form-inline">\n\
                        <div class="form-group has-feedback">\n\
                                <input type="text" class="form-control" style="width:225px;" name="discount_code" value="<?php echo isset($sess_discount_code) ? $sess_discount_code : ''; ?>" id="discount_code" />\n\
                                <input class="btn btn-default" style="margin-top:-4px;" type="button" value="Apply">\n\
                        </div>\n\
                        </div>\n\
                </div> \n\
        <div class="clearfix"></div><hr>');

        var a = 0;
        discount_code_process();
        $('#discount_code').blur(function () {
            if (a == 0)
                discount_code_process();
            a = 0
        });
        $("#discount_code").keypress(function (event) {
            if (event.which == 13) {
                event.preventDefault();
                a = 1;
                discount_code_process();
            }
        });
        function discount_code_process() {
            if ($("#discount_code").val() != "") {
                $("#discount_code").attr("readonly", "readonly");
                $.post("discount_code.php", {discount_code: $("#discount_code").val()}, function (data) {
                    data == 1 ? $("#discount_code_status").empty().append('<div class="alert alert-success discount-alert"><i class="fa fa-check fa-lg" style="color:#00b100;"></i> <?php echo TEXT_DISCOUNT_CODE_SUCCESS;?><div>') : $("#discount_code_status").empty().append('<div class="alert alert-danger discount-alert"><i class="fa fa-ban fa-lg" style="color:#ff2800;"></i> <?php echo TEXT_DISCOUNT_CODE_ERROR;?><div>');
                    $("#discount_code").removeAttr("readonly");
                });
            }
        }
    });
</script>

I don't know why but I cannot post a margin-left css code here.

Just add .discount-alert with a margin-left and margin-right of -15px; into your user.css file

 

and finally add the language definitions into your english.php or whatever language you use.

define('TEXT_DISCOUNT_CODE_SUCCESS', 'Discount Code is valid.');
define('TEXT_DISCOUNT_CODE_ERROR', 'Discount Code is wrong or does not exist.');

Done! I hope that looks more professional.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi

 

Hi Tsimi,

I have a question about "Discount Codes BS" and shipping discount.
From Admin, when I enter a number in Discount field without % for shipping discount, shipping discount is applied/calculated like a percentage from catalog.
Is it normal ?

Listing codes from admin show € symblol nevertheless :

--------------------------------------------------------------------------------------​-------------------------------------------​--------------------------------

Discount Code        Applies to        Discount        Min Sub-Total          Expiry,           Orders      Status         Action  

INF10                     Shipping          100.00 €                                    02/05/2017            3            icon_status_green.gif  icon_status_red_light.gif
--------------------------------------------------------------------------------------​-------------------------------------------​--------------------------------

 

Otherwise, I have "E.U. VAT Intracom Number" addon installed from my store and I have adapted "ot_discount" class to fit with this one (tax calculating ok).
Let me know if your are interested (or anyone), I will post the changes applied to "ot_discount.php" file.

 

 

NB: For those who use Order Editor addon, you will find fix compatibility with Discount Code BS to modifiy your order with discount already applied (or add discount when editing order) : http://forums.oscommerce.com/topic/54032-new-complete-order-editing-tool/?p=1756325

Edited by milerwan

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

@@milerwan,

 

In the sense that you can apply a discount code in the order editor, no, this is not supported. But why would you need to do this??

You can just add an additional line in totals with negative discount amount and type as a concept "discount".

 

rgds

Rainer

 

When you edit an order to change an address, or a phone, or email (and so on) with discount already registred :

- you lost tax calculation of the discount

- you lost discount substraction from the total

 

I have made a fix for that (see the link above). :)


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

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

×