本文整理匯總了PHP中Vendor::currentVendor方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vendor::currentVendor方法的具體用法?PHP Vendor::currentVendor怎麽用?PHP Vendor::currentVendor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vendor
的用法示例。
在下文中一共展示了Vendor::currentVendor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hookCustomerAccount
public function hookCustomerAccount($params)
{
require_once dirname(__FILE__) . "/../ordervendor/Vendor.php";
if (Vendor::currentVendor() != null) {
return $this->display(__FILE__, 'menuitems.tpl');
}
}
示例2: dirname
try {
include dirname(__FILE__) . '/../../debug.php';
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/../ordervendor/Vendor.php';
include dirname(__FILE__) . '/serialnrmanager.php';
if (intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) {
$rewrited_url = __PS_BASE_URI__;
}
include dirname(__FILE__) . '/../../header.php';
/* include(dirname(__FILE__).'/../../debug-style.php'); */
require_once dirname(__FILE__) . "/ProductInstance.php";
if (!isset($_GET['serial'])) {
$_GET['serial'] = '';
}
$smarty->assign('serial', $_GET['serial']);
if ($_GET['serial'] != '') {
$smarty->assign('product_instances', ProductInstance::search($_GET['serial'], $cookie->id_lang));
}
$smarty->assign("current_customer", $cookie->id_customer);
$smarty->assign("current_vendor", Vendor::currentVendor());
$manager = new SerialNrManager();
echo $manager->display(dirname(__FILE__) . '/serialnrmanager.php', 'manage.tpl');
include dirname(__FILE__) . '/../../footer.php';
} catch (Exception $e) {
echo $e->getMessage();
echo "<br><bR>";
foreach ($e->getTrace() as $line) {
echo "{$line['class']}.{$line['function']} @ {$line['file']}:{$line['line']}<br>";
}
}
示例3: dirname
try {
include dirname(__FILE__) . '/../../debug.php';
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/../ordervendor/Vendor.php';
include dirname(__FILE__) . '/serialnrmanager.php';
if (intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) {
$rewrited_url = __PS_BASE_URI__;
}
include dirname(__FILE__) . '/../../header.php';
/* include(dirname(__FILE__).'/../../debug-style.php'); */
require_once dirname(__FILE__) . "/ProductInstance.php";
$instances = ProductInstance::search($_GET['serial'], $cookie->id_lang);
$instance = $instances[0];
if (Vendor::currentVendor() != null || $cookie->id_customer == $instance['id_current_owner']) {
if (isset($_POST['new_owner_email'])) {
$new_customer = new Customer();
$new_customer->getByEmail($_POST['new_owner_email']);
if ($new_customer->id != 0) {
$obj = new ProductInstance($instance['id_product_instance']);
$obj->id_current_owner = $new_customer->id;
$obj->save();
Tools::redirect($_SERVER['REQUEST_URI'], '');
} else {
$errors[] = Tools::displayError('No customer is registered with that email address.');
}
}
} else {
$errors[] = Tools::displayError('Please refer to your vendor to change owner.');
}