| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public static function getBuyNowButton($arguments, $content = null): string |
||
| 36 | { |
||
| 37 | if (isset($arguments['permalink'])) { |
||
| 38 | $id = Convert::raw2att($arguments['permalink']); |
||
| 39 | unset($arguments['permalink']); |
||
| 40 | $siteURL = self::config()->get('checkout_domain'); |
||
| 41 | |||
| 42 | $link = "<a href=\"$siteURL/{$id}\""; |
||
| 43 | // Add all arguments as-is as we could potentially be receiving css class styles |
||
| 44 | foreach ($arguments as $key => $val) { |
||
| 45 | $val = Convert::raw2att($val); |
||
| 46 | $link .= " {$key}=\"{$val}\" "; |
||
| 47 | } |
||
| 48 | $link .= ">{$content}</a>"; |
||
| 49 | return $link; |
||
| 50 | } |
||
| 51 | return ''; |
||
| 52 | } |
||
| 54 |