The default button can be changed with the ct_catalog.css_template.default (path) hook
If you want to minify the buttons CSS this hook will do it for you,
1 |
ct_catalog.css.minify(true) |
by default the minify functionality is set to true.
Add custom template button
With the ct_catalog.css_template hook can be added new templates to the plugin
Example:
Lets add a new button style to the settings select list:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
add_filter('ct_catalog.css_template.styles','addCatalogstyleSelect'); function 'addCatalogstyleSelect'($list){ $list['custom-style-name'] = __('New Button Style','custom'); return $list; } Once we have the button on the list lets add the path for the stylesheet file add_filter('ct_catalog.css_template','addCatalogStyle',10,2); function 'addCatalogStyle'($current,$name){ if ($name=='custom-style-name'){ $current ='http://www.example.com/assets/custom_style.css'; } return $current; } |
All done, now have button will have your custom stylsheet.
If for some reason the price need to be hidden or shown there is a hook for that too:
1 |
‘ct_catalog.price.enable’ |
On this example lets hide a price if the value is bigger than 5
1 2 3 4 5 6 7 8 9 10 11 |
add_filter('ct_catalog.price.enable', 'changePriceVisibility', 10, 2); function changePriceVisibility($status, $price) { $status = 'yes'; if ($price > 5) { $status = 'no'; } return $status; } |