webmaster-paris
Membre récent

Hors-Ligne
Sexe: 
Messages: 47

webmaster sur paris / création site internet paris
|
Merci Webd pour ta reponse mais c'est vrai que je suis pas trés fort en php surtout j'arrive pas à comprendre...
j'ai fais donc une recherche sur cette fonction et j'ai trouver le fichier ou est d'ecrit cette fonction dont voici le bout de script:
function show_snapshot($product_sku, $show_price=true, $show_addtocart=true, $show_product_name = true ) { echo $this->product_snapshot( $product_sku, $show_price, $show_addtocart, $show_product_name ); }
/** * Returns HTML code for a snapshot of a product based on the product sku. * This was written to provide a quick way to display a product inside of modules * * @param string $product_sku The SKU identifying the product * @param boolean $show_price Show the product price? * @param boolean $show_addtocart Show the add-to-cart link? * @param boolean $show_product_name Show the product name? */ function product_snapshot( $product_sku, $show_price=true, $show_addtocart=true, $show_product_name = true ) {
global $sess, $mm_action_url;
$db = new ps_DB;
require_once(CLASSPATH.'ps_product_category.php'); $ps_product_category = new ps_product_category;
$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image FROM #__{vm}_product WHERE product_sku='$product_sku'"; $db->query( $q );
if ($db->next_record()) { $product_id = $db->f("product_id" ); $tpl = new $GLOBALS['VM_THEMECLASS'](); $cid = $ps_product_category->get_cid( $product_id );
$tpl->set( 'product_id', $product_id); $tpl->set( 'product_name', $db->f("product_name") ); $tpl->set( 'show_product_name', $show_product_name ); if ($db->f("product_parent_id")) { $url = "?page=shop.product_details&category_id=$cid&flypage=".$this->get_flypage($db->f("product_parent_id")); $url .= "&product_id=" . $db->f("product_parent_id"); } else { $url = "?page=shop.product_details&category_id=$cid&flypage=".$this->get_flypage($db->f("product_id")); $url .= "&product_id=" . $db->f("product_id"); } $product_link = $sess->url($mm_action_url. "index.php" . $url); $tpl->set( 'product_link', $product_link ); $tpl->set( 'product_thumb_image', $db->f("product_thumb_image"), "alt=\"".$db->f("product_name")."\"");
if (_SHOW_PRICES == '1' && $show_price) { // Show price, but without "including X% tax" $price = $this->show_price( $db->f("product_id"), true ); $tpl->set( 'price', $price ); } if (USE_AS_CATALOGUE != 1 && $show_addtocart && isset( $GLOBALS['product_info'][$product_id]['price']['product_price_id'] ) // Product must have a price to add it to cart && !$this->product_has_attributes($product_id, true) // Parent Products and Products with attributes can't be added to cart this way ) { $url = "?page=shop.cart&func=cartAdd&product_id=" . $db->f("product_id"); $addtocart_link = $sess->url($mm_action_url. "index.php" . $url); $tpl->set( 'addtocart_link', $addtocart_link ); } return $tpl->fetch( 'common/productsnapshot.tpl.php'); } return ''; }
/** * Use this function if you need the weight of a product * * @param int $prod_id * @return int The weight of the product */ function get_weight($prod_id) { return (float)$this->get_field( $prod_id, "product_weight"); } /** * Print the availability HTML code for product $prod_id * * @param int $prod_id */
si tu pouvez me dire ce que je doit faire pour rajouter la possibilité de faire du css
merci |