8796 sujets

Développement web côté serveur, CMS

Bonjour,

Je travail actuellement sur un site de vente en ligne. J'ai un diaporama qui défile des images , je voudrais remplacer les images de ce diaporama, par mes produits en promotions. j'utilise oscommerce v2.3

voici le code du diap:

<div id="outer_container">
<div id="thumbScroller">
<div class="container">
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/100_0675.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/dsc01233.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/dsc01243.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/img_0024.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010565.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010564.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010565.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/img_0065.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img sr



oscommerce v2.3 à déjà un système de promotions, le problème est que avec ce système le images ne défile.


voici le code de ce système :

<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2010 osCommerce

Released under the GNU General Public License
*/

class bm_specials {
var $code = 'bm_specials';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;

function bm_specials() {
$this->title = MODULE_BOXES_SPECIALS_TITLE;
$this->description = MODULE_BOXES_SPECIALS_DESCRIPTION;

if ( defined('MODULE_BOXES_SPECIALS_STATUS') ) {
$this->sort_order = MODULE_BOXES_SPECIALS_SORT_ORDER;
$this->enabled = (MODULE_BOXES_SPECIALS_STATUS == 'True');

$this->group = ((MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}

function execute() {
global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;

if (!isset($HTTP_GET_VARS['products_id'])) {
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a></div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span></div>' .
'</div>';

$oscTemplate->addBlock($data, $this->group);
}
}
}

function isEnabled() {
return $this->enabled;
}

function check() {
return defined('MODULE_BOXES_SPECIALS_STATUS');
}

function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Module', 'MODULE_BOXES_SPECIALS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SPECIALS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
}

function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
return array('MODULE_BOXES_SPECIALS_STATUS', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SORT_ORDER');
}
}
?>




J'ai déjà cherché sur google un système de promotions qui défile d'oscommerce. j'ai rien trouvé.

Merci d'avance. Smiley smile
Salut,

En tant que modérateur, je me dois de te faire remarquer que tu n'as malheureusement pas respecté l'une des Règles de base du forum qui est d'afficher les codes et exemples proprement à l'aide des boutons [ code]... ici ton code HTML, CSS, PHP, etc.[ /code] (sans espace).

Je te remercie par avance de bien vouloir éditer ton message afin de le rendre conforme à cette règle. Smiley cligne

Bonne continuation Smiley smile

upload/1-code.gif
Modifié par Mikachu (23 May 2011 - 12:49)
Salut Mikachou,


Voici mon code en propre


<div id="outer_container">
<div id="thumbScroller">
<div class="container">
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/100_0675.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/dsc01233.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/dsc01243.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/img_0024.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010565.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010564.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/p1010565.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/img_0065.jpg" class="thumb" /></a></div></div>
<div class="content">
<div><a href="#"><img src="flash/jquery_thumbnail_scroller/2/thumbs/thumb3.jpg" class="thumb" /></a></div></div>
</div></div></div>


et voici le code php :

<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 

Copyright (c) 2010 osCommerce

Released under the GNU General Public License
*/

class bm_specials {
var $code = 'bm_specials';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;

function bm_specials() {
$this->title = MODULE_BOXES_SPECIALS_TITLE;
$this->description = MODULE_BOXES_SPECIALS_DESCRIPTION;

if ( defined('MODULE_BOXES_SPECIALS_STATUS') ) {
$this->sort_order = MODULE_BOXES_SPECIALS_SORT_ORDER;
$this->enabled = (MODULE_BOXES_SPECIALS_STATUS == 'True');

$this->group = ((MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}

function execute() {
global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;

if (!isset($HTTP_GET_VARS['products_id'])) {
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a></div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span></div>' .
'</div>';

$oscTemplate->addBlock($data, $this->group);
}
}
}

function isEnabled() {
return $this->enabled;
}

function check() {
return defined('MODULE_BOXES_SPECIALS_STATUS');
}

function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Module', 'MODULE_BOXES_SPECIALS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SPECIALS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
}

function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
return array('MODULE_BOXES_SPECIALS_STATUS', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SORT_ORDER');
}
}
?>



Tu as une idée pour mon problème ??
Smiley cligne