Create link even if API fails (patch)
-
When an item is not available through the Aliexpress affiliate program, I prefer to still view the items so my visitors can get what they want.
I have applied the following simple patch to show a link even if I can not get a commission:
--- wp_ae_frame.php.orig 2016-05-30 21:34:58.000000000 +0200 +++ wp_ae_frame.php 2016-06-12 22:04:49.000000000 +0200 @@ -23,7 +23,7 @@ $html = ""; if(!isset($data['status']) || $data['status'] == 0){ - $html = $this->get_html_no_item(); + $html = $this->get_html_no_item($id); }else{ $html = $this->get_html_item($data['item']); } @@ -239,13 +239,13 @@ return $html; } - private function get_html_no_item() + private function get_html_no_item($id) { $html = ""; $html .= "<div class='wp_ae_no_item_container'>"; $html .= "<div class='wp_ae_no_item_logo'><span class='wp_ae_no_item_logo_color'>Ali</span>Express</div>"; - $html .= "<div class='wp_ae_no_item_error'>Error: Item no longer available or API problems.</div>"; + $html .= "<div class='wp_ae_no_item_error'><a href='http://www.aliexpress.com/af/$id.html'>Buy</a></div>"; $html .= "<div class='wp_ae_clear'></div>"; $html .= "</div>";
The topic ‘Create link even if API fails (patch)’ is closed to new replies.