PI Module tep_cfg_select_option

Open to all! Ask other shopowners for help.
Post Reply
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

PI Module tep_cfg_select_option

Post by LeeFoster »

I'm working on a PI module and was hoping to be able to query the database to get a list of all tax classes to use in tep_cfg_select_option.

Is this possible? has it been done? I'm looking through the existing modules and can't find any examples of it being done.

Thanks in advance


Join The Code Co-op to get access to your library in the Code Co-op Forum
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: PI Module tep_cfg_select_option

Post by raiwa »

If I we’ll remember, shipping modules are doing this. Have a look into the flat rate module.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: PI Module tep_cfg_select_option

Post by ecartz »

Code: Select all

Config::select_tax_class(
or more generally

Code: Select all

Tax::fetch_classes
Along with the four shipping modules, ot_loworderfee uses this.
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: PI Module tep_cfg_select_option

Post by burt »

Code: Select all

Select('tax_class_id', Tax::fetch_classes())
See
https://github.com/CE-PhoenixCart/Phoen ... l.php#L188

if you click on the words "tep_tax_classes_pull_down", you should be able to see where it used in "References" inside the popup box...
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: PI Module tep_cfg_select_option

Post by LeeFoster »

Ok so I've got it showing the Tax classes now, just need to make the module appear only when the product has that tax class.

Thanks for your help.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply