Results 1 to 3 of 3
  1. #1

    Default Products name don't change as picture when click "Next Arrow" on product flash page

    I've been trying for a while, and I can't seem to fix the following problems:

    My product pages show the rest products of the same category in a box under nav menu as following picture:


    When I click the "Back Button" or the "Next Button" to see another products in the box, the next 8 products will be showed. The picture of each product has been changed, but the product name is not changed, and still keep the products name of the first page. So the product name could not be related to the product picture. I have tried many many times to solve the problem, but in vain.

    Please refer to the following details in pictures highlight:



    Please see this page as an example:
    http://www.chinaveboss.com/iphone-4s...ack_p1583.html

    Also it seems that the flash page is controlled by Script Code. So I copy the code from my PHP file for reference:

    <?php for($i = 0; $i< $flash_page_display_num ; $i++){?>

    <li id="li<?php echo $i;?>" style="display:block;">

    <a class="ih" id="cell_link<?php echo $i;?>" 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_OLD(DIR_WS_IMAGES.$flash_page_items[$i]['products_image'],SEO_COMMON_KEYWORDS.' '.$flash_page_items[$i]['products_name'],86,86,'id="cell_img'.$i.'" class="'.(($flash_page_items[$i]['products_id'] == $_GET['products_id']) ? 'allborder':'').'"');?></a>

    <p><a class="f_p_name" id="cell_name_link<?php echo $i ?>" 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_clipped_string($flash_page_items[$i]['products_name'],' ',35); ?></a></p>

    <p><strong id="cell_price<?php echo $i?>" class="white"><?php echo $currencies->display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check->fields['products_tax_class_id'])); ?></strong></p>

    </li>

    <?php

    //print_r($flash_page_items[$i]);

    }

    ?>

    </ul>

    </div>



    <script type="text/javascript">

    var productTotal = <?php echo intval($flash_page->RecordCount());?>;

    var productCurrent = <?php echo intval(array_search($_GET['products_id'],$flash_page_id_con));?>;

    var productID = new Array();

    var productPrice = new Array();

    var productIMG = new Array();

    var productName = new Array();

    var imgURL = baseURL+'images/';

    var linkURL = baseURL+"index.php?main_page=product_info&products_id=";

    var productSourcePrice = null;

    var productSubName = null;

    var productName = null;

    <?php ?>

    var productFlg = null;

    productID = [<?php echo $flash_page_id;?>];

    productPrice = [<?php echo $flash_page_price;?>];

    productIMG = [<?php echo $flash_page_images;?>];

    productName = [<?php echo $flash_page_name;?>];

    page_go('recent_flash_small','8', productCurrent, productTotal, '<?php echo $_GET['products_id']?>');

    </script>

    I don't learn php code and script code. I apologize for the questions. Any help will be appreciated!
    Last edited by Eric Chen; 15 May 2012 at 02:57 PM.

  2. #2

    Default Re: Products name don't change as picture when click "Next Arrow" on product flash pa

    The following is the full code of the php file named tpl_product_flash_page.php:

    <?php

    /**

    * Page Template

    *

    * @package templateSystem

    * @copyright Copyright 2003-2005 Zen Cart Development Team

    * @copyright Portions Copyright 2003 osCommerce

    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

    * @version $Id: tpl_products_next_previous.php 6912 2007-09-02 02:23:45Z drbyte $

    */



    /*

    WebMakers.com Added: Previous/Next through categories products

    Thanks to Nirvana, Yoja and Joachim de Boer

    Modifications: Linda McGrath [email protected]

    */



    ?>

    <div class="fl relative pad_1em" id="product_flash_page">

    <span id="recent_flash_smallPrev" class="recent_flash_prev" title="Back"></span>

    <span id="recent_flash_smallNext" class="recent_flash_next" title="Next"></span>

    <ul class="margin_t max_flash_width" id="recent_flash_small">


    <?php

    $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 master_categories_id = " . zen_get_products_category_id($products_id) . " order by p.products_sort_order";

    $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()< 8 )? $flash_page->RecordCount(): 8;

    ?>



    <?php for($i = 0; $i< $flash_page_display_num ; $i++){?>

    <li id="li<?php echo $i;?>" style="display:block;">

    <a class="ih" id="cell_link<?php echo $i;?>" 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_OLD(DIR_WS_IMAGES.$flash_page_items[$i]['products_image'],SEO_COMMON_KEYWORDS.' '.$flash_page_items[$i]['products_name'],86,86,'id="cell_img'.$i.'" class="'.(($flash_page_items[$i]['products_id'] == $_GET['products_id']) ? 'allborder':'').'"');?></a>
    <p><a class="f_p_name" id="cell_name_link<?php echo $i ?>" 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_clipped_string($flash_page_items[$i]['products_name'],' ',35); ?></a></p>
    <p><strong id="cell_price<?php echo $i?>" class="white"><?php echo $currencies->display_price((zen_get_products_base_price($flash_page_items[$i]['products_id']) == 0 ? zen_get_products_sample_price($flash_page_items[$i]['products_id']): zen_get_products_base_price($flash_page_items[$i]['products_id'])),zen_get_tax_rate($product_check->fields['products_tax_class_id'])); ?></strong></p>

    </li>

    <?php

    //print_r($flash_page_items[$i]);

    }

    ?>

    </ul>

    </div>





    <script type="text/javascript">

    var productTotal = <?php echo intval($flash_page->RecordCount());?>;

    var productCurrent = <?php echo intval(array_search($_GET['products_id'],$flash_page_id_con));?>;

    var productID = new Array();

    var productPrice = new Array();

    var productIMG = new Array();

    var productName = new Array();

    var imgURL = baseURL+'images/';

    var linkURL = baseURL+"index.php?main_page=product_info&products_id=";

    var productSourcePrice = null;

    var productSubName = null;

    var productName = null;

    <?php ?>

    var productFlg = null;

    productID = [<?php echo $flash_page_id;?>];

    productPrice = [<?php echo $flash_page_price;?>];

    productIMG = [<?php echo $flash_page_images;?>];

    productName = [<?php echo $flash_page_name;?>];

    page_go('recent_flash_small','8', productCurrent, productTotal, '<?php echo $_GET['products_id']?>');

    </script>

    I apologize for the questions. Any help will be appreciated!

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Products name don't change as picture when click "Next Arrow" on product flash pa

    Reposting the same question in another place will not get you better help, it will just confuse and annoy those who might be able to help.
    http://www.zen-cart.com/showthread.p...uct-flash-page

    As DrByte told you, you will need to get the one who wrote the script to fix its problem.

 

 

Similar Threads

  1. v150 Need to change breadcrumb puzzling "::" to ">" or an arrow image? How?
    By zenartman in forum Customization from the Admin
    Replies: 2
    Last Post: 16 Apr 2015, 05:27 PM
  2. v138a Products name don't change as picture when click "Next Arrow" on product flash page
    By Eric Chen in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 15 May 2012, 03:10 PM
  3. What does the public see when they click "new products"
    By sofasurfer in forum General Questions
    Replies: 3
    Last Post: 12 Jul 2011, 08:20 AM
  4. Replies: 16
    Last Post: 21 Apr 2010, 07:38 PM
  5. Replies: 0
    Last Post: 3 May 2008, 12:19 PM

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