Zen Cart Logo
Forums / General Questions / Where should i put this stray string function that i wrote, and is needed in several

Where should i put this stray string function that i wrote, and is needed in several

Views: 609

Results 1 to 2 of 2
7 Apr 2013, 1:00 AM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Where should i put this stray string function that i wrote, and is needed in several

Advice on (where in the ZenCart universe) to put this stray function

For my client I've installed a UPS XML plugin. This plug-in works fine except my client like does like that fact it displays weight and package information to the customer. it displays it on the invoice, packing slip and on the check out page.

i've written a string function that turns this:
United Parcel Service (1 pkg, 7 lbs total) (UPS Ground):
into this:
UPS Ground.

I'd like advice on where to put this function so it can be called on the above mention pages.

OR, is there a better way to handle this? should it be put in a class file?

thanks!,

7 Apr 2013, 1:31 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Where should i put this stray string function that i wrote, and is needed in several

If you don't want the long description to show anywhere, then why not just change the shipping module to output the very abbreviated version you're saying your long function alters it to?
Or is there some reason for wanting it to still display the long version even though you're trying to change its display most places where it would be used?

You can change the $this->quotes array built in the quote() "function" of your shipping module class.