Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 76 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Brands | |
0.00% |
0 / 76 |
|
0.00% |
0 / 2 |
72 | |
0.00% |
0 / 1 |
| get_brand_name | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| get_config | |
0.00% |
0 / 74 |
|
0.00% |
0 / 1 |
56 | |||
| 1 | <?php |
| 2 | namespace NewfoldLabs\WP\Module\ECommerce\Data; |
| 3 | |
| 4 | use NewfoldLabs\WP\ModuleLoader\Container; |
| 5 | /** |
| 6 | * Contains Brand information. |
| 7 | */ |
| 8 | final class Brands { |
| 9 | /** |
| 10 | * Retrieve and sanitize the brand name from the container. |
| 11 | * |
| 12 | * @param Container $container The container object that holds the plugin instance. |
| 13 | * @return string The sanitized brand name |
| 14 | * */ |
| 15 | private static function get_brand_name( Container $container ) { |
| 16 | $brand_raw_value = $container->plugin()->brand; |
| 17 | return \sanitize_title( str_replace( '_', '-', $brand_raw_value ) ); |
| 18 | } |
| 19 | /** |
| 20 | * Brand specific data |
| 21 | * |
| 22 | * @param Container $container The container object |
| 23 | * @return array |
| 24 | */ |
| 25 | public static function get_config( Container $container ) { |
| 26 | $brand = self::get_brand_name( $container ); |
| 27 | switch ( $brand ) { |
| 28 | case 'crazy-domains': |
| 29 | return array( |
| 30 | 'brand' => 'crazy-domains', |
| 31 | 'name' => 'CrazyDomains', |
| 32 | 'url' => 'https://crazydomains.com', |
| 33 | 'hireExpertsInfo' => 'admin.php?page=crazy-domains#/marketplace/services/blue-sky', |
| 34 | 'support' => 'https://www.crazydomains.in/contact', |
| 35 | 'adminPage' => 'admin.php?page=crazy-domains', |
| 36 | 'setup' => array( |
| 37 | 'payment' => array( 'PayPal' ), |
| 38 | 'shipping' => array( 'Shippo' ), |
| 39 | ), |
| 40 | 'defaultContact' => array( |
| 41 | 'woocommerce_default_country' => 'AU:NSW', |
| 42 | 'woocommerce_currency' => 'AUD', |
| 43 | ), |
| 44 | 'wondercartBuyNow' => '', |
| 45 | ); |
| 46 | |
| 47 | case 'bluehost-india': |
| 48 | return array( |
| 49 | 'brand' => 'bluehost-india', |
| 50 | 'name' => 'Bluehost', |
| 51 | 'url' => 'https://bluehost.in', |
| 52 | 'hireExpertsInfo' => 'https://www.bluehost.in/solutions/full-service', |
| 53 | 'support' => 'https://helpchat.bluehost.in', |
| 54 | 'adminPage' => 'admin.php?page=bluehost', |
| 55 | 'setup' => array( |
| 56 | 'payment' => array( 'PayPal', 'Razorpay', 'Stripe' ), |
| 57 | 'shipping' => array(), |
| 58 | ), |
| 59 | 'defaultContact' => array( |
| 60 | 'woocommerce_default_country' => 'IN:AP', |
| 61 | 'woocommerce_currency' => 'INR', |
| 62 | ), |
| 63 | 'wondercartBuyNow' => '', |
| 64 | ); |
| 65 | case 'hostgator': |
| 66 | case 'hostgator-latam': |
| 67 | return array( |
| 68 | 'brand' => 'hostgator', |
| 69 | 'name' => 'hostgator', |
| 70 | 'url' => 'https://hostgator.com', |
| 71 | 'hireExpertsInfo' => 'admin.php?page=hostgator#/marketplace/services/blue-sky', |
| 72 | 'support' => 'https://www.hostgator.com/contact', |
| 73 | 'adminPage' => 'admin.php?page=hostgator', |
| 74 | 'setup' => array( |
| 75 | 'payment' => array( 'PayPal', 'Razorpay', 'Stripe' ), |
| 76 | 'shipping' => array(), |
| 77 | ), |
| 78 | 'defaultContact' => array( |
| 79 | 'woocommerce_default_country' => 'BR:AL', |
| 80 | 'woocommerce_currency' => 'BRL', |
| 81 | ), |
| 82 | 'wondercartBuyNow' => '', |
| 83 | ); |
| 84 | case 'bluehost': |
| 85 | default: |
| 86 | return array( |
| 87 | 'brand' => 'bluehost', |
| 88 | 'name' => 'Bluehost', |
| 89 | 'url' => 'https://bluehost.com', |
| 90 | 'hireExpertsInfo' => 'admin.php?page=bluehost#/marketplace/services/blue-sky', |
| 91 | 'support' => 'https://www.bluehost.com/contact', |
| 92 | 'adminPage' => 'admin.php?page=bluehost', |
| 93 | 'setup' => array( |
| 94 | 'payment' => array( 'PayPal', 'Razorpay', 'Stripe' ), |
| 95 | 'shipping' => array( 'Shippo' ), |
| 96 | ), |
| 97 | 'defaultContact' => array( |
| 98 | 'woocommerce_default_country' => 'US:AZ', |
| 99 | 'woocommerce_currency' => 'USD', |
| 100 | ), |
| 101 | 'wondercartBuyNow' => 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product', |
| 102 | ); |
| 103 | } |
| 104 | } |
| 105 | } |