currency-switcher
4 weeks ago
multi-currency
4 weeks ago
setup
4 weeks ago
status
4 weeks ago
store-urls
4 weeks ago
class-wcml-currencies-dropdown-ui.php
5 years ago
class-wcml-custom-files-ui.php
4 weeks ago
class-wcml-languages-upgrade-notice.php
4 years ago
class-wcml-menus-wrap-base.php
4 weeks ago
class-wcml-menus-wrap.php
4 weeks ago
class-wcml-multilingual-ui.php
9 months ago
class-wcml-not-translatable-attributes.php
4 weeks ago
class-wcml-pointer-ui.php
1 year ago
class-wcml-removed-cart-items-ui.php
4 weeks ago
class-wcml-settings-ui.php
4 weeks ago
class-wcml-st-taxonomy-ui.php
11 months ago
class-wcml-sync-taxonomy.php
4 weeks ago
class-wcml-templates-factory.php
4 weeks ago
class-wcml-troubleshooting-ui.php
4 weeks ago
class-wcml-st-taxonomy-ui.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_St_Taxonomy_UI extends WCML_Templates_Factory { |
| 4 | |
| 5 | private $taxonomy_obj; |
| 6 | |
| 7 | public function __construct( $taxonomy_obj ) { |
| 8 | parent::__construct(); |
| 9 | |
| 10 | $this->taxonomy_obj = $taxonomy_obj; |
| 11 | } |
| 12 | |
| 13 | public function get_model() { |
| 14 | |
| 15 | if ( $this->taxonomy_obj->publicly_queryable ) { |
| 16 | $model = [ |
| 17 | 'link_url' => \WCML\Utilities\AdminUrl::getStoreURLTab(), |
| 18 | /* translators: %s is a taxonomy name */ |
| 19 | 'link_label' => sprintf( __( 'Set different slugs in different languages for %s on WPML Multilingual & Multicurrency for WooCommerce URLs translations page', |
| 20 | 'woocommerce-multilingual' ), $this->taxonomy_obj->labels->name ), |
| 21 | ]; |
| 22 | } else { |
| 23 | $attrid = wc_attribute_taxonomy_id_by_name( $this->taxonomy_obj->name ); |
| 24 | $model = [ |
| 25 | 'link_url' => admin_url( 'edit.php?post_type=product&page=product_attributes&edit=' . $attrid ), |
| 26 | /* translators: %s is an attribute name */ |
| 27 | 'link_label' => sprintf( __( 'To translate the attribute slug, please set the option "Enable archives?" for the attribute %s in WooCommerce', |
| 28 | 'woocommerce-multilingual' ), $this->taxonomy_obj->labels->name ), |
| 29 | ]; |
| 30 | |
| 31 | } |
| 32 | |
| 33 | return $model; |
| 34 | |
| 35 | } |
| 36 | |
| 37 | public function render() { |
| 38 | |
| 39 | return $this->show(); |
| 40 | } |
| 41 | |
| 42 | protected function init_template_base_dir() { |
| 43 | $this->template_paths = [ |
| 44 | WCML_PLUGIN_PATH . '/templates/', |
| 45 | ]; |
| 46 | } |
| 47 | |
| 48 | public function get_template() { |
| 49 | return 'st-taxonomy-ui.twig'; |
| 50 | } |
| 51 | |
| 52 | } |
| 53 |