Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2017
    Posts
    3
    Plugin Contributions
    0

    Default Want to add the same manufacturer's product on the product detail page

    The following is to call the same classification products, whether it can be modified to call the same manufacturer's products, how to modify, I tried for a long time are prompted wrong.


    <div class="centerBoxWrapper" id="sj_product">
    <?php

    $products_id = (int)$_GET['products_id'];

    $flash_page_id_con = array();
    $flash_page_images_con = array();
    $flash_page_price_con = array();
    $flash_page_name_con = array();


    $flash_page_query = "select p.products_id,p.products_image,pd.products_name from " . TABLE_PRODUCTS ." p, ". TABLE_PRODUCTS_DESCRIPTION . " pd where p.`products_id`=pd.`products_id` AND p.`products_status`='1' AND pd.`language_id` = '" . (int)$_SESSION['languages_id'] . "' AND p.`master_categories_id` = " . zen_get_products_category_id($products_id) . " ORDER BY rand() limit 8";


    $flash_page = $db->Execute($flash_page_query);
    while(!$flash_page->EOF){
    $flash_page_items[] = $flash_page->fields;
    $flash_page_id_con[] = $flash_page->fields['products_id'];
    $flash_page_images_src = is_int(strpos($flash_page->fields['products_image'],','))? substr($flash_page->fields['products_image'],0,strpos($flash_page->fields['products_image'],',')):$flash_page->fields['products_image'];
    $flash_page_images_con[] = '"'.(zen_not_null($flash_page->fields['products_image']) ? $flash_page_images_src : PRODUCTS_IMAGE_NO_IMAGE ).'"';
    $flash_page_price_con[] = '"'.$currencies->display_price(zen_get_products_base_price($flash_page->fields['products_id']),zen_get_tax_rate($product_check->fields['products_tax_class_id'])).'"';
    $flash_page_name_con[] = '"'.zen_output_string(zen_get_products_name($flash_page->fields['products_id'])).'"';
    $flash_page->MoveNext();
    }

    $flash_page_id = implode(",", $flash_page_id_con);
    $flash_page_images = implode(",", $flash_page_images_con);
    $flash_page_price = implode(",", $flash_page_price_con);
    $flash_page_name = implode(",", $flash_page_name_con);
    $flash_page_display_num = $flash_page->RecordCount();
    ?>
    <?php for($i = 0; $i< $flash_page_display_num ; $i++){?>
    <div class="centerBoxContentsFeatured centeredContent back productsjackid" id="li<?php echo $i;?>">
    <div class="pr_images"><a href="<?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']);?>"><?php echo zen_image(DIR_WS_IMAGES . $flash_page_items[$i]['products_image'], $flash_page_items[$i]['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT); ?></a></div>
    <div class="pr_name"><a href="<?php echo zen_href_link(zen_get_info_page($flash_page_items[$i]['products_id']), 'products_id=' . $flash_page_items[$i]['products_id']);?>"><?php echo $flash_page_items[$i]['products_name']; ?></a></div>
    </div>
    <?php
    //print_r($flash_page_items[$i]);
    }
    ?>
    </div>
    Last edited by jack017; 3 Nov 2017 at 07:29 AM.

 

 

Similar Threads

  1. When I add a new product another product in the same category gets deleted!
    By advhealth in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Jan 2013, 01:03 AM
  2. Need to display manufacturer name in product detail page
    By tabor.carlton in forum General Questions
    Replies: 4
    Last Post: 18 Sep 2009, 02:59 AM
  3. i want to add a button to the product page
    By semaxd in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 Nov 2008, 12:01 AM
  4. I want to add text under the attributes on the product detail page.
    By illum in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Feb 2008, 12:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR