Jump to content

Recommended Posts

@@raiwa

 

I used something like that in the Featured Products BS addon.

I never really thought about "updating". I mostly expected the user to uninstall and reinstall the modules but you are right loosing all current discount codes sure ain't fun.

I will try to implement that field check, delete True/False and create a update manual for users with older versions.

 

Thanks again for the input. :thumbsup:

Share this post


Link to post
Share on other sites

New Discount Codes 3.7 BS released!

 

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

 

- Code improvements, reducing core code changes
- Added shipping discount feature!
- PHP 7 compatible
- Upgrade manual added

Special Thanks to katapofatico, raiwa and greasemonkey for their very valuable help and input. :thumbsup:

Share this post


Link to post
Share on other sites

Hello @@Tsimi,

 

Just a very minor suggestion for ot_discount.php:

		$this->output[] = array('title' => (($shipping_discount == 'true')? TEXT_SHIPPING_DISCOUNT : TEXT_DISCOUNT) . (strpos($check['discount_values'], '%') ? ' ' . $check['discount_values'] . ' ' : '') . (!empty($order_info) ? ' (' . $sess_discount_code . ')' : '') . ': ',

 

 

This will add the percentatge amount to the discount title. I believe this makes it more clear to the customer, otherwise he may not know how the discount amount is calculated.

If it's a fix amount, no need to show it.

 

Keep it for the next update if you like.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Help, I had this installed and working on my site, but had to reinstall some files which overwrote the modded files.

 

I've reinstalled and everything looks ok but its not taking the discount off. 

Share this post


Link to post
Share on other sites

If you use the latest 3.7 then you only need to make sure that you still have the code pieces inside the application_top.php and checkout_process.php. Anything else is installed via modules in the admin area.

 

order total module and header tags module

Share this post


Link to post
Share on other sites

@@Tsimi

I was using 3.6.

Would you suggest i upgrade to 3.7?

Would I need to remove all previous code? or are you saying as long as the code is in application_top.php and checkout_process.php. it should work?

 

Sorry for all the questions, I have a advertising campaign just kicked off and it relies heavily on a discount code, so i really need to get it fixed.

Thanks x

Share this post


Link to post
Share on other sites

I have upgraded to 3.7 using the instruction provided but no longer have a discount code box on the checkout page for the customer to add the discount code  :blush:

Share this post


Link to post
Share on other sites

Hello @@munchkinz,

 

The code in checkout_payment.php is now injected by javascript in the headr tag module.

 

1. make sure you have the header-tag module installed: Admin => Modules => Header Tags => Discount Code

2. Make sure that this part of the code in checkout_payment.php hasn't been altered:

  </div>

  <hr>

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

If you were using the older version, you may have still the discount code snippet there. Remove it and leave the code like above.

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello @@munchkinz,

 

The code in checkout_payment.php is now injected by javascript in the headr tag module.

 

1. make sure you have the header-tag module installed: Admin => Modules => Header Tags => Discount Code

2. Make sure that this part of the code in checkout_payment.php hasn't been altered:

  </div>

  <hr>

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

If you were using the older version, you may have still the discount code snippet there. Remove it and leave the code like above.

 

rgds

Rainer

Thanks @@raiwa,

I think I've found the problem, I don't have the BS version (i hadn't realised this was for the BS version) and there for don't have that code. I have

   </table>

<?php
    $radio_buttons++;
  }
?>

  </div>

 <?php
  
?>
 <hr>
 <h2><?php echo TABLE_HEADING_COMMENTS; ?></h2>

  <div class="contentText">
    <?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?>
  </div>

  <div class="contentText">
    <div style="float: left; width: 60%; padding-top: 5px; padding-left: 15%;">
      <div id="coProgressBar" style="height: 5px;"></div>

Can this add on still be used or can you recommend an alternative please? 

Thank you so much x

Share this post


Link to post
Share on other sites

@@munchkinz

 

Hi Katrina

 

I am not sure if we are even talking about the same Discount Codes addon. I never released this for a normal osC shop only for Bootstrap versions.

I also cannot tell you what alternatives are available except to try and install the addon that I based my one on...

 

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

 

...or you will have to strongly try to remember what discount codes addon you previously had installed.

 

I also would highly recommend to backup your database and shop files first just in case something goes wrong.

Edited by Tsimi

Share this post


Link to post
Share on other sites

Hi, Yes it was definitely your add on 3.6 i had installed and working on my non BS site. I only have a few add ons installed. 

 

Thank you for your help anyway.

Looks like I will have to uninstall and try a different add on  :(

Share this post


Link to post
Share on other sites

I have tried 3.6BS & 3.7BS. Both work fine with discount code assigned to "Products" or Order "Sub-Total".

 

But in admin/Catalog/Discount Codes, if I selected "Categories" or "Manufacturers", it just jumps back to Discount Code field and won't let me save the code.

 

Does anybody know what happened? Thanks.

 

LWSS

Share this post


Link to post
Share on other sites

@@LWSS

 

Hi Stephen

 

Did you just tick the radio button for categories or manufacturer or did you also select something from the list below the radio button?

Share this post


Link to post
Share on other sites

Thanks Lambros,

 

I've tried all combinations.

 

(1) Just tick the radio button for Categories or Manufacturer, and save.

(2) Tick the radio button & select Categories or Manufacturer name in pull down menu, and save.

(3) Tick the radio button of Categories, select name in pull down menu, select products to be excluded, and save.

 

No matter with which one, it won't let me save to pass $categories_id or $manufacturer_id to database.

Share this post


Link to post
Share on other sites

The only thing left to do is to re-check your installation.

Backup your discount codes from the database. Then download the latest version.

Remove all previous files and revert all code changes.

Then install the latest version.

At the end load your discount codes back into the database or recreate them through the admin section.

Edited by Tsimi

Share this post


Link to post
Share on other sites

Thank you.

 

I've revert and install again the module twice, but no luck.

 

Discount can successfully applies to Order-subtotal, Products, Excludes Specials, Customers, except Categories, Manufacturers & Excluded Products.

 

 

I am using osc2.3.4 non-BS version. In front end, I can manage to change codes to work perfectly for discount and tax calculation with multi-currencies, but in admin side I can't figure out where is going wrong.

 

Up to my limited PHP knowledge, I suspect may be the data in "tep_draw_pull_down_menu('categories_id',..... /('manufacturers_id'), " could not be captured.

 

It is a nice module, may be I just leave the Categories & Manufacturers aside at the moment.

 

 

 

 

P.S.  Will it be better if we could apply discount to more than one Manufacturers in promoting our sales?

Share this post


Link to post
Share on other sites

You can apply discounts to multiple categories or manufacturers you just need to keep pushing down the ctrl button on your keyboard while you click on the categories or manufacturers.

 

If you want you can send me via private message the link and login data to your admin area and I'll take a look if you want.

Share this post


Link to post
Share on other sites

Thank you for your kindness. I am still in a local development site. There no way you can access it.

 

I tried already pushing down the ctrl button to select, it just jump to item which I have clicked, and of course save failed.

 

Anyway, I've already solve the problem although It seems a clumsy stupid way.

I can now selecting multi-categories, multi-manufacturers, with excluded products and save successfully.

It seems works seamlessly, I haven't yet tested on all scenarios.

 

 

For Discount Codes 3.6BS

 

What I did:-

 

For Manufacturers

replace (like codes for Customers):

 

 

    $manufacturers_id = str_replace('<select name="manufacturers_id">', '<select name="manufacturers_id[]" size="10" multiple style="width:280px">', tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array));
    if (is_array($dInfo->manufacturers_id)) {
      foreach ($dInfo->manufacturers_id as $v) {
        $manufacturers_id = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $manufacturers_id);
      }
    }

 

with:

 

 

    $manufacturers_id = '<select name="manufacturers_id[]" size="10" multiple style="width: 280px" id="manufacturers_id">';
    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from manufacturers order by manufacturers_name");
    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
      $manufacturers_id .= '<option value="' . $manufacturers['manufacturers_id'] . '">' . $manufacturers['manufacturers_name'] . '</option>';
    }
    $manufacturers_id .= '</select>';

    if (is_array($dInfo->manufacturers_id)) {
      foreach ($dInfo->manufacturers_id as $v) {
        $manufacturers_id = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $manufacturers_id);
      }
    }

 

 

I do the same way to Categories, it works too.

 

For Categories

replace:

 

 

    $categories_id = str_replace('<select name="categories_id">', '<select name="categories_id[]" size="10" multiple style="width:auto; min-width:280px">', tep_draw_pull_down_menu('categories_id', tep_get_category_tree('0', '', '0')));
    if (is_array($dInfo->categories_id)) {
      foreach ($dInfo->categories_id as $v) {
        $categories_id = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $categories_id);
      }
    }

 

with:

 

 

    $categories_id = '<select name="categories_id[]" size="10" multiple style="width: 280px" id="categories_id">';
    $categories_query = tep_db_query("select c.categories_id, cd.categories_name, categories_htc_title_tag from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, cd.categories_name, categories_htc_title_tag");
    while ($categories = tep_db_fetch_array($categories_query)) {
        if ($categories['categories_name'] == $categories['categories_htc_title_tag'] ){
            $catname = $categories['categories_name'];
        } else {
            $catname = $categories['categories_name'] . ' -> ' . $categories['categories_htc_title_tag'];    
        }
      $categories_id .= '<option value="' . $categories['categories_id'] . '">' . $catname . '</option>';
    }
    $categories_id .= '</select>';

    if (is_array($dInfo->categories_id)) {
      foreach ($dInfo->categories_id as $v) {
        $categories_id = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $categories_id);
      }
    }

 

 

No-goods in Categories after change (minor issues):

  1.  I can't see the categories in a tree form.  I need pay more attention in choosing categories. Also I have to add a extra query item "categories_htc_title_tag" to let me identify more easily when there are different categories but with the same name.
  2.  if I select the parent_id Cat. only it won't work in front end, I have to select also all sub-categories under it together.

 

 

P.S.  I add "p.products_model" to products_query, now I can see the products sorted by model now.

Share this post


Link to post
Share on other sites

@@LWSS

 

If this works for you use it.

Still I cannot duplicate the problem. No matter what Discount Codes I create all can be saved.

Just makes some tests to see if everything works for you as it should.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi

 

I finally find out where is going wrong.

 

It's my fault,  I put a css class in "function tep_draw_pull_down_menu()" that causes the problem.

After remove it, everything work fine with your original codes. I can now move forward to upgrade it to 3.7BS.

 

Thanks for your precious time.

Share this post


Link to post
Share on other sites

Hallo, everybody, my name is Umberto and I am setting up an OSCommerce 2.3.4 BS (Edge) to sell my craftman works. I have been trying to install Discount codes 3.8 BS,: everything went fine, I can see the module in admin panel and set up discount codes.
BUT I cannot find anywhere on pages the possibility for the customer to input those codes... Not in product page, not in the cart nor in the various steps of payment process... Can I ask your help?
Thank you in advance
Umberto

Share this post


Link to post
Share on other sites

@@Umb

 

Hi Umberto

 

Did you install the header tags module and order total module in the admin area?

 

Admin Area -> Modules -> Header Tags -> install

Admin Area -> Modules -> Order Total -> install

Share this post


Link to post
Share on other sites

Thank you for your prompt answer, @@Tsimi.
Yes I did, and the module configuration shows up in the admin panel both in order total and header tags.
Where should the input field for the discount code show up, on wich pages?

BTW, I made the Italian translation of the language files of the module, how could I share them?

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

×