Support

Home Forums Pre-Sales Wrong price on front end

Wrong price on front end

Posted: July 15, 2015 at 3:38 pm


Peter Pitchford

July 15, 2015 at 3:38 pm

I’m following up on this thread which I can’t post to.
https://eventespresso.com/topic/wrong-prices-on-front-end/

The problem is caused by _get_subtotal_for_admin in
/wp-content/plugins/event-espresso-decaf/core/db_classes|EE_Taxes.class.php
its getting both prices for the early price and then adding them together.
Here is the array of both prices that are added together
prices:2

Array
(
[3] => EE_Price Object
(
[_props_n_values_provided_in_constructor:EE_Base_Class:private] => Array
(
[PRC_ID] => 3
[PRT_ID] => 1
[PRC_amount] => 75.000
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
)

[_timezone:protected] => Africa/Abidjan
[_dt_frmt:protected] => F j, Y
[_tm_frmt:protected] => g:i a
[_cached_properties:protected] => Array
(
)

[_model_relations:protected] => Array
(
[Ticket] => Array
(
)

[Price_Type] =>
[Extra_Meta] => Array
(
)

)

[_fields:protected] => Array
(
[PRC_ID] => 3
[PRT_ID] => 1
[PRC_amount] => 75
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
)

[_Extra_Meta:protected] =>
)

[5] => EE_Price Object
(
[_props_n_values_provided_in_constructor:EE_Base_Class:private] => Array
(
[PRC_ID] => 5
[PRT_ID] => 1
[PRC_amount] => 65.000
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
)

[_timezone:protected] => Africa/Abidjan
[_dt_frmt:protected] => F j, Y
[_tm_frmt:protected] => g:i a
[_cached_properties:protected] => Array
(
)

[_model_relations:protected] => Array
(
[Ticket] => Array
(
)

[Price_Type] =>
[Extra_Meta] => Array
(
)

)

[_fields:protected] => Array
(
[PRC_ID] => 5
[PRT_ID] => 1
[PRC_amount] => 65
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
)

[_Extra_Meta:protected] =>
)

)


Peter Pitchford

July 15, 2015 at 3:41 pm

Its adding the prc amounts, 65 and 75 and coming up with 140


Lorenzo Orlando Caum

  • Support Staff

July 15, 2015 at 3:52 pm

Hi Peter, could you upgrade to the recent version of Event Espresso 4 decaf and let us know if this issue continues?

Your earlier support post mentioned 4.4.x.

Thanks


Lorenzo


Peter Pitchford

July 16, 2015 at 12:52 am

I’ve upgraded to 4.7.4, and it has the same problem
Here is a debug of $prices with
/public_html/wp-content/plugins/event-espresso-decaf/core/db_classes/EE_Taxes.class.php line 78
prices:2

Array
(
[3] => EE_Price Object
(
[_props_n_values_provided_in_constructor:protected] => Array
(
[PRC_ID] => 3
[PRT_ID] => 1
[PRC_amount] => 75.000
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
[PRC_wp_user] => 393
)

[_timezone:protected] => Africa/Abidjan
[_dt_frmt:protected] => F j, Y
[_tm_frmt:protected] => g:i a
[_cached_properties:protected] => Array
(
)

[_model_relations:protected] => Array
(
[Ticket] => Array
(
)

[Price_Type] =>
[WP_User] =>
[Extra_Meta] => Array
(
)

[Change_Log] => Array
(
)

)

[_fields:protected] => Array
(
[PRC_ID] => 3
[PRT_ID] => 1
[PRC_amount] => 75
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] =>
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] =>
[PRC_parent] => 0
[PRC_wp_user] => 393
)

)

[5] => EE_Price Object
(
[_props_n_values_provided_in_constructor:protected] => Array
(
[PRC_ID] => 5
[PRT_ID] => 1
[PRC_amount] => 65.000
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] => 0
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] => 0
[PRC_parent] => 0
[PRC_wp_user] => 393
)

[_timezone:protected] => Africa/Abidjan
[_dt_frmt:protected] => F j, Y
[_tm_frmt:protected] => g:i a
[_cached_properties:protected] => Array
(
)

[_model_relations:protected] => Array
(
[Ticket] => Array
(
)

[Price_Type] =>
[WP_User] =>
[Extra_Meta] => Array
(
)

[Change_Log] => Array
(
)

)

[_fields:protected] => Array
(
[PRC_ID] => 5
[PRT_ID] => 1
[PRC_amount] => 65
[PRC_name] =>
[PRC_desc] =>
[PRC_is_default] =>
[PRC_overrides] => 0
[PRC_order] => 1
[PRC_deleted] =>
[PRC_parent] => 0
[PRC_wp_user] => 393
)

)

)
I got it to work by breaking after the first iteration. What is the second EE_Price Object in that array for, and what would be missing if I skip it?
That array is not coming from a cache. Its coming from
if( $query_params ){
$related_model_objects = $this->get_model()->get_all_related($this, $relationName, $query_params);
} in /wp-content/plugins/event-espresso-decaf/core/db_classes|EE_Base_Class.class.php


Josh

  • Support Staff

July 16, 2015 at 9:02 am

Hi Peter,

Does this happen when you set up a new event with tickets using an unmodified version of EE4 decaf’s current version?


Peter Pitchford

July 16, 2015 at 9:04 am

No it doesn’t.


Josh

  • Support Staff

July 16, 2015 at 9:51 am

Thanks for confirming. There were some bugs with the ticket editor in the earlier versions of decaf that have since been fixed. You may need to set up new tickets for that old event, or start a new event to ensure the ticket data is set up correctly.

The support post ‘Wrong price on front end’ 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