Support

Home Forums Event Espresso Premium Price dropdown order / Price in page lists (2)

Price dropdown order / Price in page lists (2)

Posted: May 27, 2014 at 8:58 am

Viewing 3 reply threads


Russ Reynolds

May 27, 2014 at 8:58 am

Further to this post:

https://eventespresso.com/topic/price-dropdown-order-price-in-page-lists/

I found the same problem in the accordion list. The events were being listed with random prices instead of the first price entered.

I tried to modify the file at /public_html/wp-content/plugins/espresso-template-category-accordion/index.php as the poster suggested in the other post referenced above.

The result is all zero’s for price.

Specifically I modified this line:

<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>echo '<p id="p_event_price-'. $event->id .'" class="event_price event-cost"><span class="section-title">'.__('Price: ', 'event_espresso').'</span> ' . $org_options['currency_symbol'].$event->event_cost . '</p>';

to this:

<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>echo '<p id="p_event_price-'. $event->id .'" class="event_price event-cost"><span class="section-title">'.__('Price: ', 'event_espresso').'</span> ' . $org_options['currency_symbol'].do_shortcode('[EVENT_PRICE event_id=' . $event_id . ' number="0"]'); '</p>';

But as I said, the prices in the accordion are all zero as you can see here:

http://www.edmontoncpr.com/public-course-schedule-2/


Russ Reynolds

May 27, 2014 at 9:01 am

Sorry..I don’t know how to properly post the code:

This was the before code:

echo ‘<p id=”p_event_price-‘. $event->id .'” class=”event_price event-cost”><span class=”section-title”>’.__(‘Price: ‘, ‘event_espresso’).'</span> ‘ . $org_options[‘currency_symbol’].$event->event_cost . ‘</p>’;

and this was the after code:

echo ‘<p id=”p_event_price-‘. $event->id .'” class=”event_price event-cost”><span class=”section-title”>’.__(‘Price: ‘, ‘event_espresso’).'</span> ‘ . $org_options[‘currency_symbol’].do_shortcode(‘[EVENT_PRICE event_id=’ . $event_id . ‘ number=”0″]’); ‘</p>’;


Tony

  • Support Staff

May 27, 2014 at 9:48 am

Hi Russ,

The reason the prices now 0 is because $event_id does not exist within the accordion template.

Simply swap $event_id for $event->id and the prices should be displayed correctly.

So the code to use becomes:

echo '<p id="p_event_price-'. $event->id .'" class="event_price event-cost"><span class="section-title">'.__('Price: ', 'event_espresso').'</span> ' . $org_options['currency_symbol'].do_shortcode('[EVENT_PRICE event_id=' . $event->id . ' number="0"]'); '</p>';

If you use that code are the prices correctly displayed?


Russ Reynolds

May 27, 2014 at 11:56 am

That worked perfectly, thank you!

Viewing 3 reply threads

The support post ‘Price dropdown order / Price in page lists (2)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso