osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> pb adaptation qt pro 4.6
gaet
posté 20 Nov 2013, 15:27
Message #1


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 122
Inscrit : 23-July 09
Lieu : Aveyron
Membre no 25830



Bonjour, je souhaite installer cette contribution pour gérer le stock des attributs produits. J'ai bien installé la partie administration mais j'ai deux problèmes dans la partie catalogue du à des modifications antérieures.

dans includes/application_top.php je dois remplacer ce code
Code
        case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                  $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                                }
Cependant je l'avais modifié j'ai dans mon fichier
Code
      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ (int)$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);
                              }


La contribution me dit de mettre à la place
Code
case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
        //++++ QT Pro: Begin Changed code
                                        $attributes=array();
                                        if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
                                          $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
                                          foreach ($attrlist as $attr) {
                                            list($oid, $oval)=explode('-',$attr);
                                            if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
                                              $attributes[$oid]=$oval;
                                          }
                                        }
                                        if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
                                          foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
                                            if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
                                              $attributes=$attributes + $HTTP_POST_VARS['id'];
                                          }
                                        }
                                        $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
        //++++ QT Pro: End Changed Code
                                      }


Il est donc nécessaire d'adapter le code donné par la contribution. N'étant pas développeur je bloque. Je dois simplement adapter la dernière ligne de la contribution ?

Ce message a été modifié par gaet - 20 Nov 2013, 16:52.


--------------------
OScommerce 2.2RC1 : featured-products, Ajax shopingcart, who's online enhancement, product lising columns, how did you hear, Easy graphical border, ot discount coupons, show sub categories onmouse over, maincats, URL Rewriting, header tag seoV 3.1.8
Go to the top of the page
 
Havock
posté 21 Nov 2013, 09:21
Message #2


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 912
Inscrit : 4-February 04
Membre no 1926



Bonjour Gaet.

Je n'utilise pas cette contribution, mais la modif que tu avais faite servait juste à pouvoir préciser une quantité lors de l'ajout d'un produit dans le panier.

Logiquement, comme tu le subodore , tu dois simplement adapter la dernière ligne.


--------------------
L'indispensable est en cours de traitement,
L'urgent sera traité demain,
Le normal sera traité plus tard,
Le reste on vera ...
En conclusion : les journées sont trop courtes.
Utilisateur de MS2.2 Max 1.5 - OSC-Affiliate 1.09 - Admin With Access Levels 2.1 - Meta Tag Controller/ Generator - Credit/Gift Voucher/Coupons 5.05 - Download Controller v5.3 - X-Sell MS2 - WYSIWYG HTML Editor for Admin 1.7 - Dynamic Mo Pics - Loginbox Best - Order logging before payment processing - User Tracking - Faster Page Loads, Less DB queries - Plus plein de modifs perso :-)
Go to the top of the page
 
gaet
posté 21 Nov 2013, 09:42
Message #3


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 122
Inscrit : 23-July 09
Lieu : Aveyron
Membre no 25830



Bonjour Havock, effectivement cette ligne avait été modifié pour cette raison. Pourrais tu me montrer comment l'adapter pour pouvoir continuer l'ajout de quantité dans le panier ?


--------------------
OScommerce 2.2RC1 : featured-products, Ajax shopingcart, who's online enhancement, product lising columns, how did you hear, Easy graphical border, ot discount coupons, show sub categories onmouse over, maincats, URL Rewriting, header tag seoV 3.1.8
Go to the top of the page
 
Havock
posté 21 Nov 2013, 17:01
Message #4


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 912
Inscrit : 4-February 04
Membre no 1926



Comme ça à vu de nez tu mets :

Citation
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
//++++ QT Pro: Begin Changed code
$attributes=array();
if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
$attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
foreach ($attrlist as $attr) {
list($oid, $oval)=explode('-',$attr);
if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
$attributes[$oid]=$oval;
}
}
if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
$attributes=$attributes + $HTTP_POST_VARS['id'];
}
}
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+ (int)$HTTP_POST_VARS['quantity'], $attributes);
//++++ QT Pro: End Changed Code
}


Ce message a été modifié par Havock - 21 Nov 2013, 17:01.


--------------------
L'indispensable est en cours de traitement,
L'urgent sera traité demain,
Le normal sera traité plus tard,
Le reste on vera ...
En conclusion : les journées sont trop courtes.
Utilisateur de MS2.2 Max 1.5 - OSC-Affiliate 1.09 - Admin With Access Levels 2.1 - Meta Tag Controller/ Generator - Credit/Gift Voucher/Coupons 5.05 - Download Controller v5.3 - X-Sell MS2 - WYSIWYG HTML Editor for Admin 1.7 - Dynamic Mo Pics - Loginbox Best - Order logging before payment processing - User Tracking - Faster Page Loads, Less DB queries - Plus plein de modifs perso :-)
Go to the top of the page
 
gaet
posté 21 Nov 2013, 17:09
Message #5


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 122
Inscrit : 23-July 09
Lieu : Aveyron
Membre no 25830



Ok merci beaucoup. Il me reste un dernier problème a régler concernant product-info.php
Je dois remplacer
Code
<?php
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
?>
          <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
            </tr>
<?php
      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
        $products_options_array = array();
        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
        while ($products_options = tep_db_fetch_array($products_options_query)) {
          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
          if ($products_options['options_values_price'] != '0') {
            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
          }
        }</p><p>        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
        } else {
          $selected_attribute = false;
        }
?>
            <tr>
              <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
              <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
            </tr>
<?php
      }
?>
          </table>
<?php
    }
?>


par
Code
<?php
//++++ QT Pro: Begin Changed code
    if (tep_not_null($product_info['products_image'])) {
?>
              <?php
}
//++++ QT Pro: End Changed Code
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
//++++ QT Pro: Begin Changed code
      $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);
      require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
      $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
      $pad = new $class($products_id);
      echo $pad->draw();
    }</p><p>//Display a table with which attributecombinations is on stock to the customer?
if(PRODINFO_ATTRIBUTE_DISPLAY_STOCK_LIST == 'True'): require(DIR_WS_MODULES . "qtpro_stock_table.php"); endif;</p><p>//++++ QT Pro: End Changed Code
?>


cependant dans product-info.php j'ai
Code
            <?php
    }
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_images_enabled from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
        $products_options_array = array();
        //$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
        // BOE: Attribute Sort with Clone Tool
        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");
  // EOE: Attribute Sort with Clone Tool</p><p>  while ($products_options = tep_db_fetch_array($products_options_query)) {
          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
          if ($products_options['options_values_price'] != '0') {
            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
          }
        }</p><p>        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
        } else {
          $selected_attribute = false;
        }
?>
          
              <?php echo $products_options_name['products_options_name'] . ':'; ?>
            <?php if (OPTIONS_AS_IMAGES_ENABLED == 'false')
{
?>
<?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>
            
<?php
}
else
{
if ($products_options_name['products_options_images_enabled'] == 'true'){
?>
<?php


Ce message a été modifié par gaet - 21 Nov 2013, 19:42.


--------------------
OScommerce 2.2RC1 : featured-products, Ajax shopingcart, who's online enhancement, product lising columns, how did you hear, Easy graphical border, ot discount coupons, show sub categories onmouse over, maincats, URL Rewriting, header tag seoV 3.1.8
Go to the top of the page
 
Havock
posté 22 Nov 2013, 09:27
Message #6


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 912
Inscrit : 4-February 04
Membre no 1926



Regarde les différences entre tes requêtes et celles du fichier de base. Tu as juste quelques champs à rajouter dans les requêtes de la modif pour QTpro. Cela ne présente pas de difficulté. Par exemple dans $products_options_name_query tu dois ajouter la récupération de popt.products_options_images_enabled.

Par contre il semble que tu utilises une contribution pour pouvoir éventuellement afficher les options sous forme d'images et je ne sais pas quel est sa compatibilité avec QTpro.


--------------------
L'indispensable est en cours de traitement,
L'urgent sera traité demain,
Le normal sera traité plus tard,
Le reste on vera ...
En conclusion : les journées sont trop courtes.
Utilisateur de MS2.2 Max 1.5 - OSC-Affiliate 1.09 - Admin With Access Levels 2.1 - Meta Tag Controller/ Generator - Credit/Gift Voucher/Coupons 5.05 - Download Controller v5.3 - X-Sell MS2 - WYSIWYG HTML Editor for Admin 1.7 - Dynamic Mo Pics - Loginbox Best - Order logging before payment processing - User Tracking - Faster Page Loads, Less DB queries - Plus plein de modifs perso :-)
Go to the top of the page
 
gaet
posté 22 Nov 2013, 09:36
Message #7


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 122
Inscrit : 23-July 09
Lieu : Aveyron
Membre no 25830



Bonjour, oui effectivement j'utilise l'affichage des références. Ce n'est pas une contribution mais un développement que j'avais fait réaliser.
J'ai essayer de remodifier product-info.php mais sans succès. La partie $products_options_name_query disparait avec la contribution je ne sais donc pas ou rajouter popt.products_options_images_enabled.


Ce message a été modifié par gaet - 26 Nov 2013, 14:45.


--------------------
OScommerce 2.2RC1 : featured-products, Ajax shopingcart, who's online enhancement, product lising columns, how did you hear, Easy graphical border, ot discount coupons, show sub categories onmouse over, maincats, URL Rewriting, header tag seoV 3.1.8
Go to the top of the page
 
gaet
posté 19 Feb 2014, 13:03
Message #8


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 122
Inscrit : 23-July 09
Lieu : Aveyron
Membre no 25830



Bonjour, quelqu'un pourrait il m'aider pour adapter product-info.php ?


--------------------
OScommerce 2.2RC1 : featured-products, Ajax shopingcart, who's online enhancement, product lising columns, how did you hear, Easy graphical border, ot discount coupons, show sub categories onmouse over, maincats, URL Rewriting, header tag seoV 3.1.8
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 29th March 2024 - 07:04
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)