Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author elfin

    (@elfin)

    the product id? or did you mean the sku?

    Thread Starter fangonk

    (@fangonk)

    Yeah, SKU – sorry.

    Plugin Author elfin

    (@elfin)

    $eshop_product=maybe_unserialize(get_post_meta($id, '_eshop_product','true'));

    where $id is the id of the page/post you want details of. This returns an array, the sku would be $eshop_product['sku']

    or print_r the $eshop_product to find out what is available via that.

    Alternatively you can use: get_eshop_product($id) which returns the above plus a few extra bits.

    Nice I made it work. However I cannot display the price the same way.
    I tried
    $eshop_product=maybe_unserialize(get_post_meta($id, ‘_eshop_product’,’true’));

    $eshop_product[‘eshop_price[1]’]

    But apparently eshop_price[1] is not the good value.
    Would you have an idea?

    Ok i found :
    if(substr($eshop_product[‘sku’],0,3)==”let”){ $prix=$eshop_product[‘products’][‘1’][‘price’].” $”;}else{$prix=”free “;};

    Would you have something better than this to test if the product is on sale or just free
    if(substr($eshop_product[‘sku’],0,3)==”let”)

    Please post a new topic.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: eShop] Echo Product ID’ is closed to new replies.