I'm working on a mod that displays the correct shipping address for store pickup instead of the customers address in order confirmation, invoices, packing slips, etc. We occasionally go to shows and other events where customers can pickup orders, so the "shipping address" for store pickup can change. We do not want to change the official store address in the configuration table.
I've got it working pretty well using a special row of the address book that is accessed whenever store pickup shipping method is chosen, but I've had to hard code certain store pickup address data. I'd like to make this data defined constants that I can change for each show or event venue, but the normal define function won't work in methods within a class. I'm working in the order class. But I also need some of the constants in procedural code.
Having the same constants in define statements for procedural code and in const statements within a class for OO code seems poor programming and I'm not sure it would work. Querying the database multiple times to lookup constants using zen_get_configuration_key_value seems inefficient, or to query a custom table seems to be overkill.
Is there a way out of this mess? Or am I forced to use the database to store the constants?


Reply With Quote
