Any Wordpress / Woo commerce gurus?

Caporegime
Joined
7 Nov 2004
Posts
30,194
Location
Buckinghamshire
Hello all

I have a Word Press site I'm trying to tinker with at the moment but we're having trouble with one of our filters...

To briefly explain, we have a booking calender on our site that calculates booking on a per-day basis, we don't want it to do this and instead want it to use the Regular Price as setup on the product.

In short, we're adding the below filter to our functions.php file:

add_filter('easy_booking_get_new_item_price', 'easy_booking_remove_price_calculation', 10, 4);

{

// Product price (Regular or sale)
return $price;
}

Now, it does what it's meant to do, in the sense of removing the calculation from the calender, and when you add the item to the cart it displays the correct Regular Price, however the problem we have now is that where it would normally show the calculated price per-day, it now just shows £0.00....

Can anyone think of how to counteract this? Or if anything just get that part of the page removed/amended to only show the set price? Might be a long shot :(

Hope someone can shed some light, the original option was to add the code below in the spoiler tags, but this completely borks the product page and removes the pop-up calender all together along with the cart button:

add_filter('easy_booking_get_new_item_price', 'easy_booking_remove_price_calculation', 10, 4);

function easy_booking_remove_price_calculation( $booking_price, $product, $_product, $duration ) {
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
$price = $tax_display_mode === 'incl' ? $_product->get_price_including_tax() : $_product->get_price_excluding_tax(); // Product price (Regular or sale)

return $price;
}

Thanks all
 
Caporegime
Joined
28 Jan 2003
Posts
39,881
Location
England
Woocommerce documentation will have the hooks/filters that are available to you.

Is it showing £0.00 when you get to the woo commerce checkout?
 
Last edited:
Caporegime
OP
Joined
7 Nov 2004
Posts
30,194
Location
Buckinghamshire
Woocommerce documentation will have the hooks/filters that are available to you.

Is it showing £0.00 when you get to the woo commerce checkout?

Doesn't each plugin have its own filters/hooks though?

No it's fine in the checkout :) its just the calculation part specific to the plugin.

Looking at the price below, the top £200 is the item price,the bottom is the calculation as per the calendar...which I want it to return the regular item price.
Screenshot_2015-07-05-15-42-28_zps0sjfcxwy_edit_1436107523553.png_zpsvme5txho.jpeg
 
Last edited:
Caporegime
OP
Joined
7 Nov 2004
Posts
30,194
Location
Buckinghamshire
Sorry I thought you wanted woo commerce specific hooks.

Is it a plugin for woo commerce you're using?

Yeah I'm afraid so, good to know about what you said earlier though as I'll be customising it more in time. The plugin is woocommerce easybooking.

His would I go about finding out stiff for the specific plugin? I received help from the author as per the OP but it didn't work, even disabled all the plugins and it still played up :(

I literally want to hide the part where it shows the price at the bottom, but its proving difficult.
 
Caporegime
Joined
28 Jan 2003
Posts
39,881
Location
England
Have you looked at the code for the page that shows that info, that should be a good place to start as it will then have the hook that's used to pull that info.
 
Caporegime
OP
Joined
7 Nov 2004
Posts
30,194
Location
Buckinghamshire
I've had a gander, as said I'm new to this and only ever butchered php before to get my desired result....

I did find a line that seemed to remove the whole text showing, but that involved removing text from one of the main files, so I'd rather use a filter in the functions file really.
 
Back
Top Bottom