本文整理汇总了PHP中producthelper::replaceCartTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::replaceCartTemplate方法的具体用法?PHP producthelper::replaceCartTemplate怎么用?PHP producthelper::replaceCartTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::replaceCartTemplate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderLayout
//.........这里部分代码省略.........
$id = $this->content['ID'][$i];
$cid = $producthelper->getCategoryProduct($this->content['ID'][$i]);
$Itemid = $redhelper->getItemid($this->content['ID'][$i]);
$product = $producthelper->getProductById($this->content['ID'][$i]);
// GENERATING HEADER
if ($this->config['news_header_enabled'] == 1) {
$news_header = $renderer->header_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $Itemid);
}
// GENERATING IMAGE
if ($this->config['news_image_enabled'] == 1) {
$news_image = $renderer->image_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i], $Itemid);
}
// GENERATING READMORE
if ($this->config['news_readmore_enabled'] == 1) {
$news_readmore = $renderer->readMore_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $Itemid);
}
// GENERATING TEXT
if ($this->config['news_text_enabled'] == 1) {
$news_textt = $renderer->text_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore, $Itemid);
}
// GENERATE NEWS INFO
if ($this->config['news_info_enabled'] == 1) {
$news_infoo = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 1);
}
// GENERATE NEWS INFO2
if ($this->config['news_info2_enabled'] == 1) {
$news_infoo2 = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 2);
}
// COMPUTE PRICE DEPENDS OF USER ID
$user =& JFactory::getUser();
$price = $producthelper->getProductPrice($this->content['ID'][$i], $this->config['rs_price_with_vat'], $user->id);
$price = $producthelper->getProductFormattedPrice($price, true);
if ($this->config['rs_add_to_cart'] == 1) {
$addToCart = $producthelper->replaceCartTemplate($this->content['ID'][$i], 0, 0, 0, "", false, array(), 0, 0, 0);
$addToCart = str_replace('&', '&', $addToCart);
if ($this->config['rs_show_default_cart_button'] == 0) {
$btnCode = '<a class=\'nspAddToCart\' onclick="if(displayAddtocartForm(\'addtocart_prd_' . $this->content['ID'][$i];
$btnCode .= '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\'))';
$btnCode .= '{checkAddtocartValidation(\'addtocart_prd_' . $id . '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\',\'0\',\'0\',\'0\');}"><span style=\'cursor: pointer;\' id=\'pdaddtocartprd' . $id . '\' title=\'\' class=\'\'>' . JText::_('MOD_NEWS_PRO_GK4_ADD_TO_CART') . '</span></a>';
$addToCart = preg_replace('/\\<img.*?\\>/i', $btnCode, $addToCart);
}
}
// GET THE CURRENCY
$bool = preg_match('/[^0-9]/u', $price, $currency);
$currency = $currency[0];
$bool = preg_match('/[0-9]+/u', $price, $price);
$price = $price[0];
// GENERATE RedSHOP STORE INFO
$news_rs_store = $renderer->store_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $price, $this->content['discount_start'][$i], $this->content['discount_end'][$i], $this->content['tax'][$i], $this->content['discount_price'][$i], $currency, $Itemid, $addToCart);
} else {
if ($vm_mode == TRUE) {
// GENERATING HEADER
if ($this->config['news_header_enabled'] == 1) {
$news_header = $renderer->header_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i]);
}
// GENERATING IMAGE
if ($this->config['news_image_enabled'] == 1) {
$news_image = $renderer->image_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i]);
}
// GENERATING READMORE
if ($this->config['news_readmore_enabled'] == 1) {
$news_readmore = $renderer->readMore_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i]);
}
// GENERATING TEXT
if ($this->config['news_text_enabled'] == 1) {
$news_textt = $renderer->text_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore);
示例2: array
// Get attributes.
$attributes_set = array();
if ($product->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $product->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($product->product_id);
$attributes = array_merge($attributes, $attributes_set);
}
// Product attribute - Start.
$totalatt = count($attributes);
// Check product for not for sale.
$prddata_add = $producthelper->getProductNotForSaleComment($product, $prddata_add, $attributes);
$prddata_add = $producthelper->replaceProductInStock($product->product_id, $prddata_add, $attributes, $attribute_template);
$prddata_add = $producthelper->replaceAttributeData($product->product_id, 0, 0, $attributes, $prddata_add, $attribute_template, $isChilds);
// Get cart tempalte.
$prddata_add = $producthelper->replaceCartTemplate($product->product_id, $this->catid, 0, 0, $prddata_add, $isChilds, $userfieldArr, $totalatt, $totacc, $count_no_user_field);
}
$data_add = str_replace("{product_loop_start}", "", $data_add);
$data_add = str_replace("{product_loop_end}", "", $data_add);
$data_add = str_replace($template_product, $prddata_add, $data_add);
}
}
$template_desc = str_replace("{category_loop_start}", "", $template_desc);
$template_desc = str_replace("{category_loop_end}", "", $template_desc);
$template_desc = str_replace($middletemplate_desc, $data_add, $template_desc);
}
if (strstr($template_desc, "{filter_by}")) {
$template_desc = str_replace("{filter_by_lbl}", "", $template_desc);
$template_desc = str_replace("{filter_by}", "", $template_desc);
}
if (strstr($template_desc, "{template_selector_category}")) {
示例3: onRSProductSearch
//.........这里部分代码省略.........
}
}
}
$data_add = $data_add . $hidden_userfield;
/*************** end user fields ***************/
// ProductFinderDatepicker Extra Field Start
$fieldArray = $extraField->getSectionFieldList(17, 0, 0);
$data_add = $producthelper->getProductFinderDatepickerValue($data_add, $this->search[$i]->product_id, $fieldArray);
// ProductFinderDatepicker Extra Field End
/*
* manufacturer data
*/
$manufacturer_id = $this->search[$i]->manufacturer_id;
if ($manufacturer_id != 0) {
$manufacturer_data = $producthelper->getSection("manufacturer", $manufacturer_id);
$manufacturer_link_href = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $manufacturer_id . '&Itemid=' . $Itemid);
$manufacturer_name = "";
if (count($manufacturer_data) > 0) {
$manufacturer_name = $manufacturer_data->manufacturer_name;
}
$manufacturer_link = '<a href="' . $manufacturer_link_href . '" title="' . $manufacturer_name . '">' . $manufacturer_name . '</a>';
if (strstr($data_add, "{manufacturer_link}")) {
$data_add = str_replace("{manufacturer_name}", "", $data_add);
} else {
$data_add = str_replace("{manufacturer_name}", $manufacturer_name, $data_add);
}
$data_add = str_replace("{manufacturer_link}", $manufacturer_link, $data_add);
} else {
$data_add = str_replace("{manufacturer_link}", "", $data_add);
$data_add = str_replace("{manufacturer_name}", "", $data_add);
}
// End
// Replace wishlistbutton
$data_add = $producthelper->replaceWishlistButton($this->search[$i]->product_id, $data_add);
// Replace compare product button
$data_add = $producthelper->replaceCompareProductsButton($this->search[$i]->product_id, 0, $data_add);
// Checking for child products
$childproduct = $producthelper->getChildProduct($this->search[$i]->product_id);
if (count($childproduct) > 0) {
$isChilds = true;
$attributes = array();
} else {
$isChilds = false;
// Get attributes
$attributes_set = array();
if ($this->search[$i]->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $this->search[$i]->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($this->search[$i]->product_id);
$attributes = array_merge($attributes, $attributes_set);
}
// Product attribute Start
$totalatt = count($attributes);
// Check product for not for sale
$data_add = $producthelper->getProductNotForSaleComment($this->search[$i], $data_add, $attributes);
$data_add = $producthelper->replaceProductInStock($this->search[$i]->product_id, $data_add, $attributes, $attribute_template);
$data_add = $producthelper->replaceAttributeData($this->search[$i]->product_id, 0, 0, $attributes, $data_add, $attribute_template, $isChilds);
// Cart Template
$data_add = $producthelper->replaceCartTemplate($this->search[$i]->product_id, 0, 0, 0, $data_add, $isChilds, $userfieldArr, $totalatt, 0, $count_no_user_field, "");
$data .= $data_add;
}
$app = JFactory::getApplication();
$router = $app->getRouter();
$getorderby = JRequest::getVar('order_by', DEFAULT_PRODUCT_ORDERING_METHOD);
$vars = array('option' => 'com_redshop', 'view' => 'search', 'layout' => $layout, 'keyword' => $keyword, 'manufacture_id' => $manufacture_id, 'order_by' => $getorderby, 'category_id' => $cid, 'Itemid' => $Itemid, 'limit' => $limit);
$router->setVars($vars);
unset($vars);
if (strstr($template_org, "{pagination}")) {
$pagination = new redPagination($total_product, $start, $endlimit);
$slidertag = $pagination->getPagesLinks();
if (strstr($template_org, "{product_display_limit}")) {
$slidertag = "<form action='' method='post'><input type='hidden' name='keyword' value='{$keyword}'>\n\t\t\t<input type='hidden' name='category_id' value='{$cid}'>\n\t\t\t<input type='hidden' name='manufacture_id' value='{$manufacture_id}'>\n\t\t\t<input type='hidden' name='templateid' value='{$templateid}'> " . $pagination->getListFooter() . "</form>";
$template_org = str_replace("{product_display_limit}", $slidertag, $template_org);
$template_org = str_replace("{pagination}", '', $template_org);
}
$template_org = str_replace("{pagination}", $slidertag, $template_org);
}
$template_org = str_replace("{product_display_limit}", "", $template_org);
if (strstr($template_org, "perpagelimit:")) {
$perpage = explode('{perpagelimit:', $template_org);
$perpage = explode('}', $perpage[1]);
$template_org = str_replace("{perpagelimit:" . intval($perpage[0]) . "}", "", $template_org);
}
$template_org = str_replace("{order_by}", $orderby_form, $template_org);
$template_org = str_replace("{order_by_lbl}", JText::_('COM_REDSHOP_SELECT_ORDER_BY'), $template_org);
$template_org = str_replace("{filter_by_lbl}", JText::_('COM_REDSHOP_SELECT_FILTER_BY'), $template_org);
$template_org = str_replace("{attribute_price_with_vat}", "", $template_org);
$template_org = str_replace("{attribute_price_without_vat}", "", $template_org);
$template_org = str_replace("{product_loop_start}", "", $template_org);
$template_org = str_replace("{product_loop_end}", "", $template_org);
$template_org = str_replace($template_tmp_desc, $data, $template_org);
$template_org = str_replace("{with_vat}", "", $template_org);
$template_org = str_replace("{without_vat}", "", $template_org);
$template_org = $redTemplate->parseredSHOPplugin($template_org);
$template_org = $texts->replace_texts($template_org);
eval("?>" . $template_org . "<?php ");
} else {
echo "<br><h3>" . JText::_('COM_REDSHOP_MSG_SORRY_NO_RESULT_FOUND') . "</h3>";
}
}
示例4:
$template = str_replace('{product_delivery_time}', $exp_div . $product_delivery_time . $div_end . $td_end . $td_start . "{product_delivery_time}", $template);
}
if (strstr($template, "{product_availability_date}")) {
$available_date = "";
if ($product->product_availability_date != "") {
$available_date = $config->convertDateFormat($product->product_availability_date);
}
$template = str_replace('{product_availability_date}', $exp_div . $available_date . $div_end . $td_end . $td_start . "{product_availability_date}", $template);
}
if (strstr($template, "{product_category}")) {
$category = $producthelper->getSection('category', $compare[$i]["category_id"]);
$template = str_replace('{product_category}', $exp_div . $category->category_name . $div_end . $td_end . $td_start . "{product_category}", $template);
}
$template = str_replace('{remove}', $exp_div . $remove . $div_end . $td_end . $td_start . "{remove}", $template);
if (strstr($template, "{add_to_cart}")) {
$addtocart = $producthelper->replaceCartTemplate($compare[$i]["product_id"], 0, 0, 0, '{form_addtocart:add_to_cart1}');
$template = str_replace('{add_to_cart}', $exp_div . $addtocart . $div_end . $td_end . $td_start . "{add_to_cart}", $template);
}
// Extra field display
for ($tag = 0; $tag < count($product_tag); $tag++) {
$str = "'" . $product_tag[$tag] . "'";
if ($i != $compare['idx'] - 1) {
$template = str_replace('{' . $product_tag[$tag] . '}', $exp_div . '{' . $product_tag[$tag] . '}' . $div_end . $td_end . $td_start . '{addedext_tag}', $template);
}
$template = $field->extra_field_display("1", $product->product_id, $str, $template);
$template = str_replace('{addedext_tag}', '{' . $product_tag[$tag] . '}', $template);
}
}
$template = str_replace('{expand_collapse}', "", $template);
$template = str_replace('{product_name}', "", $template);
$template = str_replace('{product_image}', "", $template);
示例5: eval
}
$template = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $template);
$template = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $template);
}
$product_userfileds_form = "<form method='post' action='' id='user_fields_form' name='user_fields_form'>";
if ($ufield != "") {
$template = str_replace("{if giftcard_userfield}", $product_userfileds_form, $template);
$template = str_replace("{giftcard_userfield end if}", "</form>", $template);
} else {
$template = str_replace("{if giftcard_userfield}", "", $template);
$template = str_replace("{giftcard_userfield end if}", "", $template);
}
}
// Product User Field End
// Cart
$template = $producthelper->replaceCartTemplate($gid, 0, 0, 0, $template, false, $userfieldArr, 0, 0, $count_no_user_field, 0, $gid);
$template = $redTemplate->parseredSHOPplugin($template);
echo eval("?>" . $template . "<?php ");
} else {
if (strstr($template, "{giftcard_loop_start}") && strstr($template, "{giftcard_loop_end}")) {
$template_d1 = explode("{giftcard_loop_start}", $template);
$template_d2 = explode("{giftcard_loop_end}", $template_d1[1]);
$template_desc = $template_d2[0];
$data_add = "";
for ($i = 0; $i < count($detail); $i++) {
$data_add .= $template_desc;
$gid = $detail[$i]->giftcard_id;
$link = JRoute::_('index.php?option=com_redshop&view=giftcard&gid=' . $gid . '&Itemid=' . $itemid);
if (strstr($data_add, "{giftcard_image}")) {
$product_img = $objhelper->watermark('giftcard', $detail[$i]->giftcard_image, GIFTCARD_LIST_THUMB_WIDTH, GIFTCARD_LIST_THUMB_HEIGHT, WATERMARK_GIFTCART_THUMB_IMAGE, '0');
$linkimage = $objhelper->watermark('giftcard', $detail[$i]->giftcard_image, '', '', WATERMARK_GIFTCART_IMAGE, '0');
示例6: display_products
function display_products($rows)
{
$url = JURI::base();
$extra_data = new producthelper();
$producthelper = new producthelper();
for ($i = 0; $i < count($rows); $i++) {
$row = $rows[$i];
$Itemid = $this->redHelper->getItemid($row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$product_price = $producthelper->getProductPrice($row->product_id);
$productArr = $producthelper->getProductNetPrice($row->product_id);
$product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
if ($row->product_full_image) {
echo $thum_image = "<div class='mod_wishlist_product_image' >" . ($thum_image = $producthelper->getProductImage($row->product_id, $link, "100", "100") . "\n\t\t\t</div>");
}
echo "<a href='" . $link . "'>" . $row->product_name . "</a><br>";
if ($row->product_on_sale && $product_price_discount > 0) {
if ($product_price > $product_price_discount) {
$s_price = $product_price - $product_price_discount;
if ($this->show_discountpricelayout) {
echo "<div id='mod_redoldprice' class='mod_redoldprice'><span style='text-decoration:line-through;'>" . $producthelper->getProductFormattedPrice($product_price) . "</span></div>";
$product_price = $product_price_discount;
echo "<div id='mod_redmainprice' class='mod_redmainprice'>" . $producthelper->getProductFormattedPrice($product_price_discount) . "</div>";
echo "<div id='mod_redsavedprice' class='mod_redsavedprice'>" . JText::_('COM_REDSHOP_PRODCUT_PRICE_YOU_SAVED') . ' ' . $producthelper->getProductFormattedPrice($s_price) . "</div>";
} else {
$product_price = $product_price_discount;
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
echo "<br><a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a> ";
echo $addtocartdata = $producthelper->replaceCartTemplate($row->product_id);
echo "<div>" . $addtocartdata . "</div>";
}
}
示例7: productalladdprice
}
}
// Product User Field End
$rmore = "<a href='" . $link . "' title='" . $row->product_name . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>";
$wishlist_data = str_replace("{read_more}", $rmore, $wishlist_data);
$wishlist_data = str_replace("{read_more_link}", $link, $wishlist_data);
$remove = '<a href="' . $link_remove . '" title="" style="text-decoration:none;">' . JText::_("COM_REDSHOP_REMOVE_PRODUCT_FROM_WISHLIST") . '</a>';
$wishlist_data = str_replace('{remove_product_link}', $remove, $wishlist_data);
// Extra field display
$wishlist_data = $producthelper->getExtraSectionTag($extraFieldName, $row->product_id, "1", $wishlist_data, 1);
$wishlist_data = str_replace("{if product_on_sale}", "", $wishlist_data);
$wishlist_data = str_replace("{product_on_sale end if}", "", $wishlist_data);
if (isset($row->category_id) === false) {
$row->category_id = 0;
}
$wishlist_data = $producthelper->replaceCartTemplate($row->product_id, $row->category_id, 0, 0, $wishlist_data, $isChilds, $userfieldArr, $totalatt, $totalAccessory, $count_no_user_field);
$mainid .= $row->product_id . ",";
$totattid .= $totalatt . ",";
$totcount_no_user_field .= $count_no_user_field . ",";
$temp_template .= $wishlist_data;
}
$my = "<form name='frm' method='POST' action=''>";
$my .= "<input type='hidden' name='product_id' id='product_id' value='" . $mainid . "' >\n\n\t\t\t<input type='hidden' name='totacc_id' id='totacc_id' value='" . $totattid . "' >\n\t\t\t<input type='hidden' name='totcount_no_user_field' id='totcount_no_user_field' value='" . $totcount_no_user_field . "' >\n\t\t\t<input type='button' name='submit' onclick='return productalladdprice();' value='" . JText::_('COM_REDSHOP_ADD_TO_CART') . "'>\n\t\t\t</form>";
} else {
echo "<div>" . JText::_('COM_REDSHOP_NO_PRODUCTS_IN_WISHLIST') . "</div>";
}
$data = $template_d1[0] . $temp_template . $template_d2[1];
$back_link = '<a href="' . JRoute::_('index.php?option=com_redshop&view=account&Itemid=' . $Itemid) . '" title="' . JText::_('COM_REDSHOP_BACK_TO_MYACCOUNT') . '">' . JText::_('COM_REDSHOP_BACK_TO_MYACCOUNT') . '</a>';
$data = str_replace('{back_link}', $back_link, $data);
$mail_link = '';
if (count($MyWishlist) > 0) {