mikejolley / woocommerce-product-gift-wrap

Enable a per-product, store wide Gift wrap option - let the user choose design and make it free or paid.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

price over-ride doesnt work (text doesnt show)

amber007 opened this issue · comments

If the price is overriden in a single product, the price text doesnt change on front end (though add to cart loads the new price)

To clearify here's what happens:

say i have set the global price for gift wrap to 3.99 and then for an individual product i have it set to 4.99. On the product page the price still shows as 3.99 but when clicked add to cart, 4.99 gets added.... please advise on how to fix this. (Using the default text provided by the plugin) .. Thanks

This can be fixed in the gift_option_html function in the file woocommerce-product-gift-wrap.php.

On the line before:

$price_text = ...

Add this code:

$cost = get_post_meta( $post->ID, '_gift_wrap_cost', true );

if ( $cost == '' )
    $cost = $this->gift_wrap_cost;

Then make the $price_text line:

$price_text    = $cost > 0 ? woocommerce_price( $cost ) : __( 'free', 'product_gift_wrap' );

I have sent a pull request so that this issue can be resolved.