Discount Module: Category Discount when order value over $x

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Post Reply
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Discount Module: Category Discount when order value over $x

Post by Martin »

Following on from this topic on Interspire:
https://www.interspire.com/forum/showthread.php?t=14923

... I was looking at how easy it would be to update it to be 6.1.1 compatible... :shock: :lol:

Whilst the changes to template module calls in the PHP file and template TWIG tags were easily resolved it became clear that the whole discount module had been rewritten to use the QUOTE class that came into being in 6.x or possibly a little earlier.

Looking through the code a few key things have changed so I'm brain dumping them here so I can refer back and try to rewrite this thing properly.

1. $GLOBALS['ISC_CLASS_CART']->api->SetArrayPush('DISCOUNT_MESSAGES' calls now seem to be handled by this array $this->banners[] in tandem with 'DiscountMessage' and 'DiscountMessagePlural' and probably a few other labels.

2. $GLOBALS['ISC_CLASS_CART']->api calls are now primarily replaced with $quote (ISC_QUOTE class) calls.
Naturally enough the function names aren't directly translatable and the use of other modules like the TAX class means some of the variables being passed previously are redundant.
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: Discount Module: Category Discount when order value over

Post by Martin »

Having worked through most of the information I've got the point where I'm reasonably certain the discounting mechanism can be worked in 6.1.x but the option to allow/disallow discounts to be calculated on the bulkdiscounts is causing problems because I'm not sure where it's being applied.

So, find the latest version of the code to the point I could get it to and see if you can figure out what I'm missing then report back...
Attachments
percentoffitemsincat-beta1.zip
beta 1 for 6.x compatibility
(8.07 KiB) Downloaded 1369 times
cargogirl
Posts: 1
Joined: Wed Feb 19, 2014 3:01 am
Location: sydney

Re: Discount Module: Category Discount when order value over

Post by cargogirl »

hi - did you have any luck modifying this to get it to work on the later version os ISC

would be very interested
DBMAN
Posts: 56
Joined: Sat Dec 25, 2010 1:18 am

Re: Discount Module: Category Discount when order value over

Post by DBMAN »

This looks like a useful edit overall but specifically right now I'm curious what exactly this means:
Display discount offer messages even when a product from the discounted categories above is not in the customers cart
and how it might be related (or be exactly what I'm looking for) to my request:
viewtopic.php?f=13&t=1972

Where I would like a simple message on item page of additional discount/sales to already site wide sale prices (all items). This is rather then the current procedure that only notes additional discounts inside the customers cart.
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: Discount Module: Category Discount when order value over

Post by Martin »

cargogirl wrote:hi - did you have any luck modifying this to get it to work on the later version os ISC

would be very interested
Hi, regrettably I realised I was flogging a fossilised horse (yes, THAT bad!) so I dropped it...

Time is at a premium so I've had to make some sensible decisions on where to put it..
Post Reply