Jump to content
Latest News: (loading..)
Snarg

Discount Codes BS

Recommended Posts

My question is in reference to the module found here.

 

To the best of my knowledge I have followed all of the install instructions to the letter. I have copied all required files and made the two file changes. The module installs just fine through the admin page and I am able to create an entry. However, upon checkout, an entry field for the discount code does not appear.

 

I have no errors, but I also don't have a functioning discount code :( Does anyone have a screenshot of what it is supposed to look like?

 

Please let me know what other information I may be able to give you. I am very much looking forward to this contrib. Any and all help would be greatly appreciated. Thank you in advance.

Share this post


Link to post
Share on other sites

@@Snarg

 

Hi Scott, did you follow these instructions?

4. Install the Order Total module under Administration -> Modules -> Order Total -> Install Module -> Discount Code -> Install Module.
   Install the Header Tags module under Administration -> Modules -> Header Tags -> Install Module -> Discount Code -> Install Module.

*OPTIONAL
   Install the Content module under Administration -> Modules -> Content -> Install Module -> Discount Code -> Install Module.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

@@Snarg

 

Hi Scott, did you follow these instructions?

 

4. Install the Order Total module under Administration -> Modules -> Order Total -> Install Module -> Discount Code -> Install Module.

   Install the Header Tags module under Administration -> Modules -> Header Tags -> Install Module -> Discount Code -> Install Module.

 

*OPTIONAL

   Install the Content module under Administration -> Modules -> Content -> Install Module -> Discount Code -> Install Module.

(sigh) Sometimes it's the simple things that slip right past you...

 

I didn't install the header tags. Thank you so much for your help. I puzzled over it for hours.

 

Thank you and have a great day.

Share this post


Link to post
Share on other sites

(sigh) Sometimes it's the simple things that slip right past you...

 

I didn't install the header tags. Thank you so much for your help. I puzzled over it for hours.

 

Thank you and have a great day.

I did all those steps and mine still doesn't work

Share this post


Link to post
Share on other sites

Scott and Steven,

 

Did either one of you every get the Discount Code BS working?

 

I am exprencing the same thing even after I double checked that I  Installed both the Order Total module and the Header Tag modules.

I didn't install the Optional Content module?

 

I am not seeing a place where the customer can enter a coupon/discount code and the discount/coupon amount field is not displayed on the order confirmation page.

 

I didn't install the Optional Content module.

 

I would really like to be able to use this function.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

I installed it with and without the options and I have the same results as have been posted here.

I'm beginning to wonder if these guys even test their projects before posting them.

 

One thing I did find is when I created a MANUAL discount code (in attributes. I use I HAVE A CODE = -(percent in dollars) and I HAVE NO CODE. The customer chooses one or the other and enters the code in the COMMENTS section.

The customer is advised that an incorrect code will void the transaction.

 

Its the best I can do.

Share this post


Link to post
Share on other sites

Addendum:

When I include this option with a product, I see DISCOUNT CODES: immediately preceding the option, but without the code option there is no mention of discount code.

 

Anyone wishes to check it out can go to http://www.kinyadiggit.us/store1/catalog/index.php and "order" anything BUT the end table which has no code attached.

 

The store is not active, just testing, so you can't buy anything.

I have spent so much time trying to get this software up to speed that I haven ot had time to produce any products.

Share this post


Link to post
Share on other sites

I was able to get Discount Code 4.2BS working after some advice that pointed me towards a link (http://forums.oscommerce.com/topic/407936-discount-code-bs/?p=1748875) here on the forum.

 

Without the Comment code in Checkout_Payment.php file that is discribed in the link the Discount Code title and text field are not displayed on the Order Confirmation page!

 

I had that section of code commented because I didn't want a order comment prompt and text area, once I uncommented the code the Discount Code prompt/title and text area were displayed and function perfectly.  I was later able to remove the comment prompt and text area and still keep the Discount Code which I rename  "Coupon Code".

 

 

I hope this helps.

 

@SalsaTim

Edited by SalsaTim

Share this post


Link to post
Share on other sites

I'm beginning to wonder if these guys even test their projects before posting them.

Yes, we do test our stuff before uploading it to the addons area. Attitude or comments like that won't help you either.

You still haven't provided the information I asked you for in the other discount thread you posted. Keep in mind more info YOU provide the better and accurate we can help.

Anyways, looking at your store from the link you posted I can see that you are running the "normal" osC 2.3.4 version. THIS addon, Discount Codes BS, was made/adapted for osC Bootstrap only. You cannot use that addon for your current shop. So you have two choices, either you install and use a Bootstrap version of osC or you install a Discount Codes addon that is compatible with your shop. For example with this one.

 

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

 

If you want to know more about the community build Bootstrap stuff read here.

 

http://forums.oscommerce.com/topic/396152-bootstrap-3-in-234-responsive-from-the-get-go/page-1

 

One more thing, if you see addons that have the 2 letters "BS" in their title name then they are most likely made for the Bootstrap version and are therefore not compatible with your current shop version.

Edited by Tsimi

Share this post


Link to post
Share on other sites

OK, so I don't know what happened, but I got the Discount Codes doing everything EXCEPT APPLYING THE DISCOUNT!!!

I do notice that when I go to the modules =>Discount Codes link I see an error message:

MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION

 

Since I am not a programmer as most of you guys seem to be, I have no clue what that means, only that it doesn't look good.

Share this post


Link to post
Share on other sites

Will be possible to put the checkout_process.php code

  // Discount Codes 4.1 BS - start
  if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true' && !empty($discount)) {
    $discount_codes_query = tep_db_query("select discount_codes_id from discount_codes where discount_codes = '" . tep_db_input($sess_discount_code) . "'");
    $discount_codes = tep_db_fetch_array($discount_codes_query);

    tep_db_perform('customers_to_discount_codes', array('customers_id' => $customer_id, 'discount_codes_id' => $discount_codes['discount_codes_id']));
    tep_db_query("update discount_codes set number_of_orders = number_of_orders + 1 where discount_codes_id = '" . (int)$discount_codes['discount_codes_id'] . "'");

    tep_session_unregister('sess_discount_code');
  }
  // Discount Codes 4.1 BS - end

Into header_tags module?

    function execute() {
        global $PHP_SELF, $oscTemplate, $sess_discount_code;
        if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
            if (basename($PHP_SELF) == 'checkout_payment.php') {
                ob_start();
                include('ht_discount_code/ht_discount_code.php');
                $template = ob_get_clean();
                $oscTemplate->addBlock($template, $this->group);
            } elseif (basename($PHP_SELF) == 'logoff.php') {
                if (tep_session_is_registered('sess_discount_code')) {
                    tep_session_unregister('sess_discount_code');
                }
            }
        }
    }

Best regards :)

Share this post


Link to post
Share on other sites

Hola Gustavo @@PiLLaO,

 

It's not possible in a header tag. Header tags are loaded before all the checks in checkout_process.php main page are performed. So it would be possible that the code is executed even the checkout is not successful and the customer is redirected to previous pages.

It could be moved into a hook, but then there would be still code changes needed in the checkout_process.php file to call the hook in the right place.

I would await for 2.4 to do it.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Paypal App not working with this not showing Discount in paypal standard. I am using v5.018 anyone? I followed the instructions but nothing. I am getting frustrated maybe switch to magento

Share this post


Link to post
Share on other sites
1 hour ago, tmcca said:

Paypal App not working with this not showing Discount in paypal standard. I am using v5.018 anyone? I followed the instructions but nothing. I am getting frustrated maybe switch to magento

It is my understanding that the Discount Code module will not work with Paypal standard...you need to use PayPal Express.

Dan

Share this post


Link to post
Share on other sites

I would be interested in your solution if you find one....Rainer and Lambros I'm sure will be interested in it too.

Dan

Share this post


Link to post
Share on other sites

I think you have to make it an item with negative price that is problem I think. Discount according to PayPal API no longer supported and call the item discount 

Edited by tmcca

Share this post


Link to post
Share on other sites

I am guessing this code below prints the receipt to customer Item, Amount, Subtotal, Tax, and total. I am looking to add ot_discount and print that line. Anyone?

 


          if ($GLOBALS[$class]->enabled) {
            for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
              if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
                if ( !in_array($GLOBALS[$class]->code, array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) {
                  $item_params['item_name_' . $line_item_no] = $GLOBALS[$class]->output[$i]['title'];
                  $item_params['amount_' . $line_item_no] = $this->_app->formatCurrencyRaw($GLOBALS[$class]->output[$i]['value']);
                  
                  $items_total += $item_params['amount_' . $line_item_no];

                  if ( $item_params['amount_' . $line_item_no] < 0 ) {
                    $has_negative_price = true;
                  }

 

Share this post


Link to post
Share on other sites

Okay I got it working I think please test on your end:

 

Line #363 change this to 'amount_1' => $this->_app->formatCurrencyRaw($order->info['total'] - $order->info['shipping_cost'] - $total_tax + (empty($discount) ? 0 : $discount)), // Discount Code

Line #387 Find if (is_numeric($sendto) && ($sendto > 0)) {

Add this before this:

// Discount Code - start
      if (!empty($discount)) {
        $parameters['discount_amount_cart'] = $this->_app->formatCurrencyRaw($discount);
      }
      // Discount Code - end

Find function before_process() {
Add global $discount to the global variables

 

That should be it

Edited by tmcca

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

×