| | #1 |
| Warrior Member Join Date: 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
I have WordPress e commerce site with responsive comparison theme , Now I have setup crawler which scrapes the price from various pages . This crawler gives me an api (url) which i want to post instead of numeric values. Now how do I program it to get the data from url and if the data from url is not available then to use another variable which would contain a fallback price. I want to use this api because the crawler runs every 15 minutes and could help me in getting live data. I am beginner . My class_core file is this I suppose: Price Display ================================================== ======================== */ function PRICE($val){ // RETURN IF NOT NUMERIC if(!is_numeric($val) && defined('WLT_JOBS') ){ return $val; } if(isset($GLOBALS['CORE_THEME']['currency'])){ $seperator = "."; $sep = ","; $digs = 2; if(is_numeric($val)){ $val = number_format($val,$digs, $seperator, $sep); } $val = hook_price_filter($val); // RETURN IF EMPTY if($val == ""){ return $val; } // LEFT/RIGHT POSITION if(isset($GLOBALS['CORE_THEME']['currency']['position']) && $GLOBALS['CORE_THEME']['currency']['position'] == "right"){ if(substr($val,-3) == ".00"){ $val = substr($val,0,-3); } $val = $val.$GLOBALS['CORE_THEME']['currency']['symbol']; }else{ $val = $GLOBALS['CORE_THEME']['currency']['symbol'].$val; } } |
| |
|
| Bookmarks |
| Tags |
| affiliate, ecommerce, live, live price, marketing, php, prices, scraper, wordpress |
| |