From 01ab0f98d834423b312c5ad3d406173f21fd48d5 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Mon, 2 Jul 2018 08:39:41 +0000 Subject: [PATCH] version 2 released --- css/admin_style.css | 6 +- css/style.css | 1053 +++++++++++++++++++++++++++++++++-- inc/admin_setting_panel.php | 61 +- inc/mep_cpt.php | 2 +- inc/mep_event_meta.php | 578 +++++++++++++++++-- inc/mep_extra_price.php | 238 ++++++-- inc/mep_shortcode.php | 217 +++++++- js/mkb-scripts.js | 64 +-- readme.txt | 137 +++-- templates/single-events.php | 267 +++++---- woocommerce-event-press.php | 718 +++++++++++++++++------- 11 files changed, 2746 insertions(+), 595 deletions(-) diff --git a/css/admin_style.css b/css/admin_style.css index 5cffcbf..f31076c 100644 --- a/css/admin_style.css +++ b/css/admin_style.css @@ -32,7 +32,11 @@ font-weight: normal; display: block; } - +table.atendee-info { + display: block; + overflow: hidden; + width: 100%; +} /* Always set the map height explicitly to define the size of the div * element that contains the map. */ diff --git a/css/style.css b/css/style.css index 88bb18a..94c9200 100644 --- a/css/style.css +++ b/css/style.css @@ -35,14 +35,20 @@ display: block; } .btn-mep-event-cart { - background: #007acc; - display: block; - color: #fff !important; - padding: 15px 30px; - text-decoration: navajowhite; - font-size: 18px; - font-weight: bold; - text-transform: uppercase; + + background: #007acc; + display: block; + color: #fff !important; + padding: 15px 30px !important; + text-decoration: navajowhite; + font-size: 18px !important; + font-weight: bold; + text-transform: uppercase; + border: 0; + width: 280px; + margin: 0 auto; + cursor: pointer; + } .cart-btn-sec { text-align: center; @@ -66,7 +72,8 @@ overflow: hidden; } .mep-event-thumbnail { - height: 280px; + height: auto; + min-height: 280px; } .mep-event-title-header { overflow: hidden; @@ -133,7 +140,7 @@ margin: 0; padding: 10px 0; } .mep-social-share li a { - border: 1px solid; + border: 0px solid; color: #000; border-radius: 0; padding: 0; @@ -145,12 +152,49 @@ margin: 0; margin: 0 2px; font-size: 20px; } +.mep-user-ticket-list table tr { + border-bottom: 1px solid #ddd; +} +.mep-user-ticket-list table tr td { + padding: 10px 0; + font-size: 12px; +} + +.mep-user-ticket-list table { + width: 100%; +} + +.mep-user-ticket-list table th { + text-align: left; + border-bottom: 1px solid #ddd; + background: #ccc; + padding: 2px 5px; +} +.mep-event-theme-1 button.single_add_to_cart_button.button.alt.btn-mep-event-cart { + margin-top: 10px; +} + +.mep-event-theme-1 .cart-btn-sec table { + margin-bottom: 10px; +} +.mep-event-title-header p { + padding: 0; + margin: 0; +} + +.mep-event-title-header h2 { + padding: 0; + margin: 0; +} +.mep-event-theme-1 .cart-btn-sec table tr td { + width: 40%; +} .mep_event_list { display: block; overflow: hidden; } -.mep_event_list_item { +.mep_event_grid_item { border: 1px solid #ddd; margin-bottom: 20px; padding: 5px; @@ -237,10 +281,14 @@ margin: 0; text-align: left; } #usertotal { - display: block; - text-align: left; - font-size: 17px; - margin: 10px 0; + display: block; + text-align: center; + font-size: 17px; + margin: 10px 0; + font-weight: bold; +} +input.mep_input { + border-color: #ddd; } .eventtotal { font-weight: bold; @@ -266,49 +314,254 @@ margin: 0; margin: 20px 0 5px 0; font-size: 18px; } + .mep_event_list_item { - border: 1px solid #ddd; - margin-bottom: 20px; - padding: 5px; - overflow: hidden; - width: 31%; - display: inline-block; - vertical-align: top; - min-height: 270px; + overflow: hidden; + margin: 10px 0; + border: 1px solid #ddd; + margin-bottom: 3%; + padding: 0px; + vertical-align: top; + /*box-shadow: 0px 0px 6px 1px #d9d9d9;*/ + -webkit-transition: all 0.3s ease-in-out; + -o-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; +} +.mep_event_list_item:hover { + border-color: #ffbe30; +} +.mep_event_list_item .mep_list_thumb img { + width: auto; + height: auto; + max-height: 100%; + min-height: 166px; + vertical-align: text-bottom; + max-width: 100%; +} +.mep_event_list_item .mep_list_thumb { + width: 30%; + display: inline-block; + vertical-align: top; + max-height: 100%; + padding: 10px; + position: relative; +} +.mep-ev-start-date { + position: absolute; + top: 10px; + left: 10px; + background: #ffbe30; + text-align: center; + padding: 6px 0 0 0; + height: 50px; + width: 50px; + color: #fff; + box-sizing: unset; +} + +.mep-day { + font-weight: bold; + font-size: 18px; +} + +.mep-month { + padding: 0; + margin: 0; + font-weight: normal; +} +.mep_event_list_item .mep_list_event_details { + display: inline-block; + width: 69%; +} +.mep-event-excerpt p { +margin: 0!important; + padding: 0; +} + +.mep_event_grid_item { + border: 1px solid #ddd; + margin-bottom: 3%; + padding: 0px; + overflow: hidden; + width: 46%; + display: inline-block; + vertical-align: top; + min-height: 248px; + box-shadow: 0px 0px 6px 1px #d9d9d9; + margin-right: 3%; + +} +.mep-list-footer ul { + padding: 0!important; + margin: 0!important; + list-style: none!important; +} + +.mep-list-footer ul li { + display: inline-block; + width: auto; + margin: 0 10px 0 0; + min-width: 30%; + overflow: hidden; + vertical-align: top; +} +h3.mep_list_date i, .mep-list-footer ul li i{ + background: #ffbe30; + color: #fff; + font-size: 15px; + height: 30px; + width: 30px; + border-radius: 100%; + text-align: center; + padding-top: 6px; +} +.evl-ico { + width: 35px; + float: left; +} + +.evl-cc { + width: 65%; + float: left; + vertical-align: top; + text-align: left; + padding-left: 3px; +} + +.evl-cc h5 { + padding: 0!important; + margin: 0!important; + font-size: 12px!important; + letter-spacing: 0!important; +} + +.evl-cc h6 { + font-size: 15px!important; + font-weight: bold!important; + letter-spacing: 0!important; + margin: 0!important; +} +.mep_event_list_item .mep-list-header { + position: relative; +} +.mep_event_list_item .mep-list-header:before { + position: absolute; + width: 0; + height: 100%; + border-right: 5px solid #f9cc3b; + top: 0; + left: 0; + content: ""; + z-index: 999999; +} + + +.mep-list-footer { + border-top: 0px solid #ddd; + padding-top: 10px; +} +.mep_event_grid_item:nth-child(2), .mep_event_grid_item:nth-child(4), .mep_event_grid_item:nth-child(6), .mep_event_grid_item:nth-child(8), .mep_event_grid_item:nth-child(10), .mep_event_grid_item:nth-child(12) { + margin-right: 0; } .mep_list_thumb { - width: 100%; - float: left; +width: 100%; + float: none; + overflow: hidden; + max-height: 155px; + position: relative; +} +.mep_event_grid_item .mep-list-footer ul li { + display: block; + width: 100%; + margin-bottom: 10px; +} + +.mep_event_grid_item .mep-list-footer ul li h5, .mep_event_grid_item .mep-list-footer ul li h6 { + display: inline-block; +} + +.mep_event_grid_item .mep-list-footer ul li h5 { + font-size: 15px!important; +} + +.mep_event_grid_item .mep-list-footer ul li h6 { + font-size: 15px!important; +} + +.mep_event_grid_item .mep-list-footer ul li .evl-cc { + padding-top: 4px; +} +.mep_event_grid_item .mep-list-header { + position: relative; +} + +.mep_event_grid_item .mep-list-header:before { + position: absolute; + border-left: 5px solid #ffbe30; + top: 0; + left: 0px; + width: 100%; + height: 100%; + content: ""; } .mep_list_thumb img { - width: 100%; - min-height: 130px; +width: 100%; + min-height: 155px; + /* max-height: 130px; */ + /* overflow: hidden; */ + height: auto; +} +.mep-list-footer ul li:last-child { +/* text-align: right; + padding-bottom: 10px; + padding-right: 10px;*/ } .mep_list_event_details { - width: 100%; - float: none; - overflow: hidden; - padding-left: 0; - padding-top: 0; - position: relative; + width: 100%; + float: none; + overflow: hidden; + /* padding-left: 0; */ + /* padding-top: 0; */ + position: relative; + padding: 0px; +} +.mep-list-header, .mep-list-footer { + padding-left: 10px; +} +.mep-list-footer ul li p { + padding: 0!important; + margin: 0!important; } html body .mep_event_list .mep_list_event_details a { color: #000; text-decoration: none; } .mep_event_list .mep_list_title { - font-size: 20px; - font-weight: bold; - display: block; - margin-bottom: 8px !important; + font-size: 22px!important; + font-weight: bold!important; + display: block; + margin-bottom: 8px !important; } .mep_event_list .mep_list_date { - font-size: 13px; - font-style: italic; - display: block; - margin: 0 0 10px 0 !important; -} +font-size: 14px; + font-style: italic; + display: block; + margin: 0 0 10px 0 !important; + font-weight: bold; + color: #ffbe30; +} +.mep_list_title{ + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + +} +.mep-list-footer ul li:last-child { +/* text-align: right; + padding-right: 10px; + padding-bottom: 10px;*/ +} #quantity_5a7abbd1bff73 { width: 60px; } @@ -330,7 +583,674 @@ html body .mep_event_list .mep_list_event_details a { margin-right: 10px; display: inline-block; } +.extra-qty-box { + width: 45px!important; + display: inline-block!important; + padding: 4px 5px!important; +} +.xtra-item-left { +font-size: 10px; +font-style: italic; +margin-top: 3px; +margin: 0px 0 3px 0; +} +.mep-hidden { + display: none!important; +} +.mep-reg-user-details { + width: 400px; + margin: 0 auto; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; +} +.mep-reg-user-details table tr td { + border-color: #ddd; + padding: 10px; +} + +.mep-reg-user-details table tr td img { + border-radius: 100%; + margin: 20px 0; + width: 100px; +} + +.mep-reg-user-details table tr td h2 { + font-size: 25px; + margin: 0; + padding: 0; +} + +.mep-reg-user-details table tr td h3 { + font-size: 14px; + margin: 10px 0; + padding: 0; + font-weight: bold; +} + +.mep-reg-user-details table tr td h4 { + font-size: 16px; +} + + +.cart-btn-sec table { + width: 100%; +} +.cart-btn-sec table tr td { + border: 1px solid #ddd; + padding: 3px; +} +.cart-btn-sec table tr td input { + padding: 0 !important; + height: 30px; + border: 1px solid #ddd; + width: 45px !important; +} + +.cart-btn-sec table tr td select { + border: 1px solid #ddd; + float: left; + display: block; + width: 100%; + padding: 0 !important; + height: 35px; +} +.mep-user-info-sec input, .mep-user-info-sec select { + + padding: 10px; + margin: 5px 0; + height: auto; + width: 100%; + border: 1px solid #ddd; + +} +.mep-user-info-sec { + + border: 1px solid #ddd; + margin: 10px 0; + padding: 3px; + +} +h3.ex-sec-title { + text-align: left; + font-size: 20px; + margin: 20px 0 -5px 0; + padding: 0!important; +} +.user-info-sec .dada-info .mep-user-info-sec { + overflow: hidden; + background: #dedede61; +} +.user-info-sec .dada-info .mep-user-info-sec input { + display: block; + width: 100%!important; + padding: 5px 5px!important; + height: auto; +} +label.mep-show { + display: block; + overflow: hidden; +} + +/*Theme 2*/ +.mep-template-2-hamza { + display: block; + overflow: hidden; +} + +.mep-tem2-title h2 { + padding: 0; + margin: 0; + font-size: 25px; +} + +.mep-tem2-date { + margin-bottom: 20px; +} + +.mep-tem2-date p { + font-size: 16px; + padding: 0; + margin: 0; +} + +.mep-tem2-thumbnail { + display: block; + margin-bottom: 20px; +} + +.mep-tem2-thumbnail img { + max-width: 100%; + height: auto; + width: auto; + max-height: 100%; +} + +.mep-tem2-details { + margin-bottom: 20px; +} + +.tem2-carts { + width: 100%; + background: #f7f7f7; + padding: 20px; + margin-bottom: 20px; + border-radius: 5px; +} + +.tem2-carts form { + /* width: 700px; */ +} + +.tem2-carts table tr td { + border-color: #ddd!important; + border-bottom: 1px solid; +} + +.mep-tem2-venue { + background: #f7f7f7; + padding: 20px; + border-radius: 5px; + overflow: hidden; +} + +.tm2-location { + width: 30%; + float: left; + overflow: hidden; +} + +.tm2-map { + width: 70%; + float: left; + overflow: hidden; +} + +.tm2-location h3 { + font-size: 20px; + font-weight: bold; + margin: 0; + padding: 0; +} + + +.mep-template-2-hamza .mep-social-share li a { + border: 0; +} + +.tm2-share-button { + margin: 20px 0; +} +.tem2-carts h3,.tem2-carts h4,.tem2-carts h5 { + margin: 0; + padding: 0; +} + +.tem2-carts table { + width: 100%; + margin-bottom:20px; +} + +.tem2-carts table tr td { + width: 30%; + text-align: left; +} + +.tem2-carts .extra-qty-box { + border: 1px solid #ddd; + padding: 0; + margin: 0; + height: auto; +} + +.tem2-carts table tr td #usertotal { + text-align: left; +} +.mep_list_event_details h2 { + font-size: 20px!important; + margin: 10px 0; +} + +.mep_list_event_details p { + font-size: 14px; +} +.tm2-map .mep_google_map { + width: 100%; + min-height: 350px; +} +.tem2-carts .mep-user-info-sec { + width: 500px; + padding: 20px; +} + +.mep-template-2-hamza .tem2-carts .mep-user-info-sec input { + border: 1px solid #ccc; + padding: 12px!important; + height: auto; + margin: 15px 0; +} + +/*Theme 3| Shahan*/ +.mep-tem3-title-sec { + background: #1A84A5; + color: #fff; + padding: 20px; + margin: 10px 0; +} + +.mep-tem3-datetime i,.mep-tem3-datetime p { + display: inline-block; +} + +.mep-tem3-datetime i { + margin-right: 5px; +} + +.mep-tem3-location i, .mep-tem3-location p { + display: inline-block; +} + +.mep-tem3-location i { + margin-right: 7px; +} + +.mep-tem3-location p { + margin: 0 1px; + padding: 0; +} + +.mep-tem3-datetime p { + padding: 0; + margin: 0; +} + +.mep-tem3-title h2 { + padding: 0; + margin: 0 0 10px 0; +} +.mid-sec-left { + width: 70%; + float: left; +} + +.mep-tem3-mid-sec { + overflow: hidden; +} + +.mid-sec-right { + float: left; + width: 30%; + padding: 20px; +} + +.mep-tem3-share-btn ul { + display: block; + overflow: hidden; + text-align: left; +} + +.mep-tem3-share-btn .mep-event-meta { + margin-top: 20px; +} +.mep-tem3-event-details { + margin: 20px 0; +} +.mep-tem3-title h2 { + color: #fff; +} +.mep-tem3-share-btn h3, .mep-tem3-share-btn h5 { + padding: 0; + margin: 0; +} +.mep-tem3-cart-sec > table { + display: none!important; +} + +.mep-tem3-title h2 { + color: #fff; +} + +.mep-tem3-share-btn h3, .mep-tem3-share-btn h5 { + padding: 0; + margin: 0; +} + +.mep-tem3-cart-sec h5 { + padding: 0; + margin: 0; +} + +.mep-tem3-cart-sec .mep-user-info-sec { + padding: 10px; +} +.mep-tem3-cart-sec table { + width: 100%; + margin: 20px 0; +} + +.mep-tem3-cart-sec table tr { + border-bottom: 1px solid #ddd; +} + +.mep-tem3-cart-sec table tr td .extra-qty-box { + padding: 0; + margin: 0; + height: auto; + border: 1px solid #ddd; +} + +.mep-tem3-cart-sec table tr td #usertotal { + text-align: right; + padding-right: 20px; +} +.equinox .week-events .slot { + margin: 0; + list-style: none; +} +.equinox .date-events { + padding: 0!important; +} +.equinox .event-container { + list-style: none; +} +.mep-event-cat-controls { + display: block; + overflow: hidden; + margin-bottom: 20px; +} +.mep-cat-control{ + position: relative; + z-index: 1; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + -webkit-font-smoothing: antialiased; + border-radius: 0; + cursor: pointer; + display: inline-block; + font-size: 1rem; + font-weight: 400; + letter-spacing: 0; + padding: 0.75em 1.5em; + text-decoration: none; + user-select: none; + vertical-align: middle; + white-space: nowrap; + -webkit-transition: all 0.3s ease-in-out; + -moz-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; + border: 1px solid #ccc; +} +.mep-event-excerpt { + overflow: hidden; + white-space: nowrap; + padding-left: 10px; + padding-right: 77px; + margin-right: 16px; + padding-bottom: 20px; +} + +.pagination-sec { + border-top: 1px solid #ddd; + padding: 50px 0 70px; +} +.page-numbers { + border: 1px solid #ddd; + padding: 5px 15px; +} +.page-numbers.current { + background: #ddd; + color: #000; + border-color: #ddd; + display: inline-block; +} +.pagination-sec a { + display: inline-block; + /* float: left; */ +} + +.pagination-sec br { + display: none; +} + + + + + +/*Default Theme Styles*/ +.mep-default-theme { + overflow: hidden; +} + +.mep-default-content { + width: 75%; + float: left; + overflow: hidden; + padding-right: 20px; +} + +.mep-default-sidebar { + overflow: hidden; + width: 25%; + float: left; +} +.mep-default-feature-date-location { + margin: 30px 0; + overflow: hidden; +} + +.mep-default-feature-date, .mep-default-feature-location, .mep-default-feature-time { + width: 30%; + background: #f7f7f7; + padding: 15px; + float: left; + margin: 0 25px 0 0; + overflow: hidden; +} + +.df-ico { + width: 25%; + overflow: hidden; + float: left; +} + +.df-dtl { + width: 75%; + float: left; + overflow: hidden; +} + +.df-dtl h3 { + font-size: 15px; + color: #878787; + padding: 0; + margin: 0; +} + +.df-dtl p { + color: #000; + font-weight: bold; + padding: 0; + margin: 0; +} + +.df-ico i { + background: #ffbe30; + color: #fff; + font-size: 25px; + border-radius: 100%; + width: 45px; + height: 45px; + text-align: center; + padding-top: 10px; +} +.df-sidebar-part { + background: #f7f7f7; + padding: 0; + margin: 20px 0; +} + +.mep-default-sidrbar-price-seat { + border-bottom: 1px solid #ddd; + text-align: center; + margin-bottom: 30px; +} + +.df-price { + padding: 20px; + font-size: 25px; + font-weight: bold; +} + +.df-price h3 { + padding: 0; + margin: 0 0 5px 0; + font-size: 15px; + color: #808080; +} +.mep-default-sidrbar-meta i { + background: #ffbe30; + color: #fff; + font-size: 25px; + border-radius: 100%; + width: 45px; + height: 45px; + text-align: center; + padding-top: 10px; + float: left; +} +.mep-default-sidrbar-meta { + overflow: hidden; + padding-left: 10px; + margin-bottom: 15px; +} + +.mep-default-sidrbar-meta p { + float: left; + padding-left: 10px; + font-size: 16px; + font-weight: bold; + padding-top: 5px; +} +.mep-default-sidrbar-address ul { + padding: 0; + margin: 0; + list-style: none; +} + +.mep-default-sidrbar-address ul li { + font-size: 15px; + padding-left: 10px; + margin-bottom: 5px; +} + +.mep-default-sidrbar-address ul li p { + display: inline-block; + padding: 0; + margin: 0; +} + +.mep-default-sidrbar-address ul li i { + background: #ffbe30; + color: #fff; + width: 20px; + height: 20px; + text-align: center; + border-radius: 100%; + padding-top: 2px; +} +.mep-default-sidrbar-social { + padding: 10px; +} + +.mep-default-sidrbar-social ul { + display: block; + text-align: center; +} + + +.mep-default-sidrbar-social ul li a { + padding: 5px 0 0 0; + margin: 0 5px; + background: #ffbe30; + color: #fff; + height: 50px; + width: 50px; + border-radius: 100%; + font-size: 30px; +} + +.mep-default-sidrbar-calender-btn { + padding: 10px 10px 30px; + text-align: center; +} +.mep-default-sidrbar-calender-btn a, .mep-default-feature-cart-sec button.single_add_to_cart_button.button.alt.btn-mep-event-cart { + z-index: 1; + font-weight: 600; + overflow: hidden; + padding: 15px 35px; + text-align: center; + position: relative; + border-radius: 50px; + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + font-size: 14px; + text-transform: uppercase; + background: #ffbe30; + color: #ffffff !important; + -webkit-box-shadow: 0 5px 60px 5px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 60px 5px rgba(0, 0, 0, 0.2); +border: 0; +} +.mep-default-feature-cart-sec button.single_add_to_cart_button.button.alt.btn-mep-event-cart { + margin: 20px auto 30px!important; + width: 300px; + display: inherit; + margin-bottom: 30px; +} +.mep-default-feature-cart-sec { + border: 1px solid #ddd; + padding: 0; +} + +.mep-default-feature-cart-sec h3 { + border-radius: 0; + padding: 15px 15px!important; + color: rgba(255, 255, 255, 0.8); + background: -webkit-gradient(linear, left top, right bottom, from(#ff3e00), to(#ffbe30)); + background: -webkit-linear-gradient(top left, #ff3e00, #ffbe30); + background: -o-linear-gradient(top left, #ff3e00, #ffbe30); + background: linear-gradient(to bottom right, #ff3e00, #ffbe30); + margin: 0; +} +.mep-default-feature-cart-sec table td { + border-bottom: 1px solid #f0f0f0; + padding: 10px; +} +.mep-default-feature-cart-sec .mep_input { + border: 1px solid #ddd; +} +.mep-default-feature-cart-sec .user-info-sec h5 { + padding: 10px 5px; + border: 0; + margin: 0; +} +.mep-default-feature-cart-sec .mep-user-info-sec{ + border: 0; +} +.mep-default-feature-cart-sec table { + width: 100%; +} +.mep-default-feature-cart-sec .extra-qty-box { + padding: 0; + margin: 0; + height: auto; + border: 1px solid #ddd; +} /* Responsive CSS =====================================================================*/ @media only screen and (min-width: 768px) and (max-width: 990px) { @@ -342,7 +1262,7 @@ html body .mep_event_list .mep_list_event_details a { .mep-events-wrapper { margin: auto 5px; } -.mep_event_list_item { +.mep_event_grid_item { width: 100%; } .mep-left-col { @@ -390,7 +1310,7 @@ html body .mep_event_list .mep_list_event_details a { .mep-events-wrapper { margin: auto 5px; } -.mep_event_list_item { +.mep_event_grid_item { width: 100%; } .mep-left-col { @@ -406,16 +1326,37 @@ html body .mep_event_list .mep_list_event_details a { } .mep-event-thumbnail { height: auto; + min-height: auto; + } .mep-right-col { width: 100%; float: none; overflow: hidden; } +.btn-mep-event-cart { + padding: 20px 20px !important; + font-size: 14px !important; + width: 100%; +} .mep-reg-btn-sec { margin: 10px 0; padding: 10px; } +.tm2-location { + width: 100%; + float: none; + overflow: hidden; +} +.tm2-map { + width: 100%; + float: none; + overflow: hidden; +} +.mid-sec-left { + width: 100%; + float: none; +} .mep-event-datetime, .mep-event-location { padding: 10px; } @@ -425,6 +1366,14 @@ html body .mep_event_list .mep_list_event_details a { .mep-event-title-header { padding: 10px; } +.mep-tem3-datetime p, .mep-tem3-location p { + font-size: 12px; +} +.mid-sec-right { + float: none; + width: 100%; + padding: 20px 0; +} .mep-event-title-header h2 { font-size: 23px; line-height: 25px; @@ -433,13 +1382,27 @@ html body .mep_event_list .mep_list_event_details a { .mep-event-datetime { padding: 0; } +.mep_event_list_item .mep_list_thumb { + width: 100%; + display: block; + vertical-align: top; + max-height: 100%; +} +.mep_event_list_item .mep_list_event_details { + display: block; + width: 100%; + padding-right: 10px; +} +.mep-cat-control { + width: 49%; +} } @media (max-width: 319px) { .mep-events-wrapper { margin: auto 5px; } -.mep_event_list_item { +.mep_event_grid_item { width: 100%; } .mep-left-col { diff --git a/inc/admin_setting_panel.php b/inc/admin_setting_panel.php index 2d01e83..b50b7c2 100644 --- a/inc/admin_setting_panel.php +++ b/inc/admin_setting_panel.php @@ -32,12 +32,20 @@ class MAGE_Events_Setting_Controls { } function get_settings_sections() { + $sections = array( array( 'id' => 'general_setting_sec', 'title' => __( 'General Settings', 'vaincode' ) - ) + ), + array( + 'id' => 'email_setting_sec', + 'title' => __( 'Email Settings', 'vaincode' ) + ) ); + + + return $sections; } @@ -49,6 +57,7 @@ class MAGE_Events_Setting_Controls { function get_settings_fields() { $settings_fields = array( 'general_setting_sec' => array( + array( 'name' => 'google-map-api', 'label' => __( 'Google Map API Key', 'mep' ), @@ -56,7 +65,57 @@ class MAGE_Events_Setting_Controls { 'type' => 'text', 'default' => '' ), + + array( + 'name' => 'mep_global_single_template', + 'label' => __( 'Event Details Template', 'mep' ), + 'desc' => __( 'Event Details Template', 'mep' ), + 'type' => 'select', + 'default' => 'no', + 'options' => event_template_name() + ), ), + + 'email_setting_sec' => array( + + + array( + 'name' => 'mep_email_form_name', + 'label' => __( 'Email Form Name', 'mep' ), + 'desc' => __( 'Email Form Name', 'mep' ), + 'type' => 'text' + ), + + array( + 'name' => 'mep_email_form_email', + 'label' => __( 'Form Email', 'mep' ), + 'desc' => __( 'Form Email', 'mep' ), + 'type' => 'text' + ), + + array( + 'name' => 'mep_email_subject', + 'label' => __( 'Email Subject', 'mep' ), + 'desc' => __( 'Email Subject', 'mep' ), + 'type' => 'text' + ), + + + + + array( + 'name' => 'mep_confirmation_email_text', + 'label' => __( 'Confirmation Email Text', 'mep' ), + 'desc' => __( 'Confirmation Email Text', 'mep' ), + 'type' => 'textarea', + 'default' => '', + ), + ), + + + + + ); return $settings_fields; diff --git a/inc/mep_cpt.php b/inc/mep_cpt.php index bfe60f6..d5ab79b 100644 --- a/inc/mep_cpt.php +++ b/inc/mep_cpt.php @@ -1,9 +1,9 @@ _x( 'Events', 'mep' ), 'singular_name' => _x( 'Events', 'mep' ), diff --git a/inc/mep_event_meta.php b/inc/mep_event_meta.php index 4e5f11c..516b4e1 100644 --- a/inc/mep_event_meta.php +++ b/inc/mep_event_meta.php @@ -5,11 +5,19 @@ add_action( 'add_meta_boxes', 'mep_event_meta_box_add' ); function mep_event_meta_box_add(){ add_meta_box( 'mep-event-meta', 'Event Venue', 'mep_event_venue_meta_box_cb', 'mep_events', 'normal', 'high' ); - add_meta_box( 'mep-event-price', 'Event Price', 'mep_event_price_meta_box_cb', 'mep_events', 'normal', 'high' ); + add_meta_box( 'mep-event-price', 'Event Price (Event Base price, It will not work if you add Event Ticket type Price)', 'mep_event_price_meta_box_cb', 'mep_events', 'normal', 'high' ); add_meta_box( 'mep-event-extra-price', 'Event Extra Option Price', 'mep_event_extra_price_option', 'mep_events', 'normal', 'high' ); + add_meta_box( 'mep-event-ticket-type', 'Event Ticket Type', 'mep_event_ticket_type', 'mep_events', 'normal', 'high' ); + add_meta_box( 'mep-event-date', 'Event Date & Time', 'mep_event_date_meta_box_cb', 'mep_events', 'normal', 'high' ); + + add_meta_box( 'mep-event-emails', 'Event Email text', 'mep_event_email_meta_box_cb', 'mep_events', 'normal', 'high' ); + + add_meta_box( 'mep-event-template', 'Template', 'mep_event_template_meta_box_cb', 'mep_events', 'side', 'low' ); + + add_meta_box( 'mep-event-reg-form', 'Event Registration Form', 'mep_event_reg_form_meta_box_cb', 'mep_events', 'normal', 'high' ); } @@ -19,10 +27,7 @@ $values = get_post_custom( $post->ID ); $user_api = mep_get_option( 'google-map-api', 'general_setting_sec', ''); ?> -
- - '> -
+
@@ -197,22 +202,35 @@ function mep_event_price_meta_box_cb($post){ $values = get_post_custom( $post->ID ); ?> -
- - > Yes -
+ + + + + + + + + + + + + + + + + + + + +
Price LabelPriceQuantityInput TypeShow Quantity Box
'>'>'> + > Yes
-
- - '> -
-
- - '> -
@@ -222,6 +240,20 @@ $values = get_post_custom( $post->ID ); + + + + + + + + + + + + + + function mep_event_extra_price_option() { global $post; $mep_events_extra_prices = get_post_meta($post->ID, 'mep_events_extra_prices', true); @@ -246,9 +278,11 @@ function mep_event_extra_price_option() { - - - + + + + + @@ -257,10 +291,21 @@ function mep_event_extra_price_option() { if ( $mep_events_extra_prices ) : foreach ( $mep_events_extra_prices as $field ) { + $qty_type = esc_attr( $field['option_qty_type'] ); ?> + + + + + + + + +
Extra Option NameAmountExtra Option NameAmountQuantityInput Type
+ + Remove
Remove
@@ -284,6 +337,103 @@ function mep_event_extra_price_option() { + + + + + + + + + + + +function mep_event_ticket_type() { + global $post; + $mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true); + wp_nonce_field( 'mep_event_ticket_type_nonce', 'mep_event_ticket_type_nonce' ); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Extra Option NameAmountQuantityInputType
Remove
Remove
+

Add New Ticket Type

+ ID ); ?> @@ -304,8 +454,198 @@ $values = get_post_custom( $post->ID ); } + +function mep_event_email_meta_box_cb($post){ +$values = get_post_custom( $post->ID ); +?> +
+ + +
+ID ); +?> + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ + + +
+ + + +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +ID ); +$global_template = mep_get_option( 'mep_global_single_template', 'general_setting_sec', 'theme-2'); +$current_template = $values['mep_event_template'][0]; +if($current_template){ + $_current_template = $current_template; +}else{ + $_current_template = $global_template; +} +?> +
+ +
+prefix . 'mep_event_ticket_type'; + + if ( ! isset( $_POST['mep_event_ticket_type_nonce'] ) || + ! wp_verify_nonce( $_POST['mep_event_ticket_type_nonce'], 'mep_event_ticket_type_nonce' ) ) + return; + + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) + return; + + if (!current_user_can('edit_post', $post_id)) + return; + + $old = get_post_meta($post_id, 'mep_event_ticket_type', true); + $new = array(); + // $options = hhs_get_sample_options(); + + $names = $_POST['option_name_t']; + // $selects = $_POST['select']; + $urls = $_POST['option_price_t']; + $qty = $_POST['option_qty_t']; + $qty_type = $_POST['option_qty_t_type']; + // $required = $_POST['option_required_t']; + // $total_sold = $_POST['option_sold']; + + $order_id = 0; + $count = count( $names ); + + for ( $i = 0; $i < $count; $i++ ) { + + if ( $names[$i] != '' ) : + $new[$i]['option_name_t'] = stripslashes( strip_tags( $names[$i] ) ); + endif; + + if ( $urls[$i] != '' ) : + $new[$i]['option_price_t'] = stripslashes( strip_tags( $urls[$i] ) ); + endif; + + if ( $qty[$i] != '' ) : + $new[$i]['option_qty_t'] = stripslashes( strip_tags( $qty[$i] ) ); + endif; + + if ( $qty_type[$i] != '' ) : + $new[$i]['option_qty_t_type'] = stripslashes( strip_tags( $qty_type[$i] ) ); + endif; + + // if ( $required[$i] != '' ) : + // $new[$i]['option_required_t'] = stripslashes( strip_tags( $required[$i] ) ); + // endif; + + + + $opt_name = $post_id.str_replace(' ', '', $names[$i]); + + // update_post_meta( $post_id, "mep_xtra_$opt_name",0 ); + + } + + if ( !empty( $new ) && $new != $old ) + update_post_meta( $post_id, 'mep_event_ticket_type', $new ); + elseif ( empty($new) && $old ) + delete_post_meta( $post_id, 'mep_event_ticket_type', $old ); +} + + + + + + + + + + + add_action('save_post', 'mep_events_repeatable_meta_box_save'); function mep_events_repeatable_meta_box_save($post_id) { + global $wpdb; + $table_name = $wpdb->prefix . 'event_extra_options'; if ( ! isset( $_POST['mep_events_extra_price_nonce'] ) || ! wp_verify_nonce( $_POST['mep_events_extra_price_nonce'], 'mep_events_extra_price_nonce' ) ) return; @@ -323,7 +663,12 @@ function mep_events_repeatable_meta_box_save($post_id) { $names = $_POST['option_name']; // $selects = $_POST['select']; $urls = $_POST['option_price']; - + $qty = $_POST['option_qty']; + $qty_type = $_POST['option_qty_type']; + // $required = $_POST['option_required']; + // $total_sold = $_POST['option_sold']; + + $order_id = 0; $count = count( $names ); for ( $i = 0; $i < $count; $i++ ) { @@ -335,13 +680,42 @@ function mep_events_repeatable_meta_box_save($post_id) { if ( $urls[$i] != '' ) : $new[$i]['option_price'] = stripslashes( strip_tags( $urls[$i] ) ); endif; + + if ( $qty[$i] != '' ) : + $new[$i]['option_qty'] = stripslashes( strip_tags( $qty[$i] ) ); + endif; + + if ( $qty_type[$i] != '' ) : + $new[$i]['option_qty_type'] = stripslashes( strip_tags( $qty_type[$i] ) ); + endif; + + // if ( $required[$i] != '' ) : + // $new[$i]['option_required'] = stripslashes( strip_tags( $required[$i] ) ); + // endif; + + + + $opt_name = $post_id.str_replace(' ', '', $names[$i]); + + // update_post_meta( $post_id, "mep_xtra_$opt_name",0 ); + } + if ( !empty( $new ) && $new != $old ) update_post_meta( $post_id, 'mep_events_extra_prices', $new ); elseif ( empty($new) && $old ) delete_post_meta( $post_id, 'mep_events_extra_prices', $old ); } + + + + + + + + + add_action('save_post','mep_events_meta_save'); function mep_events_meta_save($post_id){ global $post; @@ -350,28 +724,79 @@ function mep_events_meta_save($post_id){ return; } //if you get here then it's your post type so do your thing.... - $seat = strip_tags($_POST['mep_total_seat']); - $mep_location_venue = strip_tags($_POST['mep_location_venue']); - $mep_street = strip_tags($_POST['mep_street']); - $mep_city = strip_tags($_POST['mep_city']); - $mep_state = strip_tags($_POST['mep_state']); - $mep_postcode = strip_tags($_POST['mep_postcode']); - $mep_country = strip_tags($_POST['mep_country']); - $mep_price_label = strip_tags($_POST['mep_price_label']); - $mep_sqi = strip_tags($_POST['mep_sqi']); - $mep_sgm = strip_tags($_POST['mep_sgm']); - $_price = strip_tags($_POST['_price']); - $mep_event_start_date = strip_tags($_POST['mep_event_start_date']); - $mep_event_end_date = strip_tags($_POST['mep_event_end_date']); + $seat = strip_tags($_POST['mep_total_seat']); + $mep_location_venue = strip_tags($_POST['mep_location_venue']); + $mep_street = strip_tags($_POST['mep_street']); + $mep_city = strip_tags($_POST['mep_city']); + $mep_state = strip_tags($_POST['mep_state']); + $mep_postcode = strip_tags($_POST['mep_postcode']); + $mep_country = strip_tags($_POST['mep_country']); + $mep_price_label = strip_tags($_POST['mep_price_label']); + $mep_sqi = strip_tags($_POST['mep_sqi']); + $qty_box_type = strip_tags($_POST['qty_box_type']); + $mep_sgm = strip_tags($_POST['mep_sgm']); + $_price = strip_tags($_POST['_price']); + $mep_event_start_date = strip_tags($_POST['mep_event_start_date']); + $mep_event_end_date = strip_tags($_POST['mep_event_end_date']); + $mep_event_cc_email_text = strip_tags($_POST['mep_event_cc_email_text']); + + $latitude = strip_tags($_POST['latitude']); + $longitude = strip_tags($_POST['longitude']); + $location_name = strip_tags($_POST['location_name']); + + $mep_full_name = strip_tags($_POST['mep_full_name']); + $mep_reg_email = strip_tags($_POST['mep_reg_email']); + $mep_reg_phone = strip_tags($_POST['mep_reg_phone']); + $mep_reg_address = strip_tags($_POST['mep_reg_address']); + $mep_reg_designation = strip_tags($_POST['mep_reg_designation']); + $mep_reg_website = strip_tags($_POST['mep_reg_website']); + $mep_reg_veg = strip_tags($_POST['mep_reg_veg']); + $mep_reg_company = strip_tags($_POST['mep_reg_company']); + $mep_reg_gender = strip_tags($_POST['mep_reg_gender']); + $mep_reg_tshirtsize = strip_tags($_POST['mep_reg_tshirtsize']); + $mep_reg_tshirtsize_list = strip_tags($_POST['mep_reg_tshirtsize_list']); + $mep_event_template = strip_tags($_POST['mep_event_template']); + + +$update_reg_name = update_post_meta( $pid, 'mep_full_name', $mep_full_name); +$update_reg_email = update_post_meta( $pid, 'mep_reg_email', $mep_reg_email); +$update_reg_phone = update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone); +$update_reg_address = update_post_meta( $pid, 'mep_reg_address', $mep_reg_address); +$update_reg_desg = update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation); +$update_reg_web = update_post_meta( $pid, 'mep_reg_website', $mep_reg_website); +$update_reg_veg = update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg); +$update_reg_comapny = update_post_meta( $pid, 'mep_reg_company', $mep_reg_company); +$update_reg_gender = update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender); +$update_tshirtsize = update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize); +$mep_reg_tshirtsize_list = update_post_meta( $pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list); +$update_template = update_post_meta( $pid, 'mep_event_template', $mep_event_template); + + + + + +$mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true); + + +if($mep_event_ticket_type){ + $st_msg = 'no'; + $seat = ""; + $_price =0; +}else{ + $st_msg = 'yes'; + $_price = $_price; + $seat = $seat; + +} + - $latitude = strip_tags($_POST['latitude']); - $longitude = strip_tags($_POST['longitude']); - $location_name = strip_tags($_POST['location_name']); $update_seat = update_post_meta( $pid, 'mep_total_seat', $seat); - $update_seat_stock_status = update_post_meta( $pid, '_manage_stock', 'yes'); - $update_seat_stock = update_post_meta( $pid, '_stock', $seat); + + $update_seat_stock_status = update_post_meta( $pid, '_manage_stock', $st_msg); + + $update_seat_stock = update_post_meta( $pid, '_stock', $seat); $sts_msg = update_post_meta( $pid, '_stock_msg', 'new'); // $ttl_booking = update_post_meta( $pid, 'total_booking', '0'); @@ -381,19 +806,21 @@ $sts_msg = update_post_meta( $pid, '_stock_msg', 'new'); - $update_location = update_post_meta( $pid, 'mep_location_venue', $mep_location_venue); + $update_location = update_post_meta( $pid, 'mep_location_venue', $mep_location_venue); $update_mep_street = update_post_meta( $pid, 'mep_street', $mep_street); - $update_city = update_post_meta( $pid, 'mep_city', $mep_city); + $update_city = update_post_meta( $pid, 'mep_city', $mep_city); $update_mep_state = update_post_meta( $pid, 'mep_state', $mep_state); - $update_postcode = update_post_meta( $pid, 'mep_postcode', $mep_postcode); - $update_conuntry = update_post_meta( $pid, 'mep_country', $mep_country); + $update_postcode = update_post_meta( $pid, 'mep_postcode', $mep_postcode); + $update_conuntry = update_post_meta( $pid, 'mep_country', $mep_country); $update_sqi = update_post_meta( $pid, 'mep_sqi', $mep_sqi); + $qty_box_type = update_post_meta( $pid, 'qty_box_type', $qty_box_type); $update_mep_sgm = update_post_meta( $pid, 'mep_sgm', $mep_sgm); $update_price_label = update_post_meta( $pid, 'mep_price_label', $mep_price_label); - $update_price = update_post_meta( $pid, '_price', $_price); - $update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date); - $update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date); + $update_price = update_post_meta( $pid, '_price', $_price); + $update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date); + $update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date); + $mep_event_cc_email_text = update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text); } @@ -410,13 +837,15 @@ $values = get_post_custom( $post->ID );
+ +
+ + +
+
- -
-
- - +
@@ -429,35 +858,62 @@ $values = get_post_custom( $post->ID );
+ +
- - - +
+
- + - +
+
- + - +
+ +
- + - +
+ +
+ + + + +
+ + +
+ + + + +
+ + + + + + + +
@@ -470,4 +926,4 @@ $values = get_post_custom( $post->ID );
ID; -$count=1; -$mep_events_extra_prices = get_post_meta($post->ID, 'mep_events_extra_prices', true); - if ( $mep_events_extra_prices ){ -foreach ($mep_events_extra_prices as $field) { -?> - -"; - foreach ($cart_item as $_cart_item){ - if(!empty($cart_item["AddtP_".$count])){ - echo "
  • ".mep_get_item_name($cart_item["AddtP_".$count])." - ".get_woocommerce_currency_symbol().mep_get_item_price($cart_item["AddtP_".$count])."
  • "; - } - $count++; - } + foreach ( $mep_events_extra_prices as $field ) { + if($field['option_qty']>0){ + ?> +
  • x :
  • + + Ticket: ".$cart_item['event_ticket_type']." x ".$cart_item['event_ticket_qty'].": ".get_woocommerce_currency_symbol().$cart_item['event_ticket_price'].""; +} echo ""; return $item_data; } +} add_filter( 'woocommerce_get_item_data', 'mep_display_custom_fields_text_cart', 10, 2 ); + + function mep_add_custom_fields_text_to_order_items( $item, $cart_item_key, $values, $order ) { -$count =1; +$mep_events_extra_prices = $values['event_extra_option']; +$event_user_info = $values['event_user_info']; +$event_ticket_type = $values['event_ticket_type']; +$event_ticket_price = $values['event_ticket_price']; +$event_ticket_qty = $values['event_ticket_qty']; +$product_id = $values['product_id']; - foreach ($values as $_values){ - $item->add_meta_data( __( mep_get_item_name($values["AddtP_".$count]), 'atn' ), get_woocommerce_currency_symbol().mep_get_item_price($values["AddtP_".$count]) ); - $count++; - } +foreach ( $mep_events_extra_prices as $field ) { + if($field['option_qty']>0){ + + $item->add_meta_data( __( esc_attr( $field['option_name'] )." x ".$field['option_qty'], 'atn' ), get_woocommerce_currency_symbol().($field['option_qty'] *$field['option_price'] ) ); + + + $opt_name = $product_id.str_replace(' ', '', $field['option_name']); + $opt_qty = $field['option_qty']; + +// $tes = 0; +$tes = get_post_meta($product_id,"mep_xtra_$opt_name",true); +$ntes = ($tes+$opt_qty); +update_post_meta( $product_id, "mep_xtra_$opt_name",$ntes); + + } + +} + + +if($event_ticket_type){ + +$event_ticket_type = "Ticket:".$event_ticket_type; + +$item->add_meta_data( __($event_ticket_type." x ".$event_ticket_qty),get_woocommerce_currency_symbol().$event_ticket_price); + + +$tck_name = $product_id.str_replace(' ', '', $event_ticket_type); + +$tesqt = get_post_meta($product_id,"mep_xtra_$tck_name",true); +$ntesqt = ($tesqt+$event_ticket_qty); +update_post_meta( $product_id, "mep_xtra_$tck_name",$ntesqt); + } -add_action( 'woocommerce_checkout_create_order_line_item', 'mep_add_custom_fields_text_to_order_items', 10, 4 ); \ No newline at end of file + + +$item->add_meta_data( __('_event_user_info'),$event_user_info); + + + +} +add_action( 'woocommerce_checkout_create_order_line_item', 'mep_add_custom_fields_text_to_order_items', 10, 4 ); + +function add_message_in_checkout() { + global $values,$cart_item_data; + print_r($$cart_item_data); + //var_dump(do_shortcode('[my_shortcode]')); + /*Modification*/ + echo '
    Hello World
    '; // Here I have modified it to give class and update value +} + +add_action('woocommerce_review_order_before_payment', 'add_message_in_checkout'); \ No newline at end of file diff --git a/inc/mep_shortcode.php b/inc/mep_shortcode.php index cd6d490..fa9b9ba 100644 --- a/inc/mep_shortcode.php +++ b/inc/mep_shortcode.php @@ -1,21 +1,134 @@ + + +
    + + + "0", + "org" => "0", + "style" => "grid", + "cat-filter" => "no", + "org-filter" => "no", + "show" => "-1", + "pagination" => "no", ); $params = shortcode_atts($defaults, $atts); $cat = $params['cat']; + $org = $params['org']; + $style = $params['style']; + $cat_f = $params['cat-filter']; + $org_f = $params['org-filter']; + $show = $params['show']; + $pagination = $params['pagination']; ob_start(); ?>
    + + + + +
    + 'mep_cat' +) ); +?> +
    + +
    +
    + + +
    + 'mep_org' +) ); +?> +
    + +
    +
    + + +
    + + + 0){ $args_search_qqq = array ( 'post_type' => array( 'mep_events' ), - 'posts_per_page' => -1, + 'paged' => $paged, + 'posts_per_page' => $show, 'tax_query' => array( array( 'taxonomy' => 'mep_cat', @@ -25,10 +138,27 @@ if($cat>0){ ) ); - }else{ + } +elseif($org>0){ $args_search_qqq = array ( 'post_type' => array( 'mep_events' ), - 'posts_per_page' => -1 + 'posts_per_page' => $show, + 'paged' => $paged, + 'tax_query' => array( + array( + 'taxonomy' => 'mep_org', + 'field' => 'term_id', + 'terms' => $org + ) + ) + + ); +} + else{ + $args_search_qqq = array ( + 'post_type' => array( 'mep_events' ), + 'paged' => $paged, + 'posts_per_page' => $show ); } @@ -37,29 +167,90 @@ if($cat>0){ while ($loop->have_posts()) { $loop->the_post(); $event_meta = get_post_custom(get_the_id()); - +$author_terms = get_the_terms(get_the_id(), 'mep_org'); $time = strtotime($event_meta['mep_event_start_date'][0]); $newformat = date('Y-m-d H:i:s',$time); if(time() < strtotime($newformat)){ - ?> - +
    Loading Data...
    "); - jQuery( ".mkb-rr" ).remove(); - jQuery.ajax({ - type: 'POST', - url:mkbAjax.ajaxurl, - data: {"action": "mkb_dropdown_ajax", "trcat":trcat,"bc":bc,"bimg":bimg}, - success:function(data) { - jQuery( ".alert-successes" ).remove(); - jQuery( "#showmsg" ).append("
    "+data+"
    "); - } - }); - -}); - - -// Ajax Call for mkb Dropdown (Theme 2) -jQuery(".leftm").click(function(e) { - e.preventDefault(); - var trcat = jQuery(this).attr("data-id"); - var bimglb = jQuery("#bimglb").val(); - var bclb = jQuery("#bclb").val(); - jQuery( "#showmsglb" ).prepend("
    Loading Data...
    "); - jQuery( ".mkb-llb" ).remove(); - jQuery.ajax({ - type: 'POST', - url:mkbAjax.ajaxurl, - data: {"action": "mkb_lfb_ajax", "trcat":trcat,"bclb":bclb,"bimglb":bimglb}, - success:function(data) { - jQuery( ".alert-successes" ).remove(); - jQuery( "#showmsglb" ).append("
    "+data+"
    "); - } - }); - -}); - - - - - + var containerEl = document.querySelector('.mep_event_list_sec'); + var mixer = mixitup(containerEl); }); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 50a6d93..cfedae8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -=== Mage WooCommerce Event Booking Manager === +=== Woocommerce Events Manager === Contributors: MagePeople Team Tags: event, event with woocommerce, woocommerce event, wordpress event plugin, event management wordpress, event booking for woocommerce, best wordpress event plugin, event booking manager wordpress, wordpress event Requires at least: 3.7 @@ -6,60 +6,96 @@ Tested up to: 4.9 Stable tag: 1.0 License: GPLv2 or later -Mage Woo Event Booking Manager is a Event Plugin for WordPress which is based on WooCommerce. +Woocommerce Events Manager is a Event Plugin for WordPress which is based on WooCommerce. == Description == - This is one of the best and simple event management plugin is WordPress directory, Its used Woocommerce for making payment so Its freedom to use any payment gateway via WooCommerce. This plugin will run with Woocommerce but it will work as event post it will not take any effect on woocommerce products so if you want you can sale your product along with it. -Features: +**Features:** -* Shortcode Powred -* Unlimited Category -* Unlimited Organization -* Unlimited Event -* Unlimited Extra option with price -* Google Map -* Add to your Calender -* Open Source -* Responsive Design -* Developer Friendly -* Based on Woo-commerce -* Works with any standards compliant WordPress theme -* Plays well with other Plugins -* 100% Customizable -* Easy to modify templates -* Use Shortcode [event-list] for showing all faq question. if you want to show a event list of any particular category use [event-list cat=ID]. -* [Live Demo](https://demo.vaincode.com/mage-event/) +- Shortcode Powred +- Unlimited Category +- Unlimited Organization +- Unlimited Event +- Unlimited Extra option with price +- Google Map +- Add to your Calender +- Open Source +- Responsive Design +- Developer Friendly +- Based on Woo-commerce +- Works with any standards compliant WordPress theme +- Plays well with other Plugins +- 100% Customizable +- Easy to modify templates +- Template Override feature. +- CSV Export Attendee List +- Ticket Print +- [Live Demo](https://demo.vaincode.com/mage-event/) +- [Documentation](https://demo.vaincode.com/mage-event/documentation/) + +[Live Demo](https://demo.vaincode.com/mage-event/) + +All major functions are availabl below: + +- Event Tickets with Quantity Management +- Event Extra Service with Quantity Management +- Event Venue with Google Map +- Event Category +- Event Organizer +- Event Pricing +- Event Calendar. +- ShortCode Powered +- Custom email for every event +- Event Start & End Datetime +- Custom Registration Form for Event Attendee with every event +- Event Feature Image +- Event Template ( You can select a different template for each event) +- Event Attendee List +- Event Attendee Ticket with BarCode +- Export Attendee List as csv format +- WooCommerce Support, You can Sale product and Event individually. There is no connection with Event with the WooCommerce Products. +### Shortcodes included with Woocommerce Events Manager -[**Mage Woo Event Booking Manager PRO:**](https://mage-people.com/product/mage-woo-event-booking-manager-pro/) +##### **[event-list cat='' org='' style='grid' cat-filter='no' org-filter='no' show='' pagination='no']** -You can get the Pro version of this plugin from here: [Get Pro Version](https://mage-people.com/product/mage-woo-event-booking-manager-pro/) +**cat:** +By default showing all event, but if you want to show event list of a particular category you can use this attribute, just put the category id with this. example: _**[event-list cat='ID']**_ -[Live Demo](https://demo.vaincode.com/mage-event/) +**org:** +By default showing all event, but if you want to show event list of a particular organization you can use this attribute, just put the category id with this. example: _**[event-list org='ID']**_ -All major functions are available in PRO version are below: +**style:** +By default showing all event as grid. If you want to change the display style to list just change it to list. example: _**[event-list style='list']**_ -* Event Tickets with Quantity Management -* Event Extra Service with Quantity Management -* Event Venue with Google Map -* Event Category -* Event Organizer -* Event Pricing -* Event Calendar. -* ShortCode Powered -* Custom email for every event -* Event Start & End Datetime -* Custom Registration Form for Event Attendee with every event -* Event Feature Image -* Event Template ( You can select a different template for each event) -* Event Attendee List -* Event Attendee Ticket with BarCode -* Export Attendee List as csv format -* WooCommerce Support, You can Sale product and Event individually. There is no connection with Event with the WooCommerce Products. +**cat-filter:** +By default showing all event without any filter option. If you want to change it to with category filter use this. example: _**[event-list cat-filter='yes']**_ + +**org-filter:** +By default showing all event without any filter option. If you want to change it to with organization filter use this. example: _**[event-list org-filter='yes']**_ + +**show:** +By default showing all event without any limition. If you want to change it and set limit input the limit number. example: _**[event-list show='10']**_ + +**pagination:** +By default there is no pagination with the event list but if you want to show pagination set yes the value. example: _**[event-list pagination='yes']**_ + +### Event Calender ShortCode: +[event-calendar] + + + +### How to Add New Event +https://www.youtube.com/watch?v=2VLWSUS6GPI + +### How to Add Ticket Base Event +https://www.youtube.com/watch?v=2VLWSUS6GPI + +### How to Buy/Purchase/Booking an Event +https://www.youtube.com/watch?v=IyUCCIeS6P8 @@ -73,13 +109,17 @@ Upload the Mage FAQ plugin to your blog, Activate it, then use shortcode as your == Frequently Asked Questions == -= Is Mage Woo Event Booking Manager Free? = -Yes! Mage Woo Event Booking Manager is free. += Is Woocommerce Events Manager Free? = +Yes! Woocommerce Events Manager is free. -You can check the demo of this plugin from here http://demo.wp-people.net/mage-woo-event-booking-manager-free/ +You can check the demo of this plugin from here [Live Demo](https://demo.vaincode.com/mage-event/) + += Any Documentation? = +Yes! Here is the [Online Documentation](https://demo.vaincode.com/mage-event/documentation/). + = How its work? = -Mage Woo Event Booking Manager one of the simple event plugin for WordPress which is based on Woocommerce. Its work as an individual event and its payment functionality handle with woocommerce so there are no worries about payment gateway you can use every payment gateway which is support woocommerce. The interesting part is the event post type is completely different there is no connection with woocommerce product so if you can sell anything from woocommerce product. +Woocommerce Events Manager one of the simple event plugin for WordPress which is based on Woocommerce. Its work as an individual event and its payment functionality handle with woocommerce so there are no worries about payment gateway you can use every payment gateway which is support woocommerce. The interesting part is the event post type is completely different there is no connection with woocommerce product so if you can sell anything from woocommerce product. = How can i get the attendee list? = After successfull booking user data will be saved under event attendee list, You can find the list from Events -> attendee list or Go to event list and click on the attendee list on right side of event to get that particular event attendee list. @@ -100,4 +140,7 @@ You can display the event list on any page by using the ShortCode. Just use this *Update Release, Google Map and Add to calender feture added and some bug fixed - 22 February 2018* = 1.0.6 = -*Update Release, Event Extra option feature added. So now you can add as many option with a event with price - 27 February 2018* \ No newline at end of file +*Update Release, Event Extra option feature added. So now you can add as many option with a event with price - 27 February 2018* + += 2.0 = +*Update Release, A Huge update released, added so many features. - 02 July 2018* \ No newline at end of file diff --git a/templates/single-events.php b/templates/single-events.php index a43332d..69597c9 100644 --- a/templates/single-events.php +++ b/templates/single-events.php @@ -8,126 +8,171 @@ $author_terms = get_the_terms(get_the_id(), 'mep_org'); $book_count = get_post_meta(get_the_id(),'total_booking', true); $user_api = mep_get_option( 'google-map-api', 'general_setting_sec', ''); if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } -?> -
    -
    -
    -
    -
    - -
    -
    -
    -
    -

    -

    name; ?>

    + $mep_full_name = strip_tags($event_meta['mep_full_name'][0]); + $mep_reg_email = strip_tags($event_meta['mep_reg_email'][0]); + $mep_reg_phone = strip_tags($event_meta['mep_reg_phone'][0]); + $mep_reg_address = strip_tags($event_meta['mep_reg_address'][0]); + $mep_reg_designation = strip_tags($event_meta['mep_reg_designation'][0]); + $mep_reg_website = strip_tags($event_meta['mep_reg_website'][0]); + $mep_reg_veg = strip_tags($event_meta['mep_reg_veg'][0]); + $mep_reg_company = strip_tags($event_meta['mep_reg_company'][0]); + $mep_reg_gender = strip_tags($event_meta['mep_reg_gender'][0]); + $mep_reg_tshirtsize = strip_tags($event_meta['mep_reg_tshirtsize'][0]); - 0){ - if($event_meta['mep_price_label'][0]){ - ?> -

    :

    - - Free','mep'); }?> - -
    ( Left)
    - -
    - -
    -
    -
    -
    - -
    -
    -
    - - - -
    -
    -
    - -
    -
    -
    -
    -

    -

    -

    -
    -
    -
    -
    -
    -
    -

    - -
    -
    -
    -
    - 0){ - ?> -
    - -
    - -
    -
    -

    -


    -
    -
    - , -
    -

    -
    -
    -
    -
    + $global_template = mep_get_option( 'mep_global_single_template', 'general_setting_sec', 'theme-2'); +$current_template = $event_meta['mep_event_template'][0]; +if($current_template){ + $_current_template = $current_template; +}else{ + $_current_template = $global_template; +} + +?> + + + +
    +
    \ No newline at end of file diff --git a/woocommerce-event-press.php b/woocommerce-event-press.php index fc3ee98..f3d3bef 100644 --- a/woocommerce-event-press.php +++ b/woocommerce-event-press.php @@ -1,18 +1,15 @@ - - "; + + if($email_body){ + $sent = wp_mail( $sent_email, $email_sub, $email_body, $headers ); + } +} + + + + // Get user information and save to attendee list after order confirmation add_action( 'woocommerce_order_status_completed_notification', 'mep_set_event_attendee_data' ); @@ -181,18 +174,24 @@ function mep_set_event_attendee_data( $order_id ) { $order = wc_get_order( $order_id ); $order_meta = get_post_meta($order_id); + $order_meta_text = "_stock_msg_".$order_id; + $order_processing = "processing_".$order_id; + $order_completed = "completed_".$order_id; + $order_cancelled = "cancelled_".$order_id; # Iterating through each order items (WC_Order_Item_Product objects in WC 3+) foreach ( $order->get_items() as $item_id => $item_values ) { - $product_id = $item_values->get_product_id(); - $item_data = $item_values->get_data(); - $product_id = $item_data['product_id']; - $item_quantity = $item_values->get_quantity(); - $product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' ); - $event_name = $item_data['name']; - $event_id = $product->ID; + $product_id = $item_values->get_product_id(); + $item_data = $item_values->get_data(); + $product_id = $item_data['product_id']; + $item_quantity = $item_values->get_quantity(); + $product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' ); + $event_name = $item_data['name']; + $event_id = $product->ID; + $item_id = $item_id; } +$user_info_arr = wc_get_order_item_meta($item_id,'_event_user_info',true); $first_name = $order_meta['_billing_first_name'][0]; @@ -208,53 +207,66 @@ function mep_set_event_attendee_data( $order_id ) { $phone = $order_meta['_billing_phone'][0]; $billing_intotal = $order_meta['_billing_address_index'][0]; $payment_method = $order_meta['_payment_method_title'][0]; + $user_id = $order_meta['_customer_user'][0]; +$mep_atnd = "_mep_atnd_".$order_id; + $mep_stock_msgc = get_post_meta($event_id,$mep_atnd, true); + mep_event_confirmation_email_sent($event_id,$email); - // ADD THE FORM INPUT TO $new_post ARRAY - $new_post = array( - 'post_title' => $first_name." ".$last_name, - 'post_content' => '', - 'post_category' => array(), // Usable for custom taxonomies too - 'tags_input' => array(), - 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. - 'post_type' => 'mep_events_attendees' //'post',page' or use a custom post type if you want to - ); - - //SAVE THE POST - $pid = wp_insert_post($new_post); - $update_fname = update_post_meta( $pid, 'ea_first_name', $first_name); - $update_lname = update_post_meta( $pid, 'ea_last_name', $last_name); - $update_company = update_post_meta( $pid, 'ea_company_name', $company_name); - $update_ad1 = update_post_meta( $pid, 'ea_address_1', $address_1); - $update_ad2 = update_post_meta( $pid, 'ea_address_2', $address_2); - $update_city = update_post_meta( $pid, 'ea_city', $city); - $update_state = update_post_meta( $pid, 'ea_state', $state); - $update_postcode = update_post_meta( $pid, 'ea_postcode', $postcode); - $update_country = update_post_meta( $pid, 'ea_country', $country); - $update_email = update_post_meta( $pid, 'ea_email', $email); - $update_phone = update_post_meta( $pid, 'ea_phone', $phone); - $update_pym = update_post_meta( $pid, 'ea_payment_method', $payment_method); - $update_event_name = update_post_meta( $pid, 'ea_event_name', $event_name); - $update_eid = update_post_meta( $pid, 'ea_event_id', $event_id); - $update_oid = update_post_meta( $pid, 'ea_order_id', $order_id); +if($mep_stock_msgc!='a2'){ + + foreach ($user_info_arr as $_user_info) { + $uname = $_user_info['user_name']; + $email = $_user_info['user_email']; + $phone = $_user_info['user_phone']; + $address = $_user_info['user_address']; + $gender = $_user_info['user_gender']; + $company = $_user_info['user_company']; + $designation = $_user_info['user_designation']; + $website = $_user_info['user_website']; + $vegetarian = $_user_info['user_vegetarian']; + $tshirtsize = $_user_info['user_tshirtsize']; + $ticket_type = $_user_info['user_ticket_type']; + + // ADD THE FORM INPUT TO $new_post ARRAY + $new_post = array( + 'post_title' => $uname, + 'post_content' => '', + 'post_category' => array(), // Usable for custom taxonomies too + 'tags_input' => array(), + 'post_status' => 'publish', // Choose: publish, preview, future, draft, etc. + 'post_type' => 'mep_events_attendees' //'post',page' or use a custom post type if you want to + ); + + //SAVE THE POST + $pid = wp_insert_post($new_post); + $update_fname = update_post_meta( $pid, 'ea_name', $uname); + $update_uid = update_post_meta( $pid, 'ea_user_id', $user_id); + $update_ad1 = update_post_meta( $pid, 'ea_address_1', $address); + $update_email = update_post_meta( $pid, 'ea_email', $email); + $update_phone = update_post_meta( $pid, 'ea_phone', $phone); + $update_gender = update_post_meta( $pid, 'ea_gender', $gender); + $update_company = update_post_meta( $pid, 'ea_company', $company); + $update_desg = update_post_meta( $pid, 'ea_desg', $designation); + $update_web = update_post_meta( $pid, 'ea_website', $website); + $update_veg = update_post_meta( $pid, 'ea_vegetarian', $vegetarian); + $update_teesize = update_post_meta( $pid, 'ea_tshirtsize', $tshirtsize); + $update_ticket_type = update_post_meta( $pid, 'ea_ticket_type', $ticket_type); + $update_pym = update_post_meta( $pid, 'ea_payment_method', $payment_method); + $update_event_name = update_post_meta( $pid, 'ea_event_name', $event_name); + $update_eid = update_post_meta( $pid, 'ea_event_id', $event_id); + $update_oid = update_post_meta( $pid, 'ea_order_id', $order_id); + } +} } } - -function mep_get_order_info($info,$id){ - $stock_msg = $info; - $koba = explode("_", $stock_msg); - return $koba[$id]; -} - - -add_action('woocommerce_order_status_changed', 'mep_event_seat_management', 10, 4); -function mep_event_seat_management( $order_id, $from_status, $to_status, $order ) { - +add_action( 'woocommerce_thankyou','mep_set_first_order_sts'); +function mep_set_first_order_sts($order_id ){ // Getting an instance of the order object $order = wc_get_order( $order_id ); @@ -270,8 +282,52 @@ function mep_event_seat_management( $order_id, $from_status, $to_status, $order $product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' ); $event_name = $item_data['name']; $event_id = $product->ID; + $item_id = $item_id; + // $item_data = $item_values->get_data(); } + +$mep_atnd = "_mep_atnd_".$order_id; +update_post_meta( $event_id, $mep_atnd, "a1"); +} + + + + + + + + + +add_action('woocommerce_order_status_changed', 'mep_event_seat_management', 10, 4); +function mep_event_seat_management( $order_id, $from_status, $to_status, $order ) { +global $wpdb; + + + // Getting an instance of the order object + $order = wc_get_order( $order_id ); + $order_meta = get_post_meta($order_id); + + +$c = 1; + + # Iterating through each order items (WC_Order_Item_Product objects in WC 3+) + foreach ( $order->get_items() as $item_id => $item_values ) { + $product_id = $item_values->get_product_id(); + $item_data = $item_values->get_data(); + $product_id = $item_data['product_id']; + $item_quantity = $item_values->get_quantity(); + $product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' ); + $event_name = $item_data['name']; + $event_id = $product->ID; + $item_id = $item_id; + // $item_data = $item_values->get_data(); + } + +$table_name = $wpdb->prefix . 'woocommerce_order_itemmeta'; +$result = $wpdb->get_results( "SELECT * FROM $table_name WHERE order_item_id=$item_id" ); + + $mep_total = get_post_meta($event_id,'total_booking', true); if($mep_total){ $mep_total_booking = $mep_total; @@ -281,48 +337,101 @@ function mep_event_seat_management( $order_id, $from_status, $to_status, $order - $order_meta_text = "_stock_msg_".$order_id; + $order_meta_text = "_stock_msg_".$order_id; $order_processing = "processing_".$order_id; - $order_completed = "completed_".$order_id; - $order_cancelled = "cancelled_".$order_id; + $order_completed = "completed_".$order_id; + $order_cancelled = "cancelled_".$order_id; + $mep_atnd = "_mep_atnd_".$order_id; - if( $order->has_status( 'processing' )) { - - update_post_meta( $event_id, $order_meta_text, $order_processing); - - $mep_stock_msg = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); - $mep_stock_order = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); - if($mep_stock_order==$order_id){ + +if($order->has_status( 'processing' ) || $order->has_status( 'pending' )) { +// update_post_meta( $event_id, $mep_atnd, "a2"); + +$mep_stock_msgc = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); +$mep_stock_orderc = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); + +if($mep_stock_orderc==$order_id){ + if($mep_stock_msgc=='cancelled'){ + + foreach ( $result as $page ){ + if (strpos($page->meta_key, '_') !== 0) { + + $order_option_name = $event_id.str_replace(' ', '', mep_get_string_part($page->meta_key,0)); + + $order_option_qty = mep_get_string_part($page->meta_key,1); + $tes = get_post_meta($event_id,"mep_xtra_$order_option_name",true); + $ntes = ($tes+$order_option_qty); + update_post_meta( $event_id, "mep_xtra_$order_option_name",$ntes); + } + } + + + + } + } + + + + + update_post_meta( $event_id, $order_meta_text, $order_processing); + + + $mep_stock_msg = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); + $mep_stock_order = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); + + +if($mep_stock_order==$order_id){ if($mep_stock_msg=='completed'){ update_post_meta( $event_id, $order_meta_text, $order_processing); } else{ update_post_meta( $event_id, 'total_booking', ($mep_total_booking+$item_quantity)); update_post_meta( $event_id, $order_meta_text, $order_processing); + } } - } +} - if($order->has_status( 'cancelled' )) { - update_post_meta( $event_id, $order_meta_text, $order_cancelled); - $mep_stock_msg = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); - $mep_stock_order = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); + + +if($order->has_status( 'cancelled' )) { + update_post_meta( $event_id,$mep_atnd, "a2"); + update_post_meta( $event_id, $order_meta_text, $order_cancelled); + $mep_stock_msg = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); + $mep_stock_order = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); if($mep_stock_order==$order_id){ $update_total_booking = update_post_meta( $event_id, 'total_booking', ($mep_total_booking-$item_quantity)); + + foreach ( $result as $page ){ + if (strpos($page->meta_key, '_') !== 0) { + $order_option_name = $event_id.str_replace(' ', '', mep_get_string_part($page->meta_key,0)); + $order_option_qty = mep_get_string_part($page->meta_key,1); + $tes = get_post_meta($event_id,"mep_xtra_$order_option_name",true); + $ntes = ($tes-$order_option_qty); + if($tes>0){ + update_post_meta( $event_id, "mep_xtra_$order_option_name",$ntes); + } + } + } } - } +} - if( $order->has_status( 'completed' )) { + + + + +if( $order->has_status( 'completed' )) { +update_post_meta( $event_id, $mep_atnd, "a2"); // update_post_meta( $event_id, $order_meta_text, $order_completed); $mep_stock_msg = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),0); $mep_stock_order = mep_get_order_info(get_post_meta($event_id,$order_meta_text, true),1); @@ -336,9 +445,21 @@ function mep_event_seat_management( $order_id, $from_status, $to_status, $order else{ update_post_meta( $event_id, 'total_booking', ($mep_total_booking+$item_quantity)); update_post_meta( $event_id, $order_meta_text, $order_completed); + + foreach ( $result as $page ){ + if (strpos($page->meta_key, '_') !== 0) { + $order_option_name = $event_id.str_replace(' ', '', mep_get_string_part($page->meta_key,0)); + $order_option_qty = mep_get_string_part($page->meta_key,1); + $tes = get_post_meta($event_id,"mep_xtra_$order_option_name",true); + $ntes = ($tes+$order_option_qty); + update_post_meta( $event_id, "mep_xtra_$order_option_name",$ntes); + } + } } } + + } } @@ -403,7 +524,7 @@ add_filter( 'post_row_actions', 'mep_remove_row_actions', 10, 1 ); function mep_remove_row_actions( $actions ) { if( get_post_type() === 'mep_events_attendees' ) - unset( $actions['edit'] ); + // unset( $actions['edit'] ); // unset( $actions['view'] ); unset( $actions['trash'] ); unset( $actions['inline hide-if-no-js'] ); @@ -470,69 +591,11 @@ function mep_get_event_status($startdatetime){ - - - - -// Get Event Registration Button -function mep_get_event_reg_btn($post_id){ - -// $event_meta = get_post_meta($post_id, 'mep_event_meta',true); -$event_meta = get_post_custom(get_the_id()); -$event_expire_date = $event_meta['mep_event_start_date'][0]; -$event_sqi = $event_meta['mep_sqi'][0]; -$event_ecternal_link = ''; -// $event_ecternal_url = $event_meta['ex_reg_url'][0]; -$book_count = get_post_meta($post_id,'total_booking', true); - -if($book_count){ $total_book = $book_count; }else{ $total_book = 0; } - $seat_left = ($event_meta['mep_total_seat'][0]- $total_book); - $time = strtotime($event_expire_date); - $newformat = date('Y-m-d H:i:s',$time); - $datetime1 = new DateTime(); - $datetime2 = new DateTime($newformat); - $interval = $datetime1->diff($datetime2); - - if(time() > strtotime($newformat)){ - echo "Event Expired"; - } - elseif($seat_left<=0){ - echo "No Seat Available"; - } - else{ - $days = $interval->d; - $hours = $interval->h; - $minutes = $interval->i; - if($days>0){ $dd = $days." days "; }else{ $dd=""; } - if($hours>0){ $hh = $hours." hours "; }else{ $hh=""; } - if($minutes>0){ $mm = $minutes." minutes "; }else{ $mm=""; } - - - ?> -
    - - - - - - - - - - -
    - - cart->get_checkout_url(); + $checkout_url = wc_get_checkout_url(); return $checkout_url; } @@ -550,6 +613,8 @@ function mep_set_custom_events_attendees_columns($columns) { $columns['mep_email'] = __( 'email', 'mep' ); $columns['mep_phone'] = __( 'Phone', 'mep' ); $columns['mep_address'] = __( 'Addresss', 'mep' ); + $columns['mep_tsize'] = __( 'Tee Size', 'mep' ); + $columns['mep_ttype'] = __( 'Ticket', 'mep' ); $columns['mep_evnt'] = __( 'Event', 'mep' ); return $columns; @@ -562,11 +627,11 @@ function mep_events_attendees_column( $column, $post_id ) { switch ( $column ) { case 'mep_uid' : - echo get_post_meta( $post_id, 'ea_order_id', true ); + echo get_post_meta( $post_id, 'ea_user_id', true ).get_post_meta( $post_id, 'ea_order_id', true ).$post_id; break; case 'mep_fn' : - echo get_post_meta( $post_id, 'ea_first_name', true )." ".get_post_meta( $post_id, 'ea_last_name', true ); + echo get_post_meta( $post_id, 'ea_name', true ); break; case 'mep_email' : @@ -577,10 +642,18 @@ function mep_events_attendees_column( $column, $post_id ) { echo get_post_meta( $post_id, 'ea_phone', true ); break; + case 'mep_tsize' : + echo get_post_meta( $post_id, 'ea_tshirtsize', true ); + break; + case 'mep_address' : echo get_post_meta( $post_id, 'ea_address_1', true )."
    ".get_post_meta( $post_id, 'ea_address_2', true )."
    ".get_post_meta( $post_id, 'ea_state', true ).", ".get_post_meta( $post_id, 'ea_city', true ).", ".get_post_meta( $post_id, 'ea_country', true ); break; + case 'mep_ttype' : + echo get_post_meta( $post_id, 'ea_ticket_type', true ); + break; + case 'mep_evnt' : echo get_post_meta( $post_id, 'ea_event_name', true ); break; @@ -609,29 +682,27 @@ add_action('admin_menu', 'mep_disable_new_posts'); function mep_load_events_templates($template) { global $post; + if ($post->post_type == "mep_events"){ + $template_name = 'single-events.php'; + $template_path = 'mage-events/'; + $default_path = plugin_dir_path( __FILE__ ) . 'templates/'; + $template = locate_template( array($template_path . $template_name) ); + if ( ! $template ) : + $template = $default_path . $template_name; + endif; + return $template; + } - // Is this a "my-custom-post-type" post? - if ($post->post_type == "mep_events"){ - - //Your plugin path + if ($post->post_type == "mep_events_attendees"){ $plugin_path = plugin_dir_path( __FILE__ ); - - // The name of custom post type single template - $template_name = 'templates/single-events.php'; - - // A specific single template for my custom post type exists in theme folder? Or it also doesn't exist in my plugin? + $template_name = 'templates/single-mep_events_attendees.php'; if($template === get_stylesheet_directory() . '/' . $template_name || !file_exists($plugin_path . $template_name)) { - - //Then return "single.php" or "single-my-custom-post-type.php" from theme directory. return $template; } - - // If not, return my plugin custom post type template. return $plugin_path . $template_name; } - //This is not my custom post type, do nothing with $template return $template; } add_filter('single_template', 'mep_load_events_templates'); @@ -722,4 +793,237 @@ function mep_get_item_price($name){ $explode_name = explode('_', $name, 2); $the_item_name = str_replace('-', ' ', $explode_name[1]); return $the_item_name; +} + + + +function mep_get_string_part($data,$string){ + $pieces = explode(" x ", $data); +return $pieces[$string]; // piece1 +} + + +function mep_get_event_order_metadata($id,$part){ +global $wpdb; +$table_name = $wpdb->prefix . 'woocommerce_order_itemmeta'; +$result = $wpdb->get_results( "SELECT * FROM $table_name WHERE order_item_id=$id" ); + +foreach ( $result as $page ) +{ + if (strpos($page->meta_key, '_') !== 0) { + echo mep_get_string_part($page->meta_key,$part).'
    '; + } +} + +} + +add_action('woocommerce_account_dashboard','mep_ticket_lits_users'); +function mep_ticket_lits_users(){ +ob_start(); +?> +
    + + + + + + + + array( 'mep_events_attendees' ), + 'posts_per_page' => -1, + 'meta_query' => array( + array( + 'key' => 'ea_user_id', + 'value' => get_current_user_id() + ) + ) + ); + $loop = new WP_Query( $args_search_qqq ); + while ($loop->have_posts()) { + $loop->the_post(); +$event_id = get_post_meta( get_the_id(), 'ea_event_id', true ); + $event_meta = get_post_custom($event_id); + + $time = strtotime($event_meta['mep_event_start_date'][0]); + $newformat = date('Y-m-d H:i:s',$time); + + + if(time() < strtotime($newformat)){ +?> + + + + + + + +
    NameTicketEventDownload
    Download
    +
    +","",strip_tags(file_get_contents($filename, FALSE, NULL, 24, 14))); + } + $theme[$file] = $naame; +} +return $theme; +} + + + +function event_single_template_list($current_theme){ +$themes = event_template_name(); + $buffer = ''; + echo $buffer; +} + +function mep_title_cutoff_words($text, $length){ + if(strlen($text) > $length) { + $text = substr($text, 0, strpos($text, ' ', $length)); + } + + return $text; +} + +function mep_get_tshirts_sizes($event_id){ + $event_meta = get_post_custom($event_id); + $tee_sizes = $event_meta['mep_reg_tshirtsize_list'][0]; + $tszrray = explode(',', $tee_sizes); +$ts = ""; + foreach ($tszrray as $value) { + $ts .= ""; + } +return $ts; +} + + +function my_function_meta_deta() { + global $order; + +$order_id = $_GET['post']; + // Getting an instance of the order object + $order = wc_get_order( $order_id ); + $order_meta = get_post_meta($order_id); + + # Iterating through each order items (WC_Order_Item_Product objects in WC 3+) + foreach ( $order->get_items() as $item_id => $item_values ) { + $product_id = $item_values->get_product_id(); + $item_data = $item_values->get_data(); + $product_id = $item_data['product_id']; + $item_quantity = $item_values->get_quantity(); + $product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' ); + $event_name = $item_data['name']; + $event_id = $product->ID; + $item_id = $item_id; + } + +$user_info_arr = wc_get_order_item_meta($item_id,'_event_user_info',true); + +// print_r($user_info_arr); + + ob_start(); +?> +
    + + + + + + + + +
    NameCity
    +
    +id ); + + + +// add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 ); +function woocommerce_thankyou_change_order_status( $order_id ){ + if( ! $order_id ) return; + + $order = wc_get_order( $order_id ); + + if( $order->get_status() == 'processing' ) + $order->update_status( 'completed' ); +} + + + + +function mep_event_list_price($pid){ +global $post; + $cur = get_woocommerce_currency_symbol(); + $mep_event_ticket_type = get_post_meta($pid, 'mep_event_ticket_type', true); + $mep_events_extra_prices = get_post_meta($pid, 'mep_events_extra_prices', true); + $n_price = get_post_meta($pid, '_price', true); + if($n_price==0){ + $gn_price = "Free"; + }else{ + $gn_price =$cur.$n_price; + } + if($mep_events_extra_prices){ + $gn_price = $cur.$mep_events_extra_prices[0]['option_price']; + } + if($mep_event_ticket_type){ + $gn_price = $cur.$mep_event_ticket_type[0]['option_price_t']; + } +return $gn_price; } \ No newline at end of file