Displaying manufacturer name on a product details page

  1. Open the fn_catalog.php file located in the core directory of your CS-Cart installation.
  2. Find and replace this part of the code:
    // Add product prices with taxes and without taxes
        if (!empty($product) && @$settings['Appearance']['show_prices_taxed_clean'] == 'Y') {
            $tx_prices = fn_get_taxed_and_clean_prices($product);
            if (!empty($tx_prices)) {
                $product = fn_array_merge($product, $tx_prices);
            }
        }
        
        $function = __FUNCTION__;
        include CORE_DIR . 'addons_inheritance.php';

    with this one:
    // Add product prices with taxes and without taxes
        if (!empty($product) && @$settings['Appearance']['show_prices_taxed_clean'] == 'Y') {
            $tx_prices = fn_get_taxed_and_clean_prices($product);
            if (!empty($tx_prices)) {
                $product = fn_array_merge($product, $tx_prices);
            }
        }
    
    $product['manufacturer'] = fn_get_manufacturer_data($product['manufacturer_id'], $cart_language);
    $product['manufacturer_name']=$product['manufacturer']['manufacturer'];
        
        $function = __FUNCTION__;
        include CORE_DIR . 'addons_inheritance.php';
  3. Save the file.
  4. Open the product_details.tpl file located in the skins/[CUSTOMER_ACTIVE_SKIN]/customer/products_pages directory of your CS-Cart installation, where [CUSTOMER_ACTIVE_SKIN] is an active skin of your storefront.
  5. Add the following part of the code:
    {if $product.manufacturer}
    <div ><b>{$lang.manufacturer}</b>:&nbsp;{$product.manufacturer.manufacturer}</div>
    {/if}

    below, for example, this one:
    <div class="product-image">
        {include file="common_templates/image.tpl" show_detailed_link="Y" obj_id=$product.product_id images=$product.main_pair object_type="product"}</div>
  6. Save the file.
If you would like to display a manufacturer name on a product list pages also:
  1. Open the search_products.php file located in the include/common directory of your CS-Cart installation.
  2. Find and replace this line of the code:
    $fields = "products.product_id, descr1.product as product, products.tracking, products.feature_comparison, products.zero_price_action, products.product_type";

    with this one:
    $fields = "products.product_id, products.manufacturer_id, descr1.product as product, products.tracking, products.feature_comparison, products.zero_price_action, products.product_type";
  3. Save the file.
  4. Add this part of the code:
    {if $product.manufacturer}
    <div ><b>{$lang.manufacturer}</b>:&nbsp;{$product.manufacturer.manufacturer}</div>
    {/if}

    to the appropriate places of the products.tpl, product_advanced.tpl and product_multicolumns.tpl files located in the skins/[CUSTOMER_ACTIVE_SKIN]/customer/products_pages directory of your CS-Cart installation.

Noticed an error in the article or it is not clear enough? Any suggestions to improve it? Please let us know by filling in the feedback form. Click here.