| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Recently Viewed Products Options. |
| 5 |
* |
| 6 |
* @package Merchant |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly |
| 11 |
} |
| 12 |
|
| 13 |
// Settings |
| 14 |
Merchant_Admin_Options::create( array( |
| 15 |
'title' => __( 'Settings', 'merchant' ), |
| 16 |
'module' => 'recently-viewed-products', |
| 17 |
'fields' => array( |
| 18 |
|
| 19 |
// Title. |
| 20 |
array( |
| 21 |
'id' => 'title', |
| 22 |
'type' => 'text', |
| 23 |
'title' => __( 'Title', 'merchant' ), |
| 24 |
'default' => __( 'Recently Viewed', 'merchant' ) |
| 25 |
), |
| 26 |
|
| 27 |
// Title HTML Tag. |
| 28 |
array( |
| 29 |
'id' => 'title_tag', |
| 30 |
'type' => 'select', |
| 31 |
'title' => __( 'Title HTML tag', 'merchant' ), |
| 32 |
'options' => array( |
| 33 |
'h1' => __( 'H1', 'merchant' ), |
| 34 |
'h2' => __( 'H2', 'merchant' ), |
| 35 |
'h3' => __( 'H3', 'merchant' ), |
| 36 |
'h4' => __( 'H4', 'merchant' ), |
| 37 |
'h5' => __( 'H5', 'merchant' ), |
| 38 |
'h6' => __( 'H6', 'merchant' ), |
| 39 |
'div' => __( 'div', 'merchant' ) |
| 40 |
), |
| 41 |
'default' => 'h2' |
| 42 |
), |
| 43 |
|
| 44 |
// Hide Title. |
| 45 |
array( |
| 46 |
'id' => 'hide_title', |
| 47 |
'type' => 'switcher', |
| 48 |
'title' => __( 'Hide title', 'merchant' ), |
| 49 |
'desc' => __( 'Hide the title visually only. The title will continue being rendered in the HTML source code.', 'merchant' ), |
| 50 |
'default' => 0 |
| 51 |
), |
| 52 |
|
| 53 |
// Slider Style. |
| 54 |
array( |
| 55 |
'id' => 'slider', |
| 56 |
'type' => 'switcher', |
| 57 |
'title' => __( 'Slider style', 'merchant' ), |
| 58 |
'desc' => __( 'Display the products grid as a slider.' , 'merchant' ), |
| 59 |
'default' => 0 |
| 60 |
), |
| 61 |
|
| 62 |
// Slider Navigation. |
| 63 |
array( |
| 64 |
'id' => 'slider_nav', |
| 65 |
'type' => 'radio', |
| 66 |
'title' => __( 'Slider navigation', 'merchant' ), |
| 67 |
'options' => array( |
| 68 |
'always-show' => __( 'Always Show', 'merchant' ), |
| 69 |
'on-hover' => __( 'Show On Hover', 'merchant' ), |
| 70 |
), |
| 71 |
'default' => 'on-hover', |
| 72 |
'condition' => array( 'slider', '==', true ) |
| 73 |
), |
| 74 |
|
| 75 |
// Number of Products. |
| 76 |
array( |
| 77 |
'id' => 'posts_per_page', |
| 78 |
'type' => 'range', |
| 79 |
'title' => __( 'Products', 'merchant' ), |
| 80 |
'desc' => __( 'Controls the number of products to display in the products grid.', 'merchant' ), |
| 81 |
'min' => 1, |
| 82 |
'max' => 30, |
| 83 |
'step' => 1, |
| 84 |
'unit' => '', |
| 85 |
'default' => 10 |
| 86 |
), |
| 87 |
|
| 88 |
// Number of Columns. |
| 89 |
array( |
| 90 |
'id' => 'columns', |
| 91 |
'type' => 'range', |
| 92 |
'title' => __( 'Columns', 'merchant' ), |
| 93 |
'desc' => __( 'Controls the number of columns to display in the products grid.', 'merchant' ), |
| 94 |
'min' => 1, |
| 95 |
'max' => 6, |
| 96 |
'step' => 1, |
| 97 |
'unit' => '', |
| 98 |
'default' => 3 |
| 99 |
), |
| 100 |
|
| 101 |
// Columns Gap. |
| 102 |
array( |
| 103 |
'id' => 'columns_gap', |
| 104 |
'type' => 'range', |
| 105 |
'title' => __( 'Columns gap', 'merchant' ), |
| 106 |
'desc' => __( 'Controls gap between each column in the products grid.', 'merchant' ), |
| 107 |
'min' => 0, |
| 108 |
'max' => 100, |
| 109 |
'step' => 1, |
| 110 |
'unit' => 'px', |
| 111 |
'default' => 15 |
| 112 |
), |
| 113 |
|
| 114 |
// Order by. |
| 115 |
array( |
| 116 |
'id' => 'orderby', |
| 117 |
'type' => 'select', |
| 118 |
'title' => __( 'Order by', 'merchant' ), |
| 119 |
'options' => array( |
| 120 |
'id' => __( 'ID', 'merchant' ), |
| 121 |
'rand' => __( 'Random', 'merchant' ), |
| 122 |
'title' => __( 'TItle', 'merchant' ), |
| 123 |
'date' => __( 'Date', 'merchant' ), |
| 124 |
'modified' => __( 'Modified date', 'merchant' ), |
| 125 |
'menu_order' => __( 'Menu order', 'merchant' ), |
| 126 |
), |
| 127 |
'default' => 'rand' |
| 128 |
), |
| 129 |
|
| 130 |
// Order. |
| 131 |
array( |
| 132 |
'id' => 'order', |
| 133 |
'type' => 'select', |
| 134 |
'title' => __( 'Order', 'merchant' ), |
| 135 |
'options' => array( |
| 136 |
'asc' => __( 'Asc', 'merchant' ), |
| 137 |
'desc' => __( 'Desc', 'merchant' ) |
| 138 |
), |
| 139 |
'default' => 'desc' |
| 140 |
), |
| 141 |
|
| 142 |
// Hook Order. |
| 143 |
array( |
| 144 |
'id' => 'hook_order', |
| 145 |
'type' => 'range', |
| 146 |
'title' => __( 'Hook order', 'merchant' ), |
| 147 |
'desc' => __( 'Control the order from WooCommerce hook used to render the content on single product pages.', 'merchant' ), |
| 148 |
'min' => 1, |
| 149 |
'max' => 100, |
| 150 |
'step' => 1, |
| 151 |
'unit' => '', |
| 152 |
'default' => 20 |
| 153 |
), |
| 154 |
|
| 155 |
// colors. |
| 156 |
|
| 157 |
// Title color. |
| 158 |
array( |
| 159 |
'id' => 'title_color', |
| 160 |
'type' => 'color', |
| 161 |
'title' => __( 'Title color', 'merchant' ), |
| 162 |
'default' => '#212121' |
| 163 |
), |
| 164 |
|
| 165 |
// Navigation Icon color. |
| 166 |
array( |
| 167 |
'id' => 'navigation_icon_color', |
| 168 |
'type' => 'color', |
| 169 |
'title' => __( 'Navigation icon color', 'merchant' ), |
| 170 |
'default' => '#FFF', |
| 171 |
'condition' => array( 'slider', '==', true ) |
| 172 |
), |
| 173 |
|
| 174 |
// Naviation color. |
| 175 |
array( |
| 176 |
'id' => 'navigation_color', |
| 177 |
'type' => 'color', |
| 178 |
'title' => __( 'Navigation color', 'merchant' ), |
| 179 |
'default' => '#212121', |
| 180 |
'condition' => array( 'slider', '==', true ) |
| 181 |
), |
| 182 |
|
| 183 |
// Naviation color (hover). |
| 184 |
array( |
| 185 |
'id' => 'navigation_color_hover', |
| 186 |
'type' => 'color', |
| 187 |
'title' => __( 'Navigation color (hover)', 'merchant' ), |
| 188 |
'default' => '#757575', |
| 189 |
'condition' => array( 'slider', '==', true ) |
| 190 |
) |
| 191 |
|
| 192 |
) |
| 193 |
) ); |
| 194 |
|