To achive maximum fruit you want maximum beneficial climate including plenty of fertilizer (whether it be organic or synthetic, but go light on nitrogen which does not mean don't let them have any at all), temperature, and light. Subjecting them to cold just stunts growth, including pods, as does limiting light, and getting too cold means the flowers will just be aborted. This last part is not all bad because in a small # of weeks you won't want the plant to try to produce new pods, instead putting its energy into finishing up the pods it already started.
Ultimately the plant responds best to a shift in light color temperature from normal daylight ~ 5000K to lower which is natural as fall moves in including reflections off leaves turning light colored.
The best way to get as many pods as possible is do all the above and put them in pots if not already in pots so you can bring them inside to finish up any pods they have started once it gets too cold outside for them. Do not wait until first frost to do this. Doing so will have subjected them to enough excessively cold days that they start to drop an excessive # of leaves from it. They will still drop leaves inside if there is a reduction in light but not so many as subjecting them to cold causes.
Frankly, I wouldn't start such a plant in June with a climate where they're no longer growing by December and greatly slowed down growing before then. If you wait that late it should be a plant that takes fewer days to maturity/pod-ripening unless you plan on finishing up inside with grow lights.