Home › Forums › Ticket Products › Event Tickets Plus › Get Regular Price & Sale Price
- This topic has 2 replies, 3 voices, and was last updated 8 years, 9 months ago by Support Droid.
-
AuthorPosts
-
May 14, 2015 at 5:06 pm #962810JoshuaParticipant
I have events setup for a price of $50, with a sale price within WooCommerce that last a certain amount of time for $35 dollars.
I have it setup on a single event to display the sale price while it exists. Once the calendar in WooCommerce products shuts off the sale price, it shows the regular price just fine.
I have a custom loop on my home page. Using:
<?php echo tribe_get_formatted_cost(); ?>
allows me to get the price, but once the WooCommerce sale ends, the price remains at 35 on the home page only.I need it to show the price of $50 after the sale ends and when it’s on sale, I need to display ON SALE in front of the price.
Thank you.
May 15, 2015 at 5:40 am #962870GeorgeParticipantHi Joshua,
This is unfortunately a set of customizations that fall outside the scope of our support, but the good news is that there seem to be enough filters and such in place that you can concoct something pretty good here.
What I mean by that is that the tribe_get_formatted_cost() function runs its output through the ‘tribe_get_formatted_cost’ filter. So, you could alter the display of the cost with custom code like this:
add_filter( 'tribe_get_formatted_cost', 'joshua_example_filter_price_display' ); function joshua_example_filter_price_display( $price ) { $event_id = get_the_ID(); return 'On sale' . $event_id . $price; }
This example is super simple, but shows storing the event ID in a variable called $event_id, and returning the filtered $price content. If an event with the ID of 123 had a price of $20, this example function would change the display from “$20” to “On sale 123 $20”.
This example may seem useless, but if you use the principles of using the $event_id and then you can put together code to check if your event ID is an event that’s on sale, then alter the display based on whether it’s on sale or not, you should be able to get something working here.
I’m sorry if any of this is unclear, let us know if it helps!
— George
July 7, 2015 at 6:32 am #984160Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Get Regular Price & Sale Price’ is closed to new replies.