本文整理汇总了PHP中Manufacturer::getUrlById方法的典型用法代码示例。如果您正苦于以下问题:PHP Manufacturer::getUrlById方法的具体用法?PHP Manufacturer::getUrlById怎么用?PHP Manufacturer::getUrlById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manufacturer
的用法示例。
在下文中一共展示了Manufacturer::getUrlById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_product_overview
//.........这里部分代码省略.........
// is empty)
$detail_url = \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'details', FRONTEND_LANG_ID, array('productId' => $objProduct->id()))->toString();
self::$objTemplate->setVariable('SHOP_PRODUCT_DETAIL_URL', $detail_url);
if (!$product_id && !empty($longDescription)) {
$detailLink = '<a href="' . $detail_url . '"' . ' title="' . $_ARRAYLANG['TXT_MORE_INFORMATIONS'] . '">' . $_ARRAYLANG['TXT_MORE_INFORMATIONS'] . '</a>';
self::$objTemplate->setVariable('SHOP_PRODUCT_DETAILLINK', $detailLink);
}
// Check Product flags.
// Only the meter flag is currently implemented and in use.
$flagMeter = $objProduct->testFlag('__METER__');
// Submit button name and function.
// Calling productOptions() also sets the $flagMultipart variable
// to the appropriate encoding type for the form if
// any upload fields are in use.
$flagMultipart = false;
$productSubmitName = $productSubmitFunction = '';
if (isset($_GET['cmd']) && $_GET['cmd'] == 'details' && isset($_GET['referer']) && $_GET['referer'] == 'cart') {
$productSubmitName = "updateProduct[{$cart_id}]";
$productSubmitFunction = self::productOptions($id, $formId, $cart_id, $flagMultipart);
} else {
$productSubmitName = 'addProduct';
$productSubmitFunction = self::productOptions($id, $formId, $cart_id, $flagMultipart);
}
$shopProductFormName = "shopProductForm{$formId}";
$row = $formId % 2 + 1;
self::$objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . $row, 'SHOP_PRODUCT_ID' => $objProduct->id(), 'SHOP_PRODUCT_TITLE' => contrexx_raw2xhtml($objProduct->name()), 'SHOP_PRODUCT_DESCRIPTION' => $short, 'SHOP_PRODUCT_DETAILDESCRIPTION' => $longDescription ? $longDescription : $short, 'SHOP_PRODUCT_FORM_NAME' => $shopProductFormName, 'SHOP_PRODUCT_SUBMIT_NAME' => $productSubmitName, 'SHOP_PRODUCT_SUBMIT_FUNCTION' => $productSubmitFunction, 'SHOP_FORM_ENCTYPE' => $flagMultipart ? ' enctype="multipart/form-data"' : '', 'TXT_SHOP_PRODUCT_COUNT' => $flagMeter ? $_ARRAYLANG['TXT_SHOP_PRODUCT_METER'] : $_ARRAYLANG['TXT_SHOP_PRODUCT_COUNT'], 'SHOP_CURRENCY_CODE' => Currency::getActiveCurrencyCode()));
if ($objProduct->code()) {
self::$objTemplate->setVariable('SHOP_PRODUCT_CUSTOM_ID', htmlentities($objProduct->code(), ENT_QUOTES, CONTREXX_CHARSET));
}
$manufacturer_name = $manufacturer_url = $manufacturer_link = '';
$manufacturer_id = $objProduct->manufacturer_id();
if ($manufacturer_id) {
$manufacturer_name = Manufacturer::getNameById($manufacturer_id, FRONTEND_LANG_ID);
$manufacturer_url = Manufacturer::getUrlById($manufacturer_id, FRONTEND_LANG_ID);
}
if (!empty($manufacturer_url) || !empty($manufacturer_name)) {
if (empty($manufacturer_name)) {
$manufacturer_name = $manufacturer_url;
}
if (!empty($manufacturer_url)) {
$manufacturer_link = '<a href="' . $manufacturer_url . '">' . $manufacturer_name . '</a>';
}
// TODO: Test results for any combination of name and url
self::$objTemplate->setVariable(array('SHOP_MANUFACTURER_NAME' => $manufacturer_name, 'SHOP_MANUFACTURER_URL' => $manufacturer_url, 'SHOP_MANUFACTURER_LINK' => $manufacturer_link, 'TXT_SHOP_MANUFACTURER_LINK' => $_ARRAYLANG['TXT_SHOP_MANUFACTURER_LINK']));
}
// This is the old Product field for the Manufacturer URI.
// This is now extended by the Manufacturer table and should thus
// get a new purpose. As it is product specific, it could be
// renamed and reused as a link to individual Products!
$externalLink = $objProduct->uri();
if (!empty($externalLink)) {
self::$objTemplate->setVariable(array('SHOP_EXTERNAL_LINK' => '<a href="' . $externalLink . '" title="' . $_ARRAYLANG['TXT_SHOP_EXTERNAL_LINK'] . '" target="_blank">' . $_ARRAYLANG['TXT_SHOP_EXTERNAL_LINK'] . '</a>'));
}
if ($price) {
self::$objTemplate->setGlobalVariable(array('SHOP_PRODUCT_PRICE' => $price, 'SHOP_PRODUCT_PRICE_UNIT' => Currency::getActiveCurrencySymbol()));
}
// Only show the discount price if it's actually in use,
// avoid an "empty <font> tag" HTML warning
if ($discountPrice) {
self::$objTemplate->setGlobalVariable(array('SHOP_PRODUCT_DISCOUNTPRICE' => $discountPrice, 'SHOP_PRODUCT_DISCOUNTPRICE_UNIT' => Currency::getActiveCurrencySymbol()));
if (self::$objTemplate->blockExists('price_discount')) {
self::$objTemplate->touchBlock('price_discount');
}
} else {
if (self::$objTemplate->blockExists('price')) {
self::$objTemplate->touchBlock('price');