コード例 #1
0
$url = JURI::base();
// Get product helper
require_once JPATH_ROOT . '/components/com_redshop/helpers/product.php';
require_once JPATH_SITE . '/components/com_redshop/helpers/extra_field.php';
$producthelper = new producthelper();
$print = $this->input->getBool('print', false);
$user = JFactory::getUser();
$pagetitle = JText::_('COM_REDSHOP_COMPARE_PRODUCTS');
$config = new Redconfiguration();
$compare = $producthelper->getCompare();
$stockroomhelper = new rsstockroomhelper();
if (PRODUCT_COMPARISON_TYPE == 'category') {
    $compare_product = $this->session->get('compare_product');
    $catid = $compare_product[0]['category_id'];
    $cid = $this->input->getInt('cid', null);
    $template_id = $producthelper->getCategoryCompareTemplate($catid);
    if ($template_id == "") {
        $compare_template = $this->redTemplate->getTemplate("compare_product", COMPARE_TEMPLATE_ID);
    } else {
        $compare_template = $this->redTemplate->getTemplate("compare_product", $template_id);
    }
} else {
    $compare_template = $this->redTemplate->getTemplate("compare_product", COMPARE_TEMPLATE_ID);
}
if (count($compare_template) > 0 && $compare_template[0]->template_desc != "") {
    $template = $compare_template[0]->template_desc;
} else {
    $template = "<div><span>{compare_product_heading}</span></div><div><a href=\"{returntocategory_link}\">{returntocategory_name}</a></div><table border=\"1\"><tbody><tr><th> </th><td align=\"center\">{expand_collapse}</td></tr><tr><th>Product Name</th><td>{product_name}</td></tr><tr><th>Image</th><td>{product_image}</td></tr><tr><th>Manufacturer</th><td>{manufacturer_name}</td></tr><tr><th>Discount Start <br /></th><td>{discount_start_date}</td></tr><tr><th>Discount End<br /></th><td>{discount_end_date}</td></tr><tr><th>Price</th><td>{product_price}</td></tr><tr><th>Short Desc<br /></th><td>{product_s_desc}</td></tr><tr><th>Desc</th><td>{product_desc}</td></tr><tr><th>Rating</th><td>{product_rating_summary}</td></tr><tr><th>Delivery Time</th><td>{product_delivery_time}</td></tr><tr><th>Product Number<br /></th><td>{product_number}</td></tr><tr><th>Stock<br /></th><td>{products_in_stock}</td></tr><tr><th>Stock<br /></th><td>{product_stock_amount_image}</td></tr><tr><th>Weight<br /></th><td>{product_weight}</td></tr><tr><th>Length<br /></th><td>{product_length}</td></tr><tr><th>Height<br /></th><td>{product_height}</td></tr><tr><th>Width<br /></th><td>{product_width}</td></tr><tr><th>Availability Date<br /></th><td>{product_availability_date}</td></tr><tr><th>Volume<br /></th><td>{product_volume}</td></tr><tr><th>Category<br /></th><td>{product_category}</td></tr><tr><th> </th><td>{remove}</td></tr><tr><th> </th><td>{add_to_cart}</td></tr></tbody></table>";
}
$template = str_replace('{compare_product_heading}', $pagetitle, $template);
if (isset($compare['idx']) && $compare['idx'] == 1) {