This topic contains 12 reply and 3 voices, and was last updated by bigtom 5 years, 4 months ago
Viewing 12 Posts - 1 through 12 (of 12 total)
Author Posts
May 14, 2014 at 7:07 am 20418
bigtom So I am having issues with products when I use a _sale_price. I referenced the topic here. I added the supplied code to the functions.php to assign the value of _price to _regular_price. This works. However the sale price will not show unless I go the the product in admin and update without changing anything. Is there some other missing mete key for sale products?
May 14, 2014 at 7:19 am 20423
bigtom bigtom

I think I have figured this out I just need to work a way to keep _price updated with the _sale_price after _price is set to _regular_price and only if it is on sale. I am not sure how to write that function.

Set _regular_price to _price
If _sale_price has value
Set _price to _sale_price

Something like this should be a solid fix for the price display interaction with WPUF.

May 14, 2014 at 7:51 am 20425
bigtom bigtom

Edit

May 19, 2014 at 3:44 am 20666
bigtom bigtom

No help with this?

May 19, 2014 at 5:53 am 20669
Mahi Mahi

you will not be able to manage it with free version. Cause, free version has cf_ prefix at first on it’s each meta fields by default.

May 19, 2014 at 5:59 am 20670
bigtom bigtom

I am not using the free version, but I cannot post in the Pro section because of different email I think. None of my meta fields are prefixed with cf_.

The regular price is working using the code you supplied in a different post, but the sale price needs to be sent to _price only when there is a _sale_price value and this cannot affect the regular price.

Can you help with this?

May 19, 2014 at 7:14 am 20673
bigtom bigtom

I am also wondering if there is a way to set multiple users to see the same products on the dashboard with different user IDs. Maybe setting a hidden field to make author “master” and use [wpuf_dashboard author=master].

May 22, 2014 at 12:31 pm 20827
bigtom bigtom

Still trying to sort this sale price situation out. Any advice would be appreciated.

June 15, 2014 at 1:48 pm 21940
Sk Sk

Hello bigtom,

sorry for late response. maybe you have done something like this,
Set _regular_price to _price
If _sale_price has value
Set _price to _sale_price

but you need to do like this,
Set _regular_price to _price
If _sale_price has value
Set _sale_price to _price

Thank you.

June 15, 2014 at 7:50 pm 21961
bigtom bigtom

Thanks I will give this a try.

Tom

June 16, 2014 at 7:20 am 21979
bigtom bigtom

Hello,

I am not sure how to include this in the current function I have.

function wpufe_update_post_price( $post_id ) {
$price = get_post_meta( $post_id, ‘_price’, true );

update_post_meta( $post_id, ‘_regular_price’, $price );
}

It seems the example you gave sets the _regular_price to _sale_price
through _price. Maybe it does not make sense but it works?

Thanks,

Tom

June 16, 2014 at 12:17 pm 21996
Sk Sk

please don’t set “_regular_price” to “_sale_price
but set “_sale_price” to “_price” if there have “_sale_price“.

change the function like this:

function wpufe_update_post_price( $post_id ) {

    $regular_price = get_post_meta( $post_id, ‘_regular_price’, true );
    $sale_price = get_post_meta( $post_id, ‘_sale_price’, true );

    update_post_meta( $post_id, ‘_price’, $regular_price );

    if ( !empty( $sale_price ) ) {

        update_post_meta( $post_id, ‘_price’, $sale_price );

    }

}

Hope this will work.
Thank you.

June 16, 2014 at 2:11 pm 22002
bigtom bigtom

Thank you,

The email had some syntax issues with the apostropes and the font. Once
I got that fixed it works so far as I can tell. I appreciate the support.

Tom

Viewing 12 Posts - 1 through 12 (of 12 total)