Why PHP custom code not working in WordPress?

Viewed 38

I am using this custom PHP code in WordPress "woocommerce/templates/archive-product.php" file, but its not working, page showing an error message "There has been a critical error on this website."

$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AliexpressAffiliateProductQueryRequest;
$req->setKeywords($category);
$req->setPageNo($pno);
$req->setPageSize("40");
//$req->setSort("SALE_PRICE_ASC");
$req->setTrackingId("xyzxyz");
$resp = $c->execute($req);

Error Page Image

0 Answers
Related