Forums / Setting Up Categories, Products, Attributes / Products name don't change as picture when click "Next Arrow" on product flash page

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

Started by eric_chen on 13 May 2012, 5:17 PM · Views: 2,142

Results 1 to 4 of 4
13 May 2012, 5:17 PM
#1
eric_chen avatar

eric_chen

New Zenner

Join Date:
May 2012
Posts:
39
Plugin Contributions:
0

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:
Attachment 10458
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:
Attachment 10459
Attachment 10460

Please see this page as an example:
http://www.chinaveboss.com/iphone-4s-lcd-and-touch-screen-with-frame-assembly-black_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!

14 May 2012, 3:16 AM
#2
eric_chen avatar

eric_chen

New Zenner

Join Date:
May 2012
Posts:
39
Plugin Contributions:
0

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

Please could anyone help me? Thank you in advance. Greeting.

14 May 2012, 3:46 PM
#3
eric_chen avatar

eric_chen

New Zenner

Join Date:
May 2012
Posts:
39
Plugin Contributions:
0

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

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!

15 May 2012, 2:10 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

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

Whoever wrote your custom code for your Flash program and your PHP files must fix that problem.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.