Jump to content

jimleeder123

Members
  • Posts

    84
  • Joined

  • Last visited

jimleeder123's Achievements

Member

Member (2/5)

0

Reputation

1

Community Answers

  1. Ok you have permission to send an army after me, you were right. I swear it wasn't working yesterday. Very odd, but it works now!
  2. I'm editing the Woocommerce e-mail files, and have got a session working. When it's echoed on the e-mail it appears as expected - "1 Day Health & Safety Awareness Chelmsford". However the if statement is not working. This is shown below, can anyone tell me where I'm going wrong? if (strpos($_SESSION['ahsname'], 'safety awareness') !== false) { // This is what I want to happen, the session should (and does) contain the string shown above //include( get_template_directory() . '/instructions/chelmsford-hsa-ahs.html'); echo "YES"; }else{ // This should not happen but it does! echo "NO "; echo $_SESSION['ahsname']; // the session is echoed with the bit I'm checking for included as mentioned above }
  3. I decided to ditch this idea, and had success with another method instantly. Thanks for the help though, do appreciate it
  4. Sorry, I'm using WooCommerce, and my own custom theme. I'm trying to enter this into the admin order e-mail file, and will carry it into the customer one later when ready. I've googled a lot and tried a lot, but nothings working. What I need is the product name(s) in the order. Because of the nature of the business, it's likely only one product will be bought (or multiple of a single product).
  5. I'm editing the e-mail templates on WordPress. I want to be able to get the product info from the order that the e-mail is about, so I can do stuff with it. I need the product name/title, and can go on with it from there. Any help greatly appreciated.
  6. I've had a quick look. Can this be used with an existing word document in my web files?
  7. I've hit a real wall here. I've got your code working ok outside the required function. This means that it goes through all of the same elements. However the function uses the event ID of the required item. Therefore it's just one event, so there should be just one name to check. The name of the event I'm testing contains "SSSTS" in the title, so below is my code. (by the way this is a function in my functions.php in WordPress. function attach_doc_to_email ( $attachments , $event_id, $object ) { // This function attaches a word doc to the order confirm e-mail based on an if statement // get the tickets $main = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); $tickets = $main->get_tickets( $event_id ); // Get ticket title - not yet complete foreach($tickets as $k=>$v){ $theresult[] = $v->name; } $ticket_title = $theresult[0]; if (strpos($ticket_title, 'sssts') !== false) { $your_doc_path = get_template_directory() . '/instructions/chelmsford-sssts.docx'; }else{ $your_doc_path = get_template_directory() . '/instructions/chelmsford-health-safety-awareness.docx'; } $attachments[] = $your_doc_path; return $attachments; } So the wrong result is always coming up. The way I can test this is by submitting an order each time and see if the correct attachment has been sent. The wrong attachment is always attached. However the code works outside the function like below... $main = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); $tickets = $main->get_tickets( $event_id ); foreach($tickets as $k=>$v){ $whatYouWantIs[] = $v->name; } $name = $whatYouWantIs[0]; if (strpos($name, 'sssts') !== false) { echo "yes $name"; }else{ echo "no"; } Which is very odd. Of course I need it working inside the function. Any ideas? Much appreciated.
  8. It's an array because thats what the plugin makes it. Has been a nightmare trying to get people in a different timezone to help with it! Thanks for that, will try to work something out.
  9. I'm using WordPress and Tribe's Event Calendar and Event ticket plus plugins. Their website is http://theeventscalendar.co.uk. I've been using their forums but it's taking a while to sort this out, so though someone on here might be able to help. I've got an array that I need to echo out part of. Inside each key (0, 1, 2, 3 and so on) there are numerous parts like ["ID"], ["name"] and so on. I want to echo out the ["name"] part of the key. I have a var dump for 10 keys in the array, each of which have their own ["name"] set. In the situation I'm using it, it will always have just 1 in the array, so I can target the first key in the array. Any ideas please on how to echo the ["name"] part? I have left a var dump of the array below. array(10) { [0]=> object(Tribe__Tickets__Ticket_Object)#4474 (20) { ["ID"]=> int(405) ["name"]=> string(16) "2 day sssts kent" ["description"]=> string(0) "" ["price"]=> string(3) "295" ["regular_price"]=> string(3) "295" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(38) "http://ssstsuk.co.uk/2-day-sssts-kent/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(0) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-07-07 08:00:00" ["end_date"]=> string(19) "2016-07-30 17:00:00" ["purchase_limit"]=> string(1) "0" } [1]=> object(Tribe__Tickets__Ticket_Object)#4494 (20) { ["ID"]=> int(308) ["name"]=> string(22) "2 Day SSSTS Chelmsford" ["description"]=> string(0) "" ["price"]=> string(3) "265" ["regular_price"]=> string(3) "265" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(64) "http://ssstsuk.co.uk/1-day-health-safety-awareness-chelmsford-2/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(13) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-20 08:00:00" ["end_date"]=> string(19) "2016-07-20 17:00:00" ["purchase_limit"]=> string(1) "0" } [2]=> object(Tribe__Tickets__Ticket_Object)#4687 (20) { ["ID"]=> int(306) ["name"]=> string(46) "1 Day Health & Safety Awareness Chelmsford" ["description"]=> string(0) "" ["price"]=> string(2) "95" ["regular_price"]=> string(2) "95" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(62) "http://ssstsuk.co.uk/1-day-health-safety-awareness-chelmsford/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(0) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-20 08:00:00" ["end_date"]=> string(19) "2016-07-19 17:00:00" ["purchase_limit"]=> string(1) "0" } [3]=> object(Tribe__Tickets__Ticket_Object)#4662 (20) { ["ID"]=> int(304) ["name"]=> string(46) "1 Day Health & Safety Awareness Colchester" ["description"]=> string(0) "" ["price"]=> string(3) "150" ["regular_price"]=> string(3) "150" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(62) "http://ssstsuk.co.uk/1-day-health-safety-awareness-colchester/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(0) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-20 08:00:00" ["end_date"]=> string(19) "2016-07-12 17:00:00" ["purchase_limit"]=> string(1) "0" } [4]=> object(Tribe__Tickets__Ticket_Object)#4475 (20) { ["ID"]=> int(301) ["name"]=> string(43) "1 Day Health & Safety Awareness Romford" ["description"]=> string(0) "" ["price"]=> string(3) "150" ["regular_price"]=> string(3) "150" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(51) "http://ssstsuk.co.uk/1-day-health-safety-awareness/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(1) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-20 08:00:00" ["end_date"]=> string(19) "2016-07-12 17:00:00" ["purchase_limit"]=> string(1) "0" } [5]=> object(Tribe__Tickets__Ticket_Object)#4705 (20) { ["ID"]=> int(298) ["name"]=> string(19) "2 Day SSSTS Romford" ["description"]=> string(0) "" ["price"]=> string(3) "295" ["regular_price"]=> string(3) "295" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(33) "http://ssstsuk.co.uk/2-day-sssts/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(1) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-20 09:00:00" ["end_date"]=> string(19) "2016-07-10 17:00:00" ["purchase_limit"]=> string(1) "0" } [6]=> object(Tribe__Tickets__Ticket_Object)#4719 (20) { ["ID"]=> int(237) ["name"]=> string(10) "SSSTS Test" ["description"]=> string(0) "" ["price"]=> string(4) "9.99" ["regular_price"]=> string(4) "9.99" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(32) "http://ssstsuk.co.uk/sssts-test/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(6) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-06-08 08:00:00" ["end_date"]=> string(19) "2016-06-17 17:00:00" ["purchase_limit"]=> string(1) "0" } [7]=> object(Tribe__Tickets__Ticket_Object)#4803 (20) { ["ID"]=> int(110) ["name"]=> string(13) "IT Training 1" ["description"]=> string(34) "Admits one person to IT Training 1" ["price"]=> string(5) "10.99" ["regular_price"]=> string(5) "10.99" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(35) "http://ssstsuk.co.uk/it-training-1/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(2) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-05-17 09:00:00" ["end_date"]=> string(19) "2016-06-17 17:00:00" ["purchase_limit"]=> string(1) "0" } [8]=> object(Tribe__Tickets__Ticket_Object)#4894 (20) { ["ID"]=> int(108) ["name"]=> string(21) "Health & Safety 2" ["description"]=> string(40) "Admits one person to health and safety 2" ["price"]=> string(5) "11.99" ["regular_price"]=> string(5) "11.99" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(37) "http://ssstsuk.co.uk/health-safety-2/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(1) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-05-17 09:00:00" ["end_date"]=> string(19) "2016-07-22 17:00:00" ["purchase_limit"]=> string(1) "0" } [9]=> object(Tribe__Tickets__Ticket_Object)#4906 (20) { ["ID"]=> int(106) ["name"]=> string(28) "Health & Safety Course 1" ["description"]=> string(49) "Admits one person to Health & Safety Course 1" ["price"]=> string(5) "11.99" ["regular_price"]=> string(5) "11.99" ["on_sale"]=> bool(false) ["admin_link"]=> string(42) "http://ssstsuk.co.uk/wp-admin/&action=edit" ["frontend_link"]=> string(44) "http://ssstsuk.co.uk/health-safety-course-1/" ["provider_class"]=> string(48) "Tribe__Tickets_Plus__Commerce__WooCommerce__Main" ["provider":protected]=> NULL ["stock":protected]=> int(0) ["global_stock_mode":protected]=> string(3) "own" ["global_stock_cap":protected]=> int(0) ["qty_sold":protected]=> int(10) ["qty_pending":protected]=> int(0) ["qty_cancelled":protected]=> int(0) ["manage_stock":protected]=> bool(false) ["start_date"]=> string(19) "2016-05-17 08:00:00" ["end_date"]=> string(19) "2016-06-10 17:00:00" ["purchase_limit"]=> string(1) "0" } }
  10. Ok, was wondering if there is a CSS hack for it or anything?
  11. I've got an HTML 5 date input box working on my site. Anyone know how to make the whole thing selectable like a drop down (select) box? Currently you can only select it by clicking on the arrow at the far right of it. I don't mind about losing the cross or up and down arrows. I just want the field to be fully selectable like a drop down box. Any ideas please? Thanks.
  12. The data will be going through WooCommerce. Also the file type is .docx. So how would I go about using this PHPWord thing please?
  13. I've got a function in my WordPress functions file that sends a Word doc based on what venue the ordered product is from. However I also need to be able to paste variables such as the customer name and others onto the specified word document. It also needs to be in specific places. How can I go about doing this? Please let me know if you have any idea or don't understand me! Thanks!
  14. Is it possible to have a horizontal masonry effect? I know usually masonry is done in columns with posts shown in order vertically. However I want it to be done horizontally. I also want it to be CSS only - no JavaScript whatsoever. Is this possible? Have tried loads of things like displaying as flex, CSS columns, floating, inline-blocks and whatever.
  15. I'm looking for a div that has the class row0 if the clicked element is pagelink0, row1 if its pagelink1 etc. Please note that the row div is not a child element, pagelink is a child element of another element (div called paginationwrap). Requinix can you please tell me how to do search in jQuery? Haven't done it before.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.