Start a project
WooCommerce

Show MSRP Price in WooCommerce WP-Lister for Amazon

· by Daniel

Show MSRP Price in WooCommerce WP-Lister for Amazon

If you use the WP Lister for Amazon plugin you are able to set a custom MSRP price for products. But these do not show as stroke trough price if you enter a regular or sale price.

Add the below code into your functions.php and the regular price will always show the MSRP price if set.

/**
Change on sale to true if MSRP is set, otherwise price only shows regular
**/
add_filter( 'woocommerce_product_is_on_sale', 'we_msrp_on_sale', 10, 1);
function we_msrp_on_sale($onsale) {
    global $product;
    if(!$product) {
        return $onsale;
    }
    $rrp = get_post_meta( $product->get_id(), '_msrp_price', true );
    if($rrp) {
        $price = $product->get_regular_price();
        $onsale = true;
    }
    $variable_rrp = get_post_meta( $product->get_id(), 'variable_msrp', true );
    if($variable_rrp) {
        $price = $variable_rrp;
        $onsale = true;
    }
    return $onsale;
}
/**
Sale price will be regular price if msrp is set
**/
add_filter( 'woocommerce_product_get_sale_price', 'we_msrp_sale_price', 10, 1);
function we_msrp_sale_price($price) {
    global $product;
    if(!$product) {
        return $price;
    }
    $rrp = get_post_meta( $product->get_id(), '_msrp_price', true );
    if($rrp) {
        $price = $product->get_regular_price();
    }
    $variable_rrp = get_post_meta( $product->get_id(), 'variable_msrp', true );
    if($variable_rrp) {
        $price = $variable_rrp;
    }
    return $price;
}
/**
**/
add_filter( 'woocommerce_product_get_regular_price', 'we_msrp_price', 10, 1);
function we_msrp_price($price) {
    global $product;
    if(!$product) {
        return $price;
    }
    $rrp = get_post_meta( $product->get_id(), '_msrp_price', true );
    if($rrp) {
        $price = $rrp;
    }
    $variable_rrp = get_post_meta( $product->get_id(), 'variable_msrp', true );
    if($variable_rrp) {
        $price = $variable_rrp;
    }
    return $price;
}

More articles

All articles →
WooCommerceOctober 29, 2026 EmpCo Directive: What Online Shops Must Know About Green Claims Since 27 September 2026 “Sustainable”, “climate-neutral shipping”, “eco-friendly packaging”: claims like these appear in many online shops – in product texts, banners, badges in the footer or in carbon of… WooCommerceDecember 22, 2023 Prevent WP Rocket from Caching Filtered WooCommerce pages When using WP Rocket with preloading in combination with a filter plugin like Filter Everything pro, then your database AND cache folder can explode. We had a site with only around… WooCommerceApril 20, 2022 How to Reactivate old WooCommerce PayPal Standard Gateway WooCommerce has replaced the old PayPal Standard Payment Gateway since version 5.5.

Let's increase your online sales.

Tell us about your shop or website. A developer replies, not a sales team.

★ 4.85/5 from 800+ ratings · Envato Elite Author · Made in Germany