Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi,

    “because I display price from the database” – if you are showing the price with own code it will not work. We are attaching our code through hooks in the WooCommerce functions. if you are not using WooCommerce functions and not running their hooks where needed our plugin don’t know that price is taken.

    Regards,
    Dima

    Thread Starter emadsh

    (@emadsh)

    Hello, thank you for replay
    who can fix this problem my code is
    $onlineStore = $wpdb->get_results(
    “SELECT
    wp_posts.post_title AS productName,
    wp_postmeta1.meta_value AS SKU,
    wp_postmeta2.meta_value AS Price,
    wp_postmeta3.meta_value as AUTHORSName,
    wp_posts.ID,
    wp_postmeta4.meta_value as imageurl,
    wp_postmeta5.meta_value as vendorUrl
    FROM wp_posts
    LEFT JOIN wp_postmeta wp_postmeta1
    ON wp_postmeta1.post_id = wp_posts.ID
    AND wp_postmeta1.meta_key = ‘_sku’
    LEFT JOIN wp_postmeta wp_postmeta2
    ON wp_postmeta2.post_id = wp_posts.ID
    AND wp_postmeta2.meta_key = ‘_regular_price’

    RIGHT JOIN wp_usermeta wp_postmeta3
    on wp_postmeta3.user_id = wp_posts.post_author
    AND wp_postmeta3.meta_key=’nickname’

    RIGHT JOIN wp_usermeta wp_postmeta4
    on wp_postmeta4.user_id = wp_posts.post_author
    AND wp_postmeta4.meta_key=’_vendor_image’

    RIGHT JOIN wp_usermeta wp_postmeta5
    on wp_postmeta5.user_id= wp_posts.post_author
    AND wp_postmeta5.meta_key=’_vendor_page_slug’

    WHERE wp_posts.post_type = ‘product’
    AND wp_posts.post_status = ‘publish’
    AND wp_posts.post_title LIKE ‘$pp’

    ORDER BY Price ASC

    );

    if ( $onlineStore )
    {
    foreach ( $onlineStore as $post )
    {
    echo $post->Price;
    }
    }

    Good Day

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘can’t update product price in custom page’ is closed to new replies.