Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Quantity Discounts by That Software Guy


swguy

Recommended Posts

Looking around on my test site of Phoenix 1.0.6.0 I saw something that is not right.  Tried to figure it out but with no luck.  Need some help please. 

I only waited the code to work on one group (category) of items [14].  In steed it is showing up on every product page.  1st image is my test item, it shouldn't be there.  2nd image is the product I want it to be on.  the 3rd image is the category that I want to use. 

This is the code I changed in the -  includes/modules/order_total/ot_quantity_discount.php  (based on the one I had under OSC 2.3.4)

    // Add categories you wish to exclude to this list.
    // Go to Admin->Catalog->Categories/Products and look
    // at the left hand side of the list to determine
    // category id.   Note that 99999 and 99998 are just given
    // as examples.
    function exclude_category($category) {
        switch($category) {
           case 14:
//           case 99998:
                return false;
        }
        return true;
    }

How to fix and get it show under just under the Wild Berry Incense category?

Thanks for the help.

I also included the file

test item.jpg

correct item.jpg

data base categirues.jpg

ot_quantity_discount.php

Link to comment
Share on other sites

Please grab the latest copy of Quantity Discounts here: https://apps.oscommerce.com/Apps&QdusL&quantity-discounts-for-osc-phoenix 

I tested category exclusions and it worked for me with the latest osC Phoenix from Github. 

Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details.

Link to comment
Share on other sites

I down loaded the file.  I uninstalled QD from content and order total.  Than I uploaded all files.  reinstalled QD in order total and then content.  Edited the ot_quantity_discount.php to:

    // Add categories you wish to exclude to this list.
    // Go to Admin->Catalog->Categories/Products and look
    // at the left hand side of the list to determine
    // category id.   Note that 99999 and 99998 are just given
    // as examples.
    function exclude_category($category) {
        switch($category) {
           case 17:
//           case 99998:
                return false;
        }
        return true;
    }

Looked at my site and the same thing.  It did not fix the issue.  Sorry. 

Here is my site if you want to look.  http://www.ladybuggardendecor.com/temp.ladybuggardendecor.com/index.php

My test site is under the temp..  The part in the front is the old OSC 2.3.4 where it is still working. 

I get the listings in all product detail pages weather I edit the above file or not.  I can leave the file as is from the new install upload and get the same thing.  The modified file has no change on the outcome. 

Let me know what else you need.  I will be happy to help. 

Thanks for your time and trouble. 

 

 

Link to comment
Share on other sites

I misunderstood your issue - you're saying that the marketing text isn't excluded (it's not a discounting issue, it's a marketing text issue). 

The answer is, you have to customize other things if you take advantage of the user exits.  There's an example in the help of how to do this.

https://www.thatsoftwareguy.com/osc_quantity_discounts.html#marketing

Go down to the second note below this link.  

Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details.

Link to comment
Share on other sites

@swguy

Updated Phoenix today to 1.0.6.1.  I get these errors when I go to the product page.

Warning: Use of undefined constant MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE - assumed 'MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE' (this will throw an Error in a future version of PHP) in /includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php on line 2

Warning: Use of undefined constant MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE - assumed 'MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE' (this will throw an Error in a future version of PHP) in /includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php on line 2

 

Link to comment
Share on other sites

Change MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE to MODULE_CONTENT_PI_SWGUY_QD_MARKETING_CONTENT_STYLE

in includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php

Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details.

Link to comment
Share on other sites

14 minutes ago, swguy said:

Change MODULE_CONTENT_PI_SWGUY_QD_MARKETING_TEXT_STYLE to MODULE_CONTENT_PI_SWGUY_QD_MARKETING_CONTENT_STYLE

in includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php

same error

Warning: Use of undefined constant MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE - assumed 'MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE' (this will throw an Error in a future version of PHP) in /includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php on line 2

Warning: Use of undefined constant MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE - assumed 'MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE' (this will throw an Error in a future version of PHP) in /includes/modules/content/product_info/templates/tpl_cm_pi_swguy_qd_marketing.php on line 2

Link to comment
Share on other sites

You have a copy and paste error.  Please reread my instructions. 

Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details.

Link to comment
Share on other sites

6 minutes ago, swguy said:

You have a copy and paste error.  Please reread my instructions. 

I'm not following.  I didn't copy or past.  I just took out TEXT.  Other than it was a pure file.

<?php if ( (MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE == 1) || (MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE == 2)) { ?>

Link to comment
Share on other sites

2 hours ago, dculley said:

I'm not following.  I didn't copy or past.  I just took out TEXT.  Other than it was a pure file.

<?php if ( (MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE == 1) || (MODULE_CONTENT_PI_SWGUY_QD_MARKETING_STYLE == 2)) { ?>

TEXT -> CONTENT

Link to comment
Share on other sites

@Supertex

TEXT in place I get this.  Only thing out of place is the warning. 

image.png.c45d051ad211d722ef3f3343af01b3cf.png

When I replace the TEXT to CONTENT I get this with out warnings. But I loose the lines.  I can live with this. 

image.png.6a60759f47bbe8886dc1e53b7fc4d0b0.png

Thanks for the help, greatly appreciated. 😊

Link to comment
Share on other sites

  • 1 month later...

Great thing, used over 15 years the old one 😉
Is it possible to place the information formatted , more "eye-friendly",may be centered or without/different frames ?

Here is what i had so far
image.jpeg.aa233dd7817a3586ef475561b68632ff.jpeg

And the discount may be in RED ?

Edited by EGLTD

Dum spiro spero 

Link to comment
Share on other sites

  • 2 months later...

Hello @swguy

I have a question,

I have Purchase without account Phoenix  - https://apps.oscommerce.com/gBmPX&purchase-without-account-phoenix module and when I am on guest account - I see quantity discount in checkout process, but I don't want to give discount for guest, just for users, which were bought something earlier. Could you tell me, what is need to edit to get this effect?

If I should to set quantity discount only for registered users? Or something else?

Newest Phoenix.

Thx.

Edited by Gold1s
Link to comment
Share on other sites

  • 3 months later...

Good afternoon - 

I am having some issues with this module. I am using Phoenix 1.0.7.12

 

If I have "re-calculate tax" enabled I get the following error:

"Fatal error: Uncaught Error: Call to undefined function zen_get_tax_rate_from_desc() in /var/www/html/includes/modules/order_total/ot_quantity_discount.php:534 Stack trace: #0 /var/www/html/includes/modules/order_total/ot_quantity_discount.php(399): ot_quantity_discount->gross_up(21) #1 /var/www/html/includes/modules/order_total/ot_quantity_discount.php(265): ot_quantity_discount->calculate_deductions() #2 /var/www/html/includes/system/versioned/1.0.7.3/order_total.php(36): ot_quantity_discount->process() #3 /var/www/html/includes/system/versioned/1.0.7.8/checkout.php(169): order_total->process() #4 /var/www/html/includes/system/versioned/1.0.7.other/1.0.7.12/hooks.php(161): Checkout::set_order_totals(Array) #5 /var/www/html/includes/system/segments/checkout/pipeline.php(14): hooks->generate(NULL, 'startApplicatio...') #6 /var/www/html/checkout_confirmation.php(15): require('/var/www/html/i...') #7 {main} thrown in /var/www/html/includes/modules/order_total/ot_quantity_discount.php on line 534"

 

If I disable "re-calculate tax" I can get to the finalize and pay page but it displays the following error:

"Notice: Undefined index: SD TAX 4.5% in /var/www/html/includes/modules/order_total/ot_quantity_discount.php on line 269"

 

Thanks,

Dan

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...

I'm completely confused. I followed the instructions to the letter, but after copying the contents of the zip file to the server, I don't see any new modules to install. The only thing that happened was the addition of a new folder named osc_qd_1.0.3 with a bunch of folders nested inside of it and a couple of php files at the end of a long chain of otherwise empty folders. What am I doing wrong?

Link to comment
Share on other sites

You have to install the files *inside* the osc_qd_1.0.3 folder to your cart, not the folder itself. 

 

https://www.thatsoftwareguy.com/osc_install_mod.html

Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...